Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
f09d4475
Commit
f09d4475
authored
May 27, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.11-是否自动生成解除劳动合同书 0否1是
parent
3661b067
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
IdCardUtil.java
...com/yifu/cloud/plus/v1/yifu/archives/util/IdCardUtil.java
+27
-0
TSocialFriendPushServiceImpl.java
...ifu/social/service/impl/TSocialFriendPushServiceImpl.java
+2
-2
WordToImageUtil.java
.../yifu/cloud/plus/v1/yifu/social/util/WordToImageUtil.java
+4
-3
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/util/IdCardUtil.java
View file @
f09d4475
...
...
@@ -120,4 +120,31 @@ public class IdCardUtil {
}
return
sex
;
}
/**
* 获取性别名称
* @param idNum
* @return
*/
public
static
String
getSexName
(
String
idNum
)
{
String
sex
=
"男"
;
if
(
idNum
!=
null
)
{
String
sexString
=
""
;
if
(
idNum
.
length
()
==
18
)
{
sexString
=
idNum
.
substring
(
16
,
17
);
}
else
if
(
idNum
.
length
()
==
15
)
{
sexString
=
idNum
.
substring
(
14
,
15
);
}
try
{
// 判断性别
if
(
Integer
.
parseInt
(
sexString
)
%
2
==
0
)
{
sex
=
"女"
;
}
}
catch
(
Exception
e
)
{
sex
=
"男"
;
}
}
return
sex
;
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
View file @
f09d4475
...
...
@@ -335,7 +335,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 准备替换参数
Map
<
String
,
String
>
replacements
=
new
HashMap
<>();
replacements
.
put
(
"empName"
,
vo
.
getEmpName
());
replacements
.
put
(
"empSex"
,
IdCardUtil
.
getSex
(
vo
.
getEmpIdcard
()));
replacements
.
put
(
"empSex"
,
IdCardUtil
.
getSex
Name
(
vo
.
getEmpIdcard
()));
replacements
.
put
(
"empAge"
,
String
.
valueOf
(
IdCardUtil
.
IdNOToAge
(
vo
.
getEmpIdcard
())));
replacements
.
put
(
"idCard"
,
vo
.
getEmpIdcard
());
R
<
String
>
contractRes
=
archivesDaprUtil
.
getMinDateByCardAndDeptId
(
vo
.
getEmpIdcard
(),
vo
.
getDeptId
());
...
...
@@ -354,7 +354,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
String
friendUrl
=
WordToImageUtil
.
replaceTextInWord
(
templateUrl
.
openStream
()
,
replacements
,
imageStream
,
restTemplate
,
socialFriendConfig
,
backLog
);
System
.
out
.
println
(
"看看URL111:"
+
friendUrl
);
// System.out.println("看看URL111:"+friendUrl)
tSocialFriendBackLogService
.
save
(
backLog
);
vo
.
setAutoLeaveDoc
(
friendUrl
);
}
catch
(
Exception
e
)
{
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/WordToImageUtil.java
View file @
f09d4475
...
...
@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.social.util;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.social.config.SocialFriendConfig
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog
;
import
org.apache.pdfbox.pdmodel.PDDocument
;
...
...
@@ -18,7 +17,10 @@ import org.springframework.web.client.RestTemplate;
import
javax.imageio.ImageIO
;
import
java.awt.*
;
import
java.awt.image.BufferedImage
;
import
java.io.*
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.nio.file.DirectoryNotEmptyException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
...
...
@@ -37,7 +39,6 @@ public class WordToImageUtil {
private
static
final
String
PDF_TEMP
=
"\\test126666.docx"
;
private
static
final
String
IMAGE_TEMP
=
"\\document_with_seal.png"
;
private
static
final
String
TO_IMAGE_TEMP
=
"\\ToImgTemp.png"
;
private
static
final
String
TO_IMAG_OSS_ERROR
=
":WordToImage上传OSS异常"
;
public
static
String
replaceTextInWord
(
InputStream
templateFile
,
Map
<
String
,
String
>
replacements
,
InputStream
imageStream
,
RestTemplate
restTemplate
,
SocialFriendConfig
socialFriendConfig
,
TSocialFriendBackLog
backLog
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment