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
a01c8de4
Commit
a01c8de4
authored
Sep 19, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.15-ysd
parent
0d0784e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
55 deletions
+58
-55
SocialFriendConfig.java
.../cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
+10
-20
TSocialFriendPushServiceImpl.java
...ifu/social/service/impl/TSocialFriendPushServiceImpl.java
+8
-34
ExcelToImage.java
...com/yifu/cloud/plus/v1/yifu/social/util/ExcelToImage.java
+40
-1
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
View file @
a01c8de4
...
@@ -160,26 +160,18 @@ public class SocialFriendConfig {
...
@@ -160,26 +160,18 @@ public class SocialFriendConfig {
if
(
type
==
2
||
type
==
4
)
{
if
(
type
==
2
||
type
==
4
)
{
// 职工社会保险减少花名册
// 职工社会保险减少花名册
fileName
=
"zgshbxjshmc"
;
fileName
=
"zgshbxjshmc"
;
}
if
(
Common
.
isNotNull
(
vo
.
getQyzgshbxzyhmc
()))
{
if
(
Common
.
isNotNull
(
vo
.
getQyzgshbxzyhmc
()))
{
JSONArray
qyzgshbxzyhmclbArr
=
new
JSONArray
();
qyzgshbxzyhmclbArr
.
add
(
vo
.
getQyzgshbxzyhmc
());
if
(
type
<
3
&&
vo
.
getImgListYgs
()
!=
null
&&
!
vo
.
getImgListYgs
().
isEmpty
())
{
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYgs
());
}
if
(
type
>
2
&&
vo
.
getImgListYsd
()
!=
null
&&
!
vo
.
getImgListYsd
().
isEmpty
())
{
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYsd
());
}
if
(
type
==
2
||
type
==
4
)
{
json
.
put
(
fileName
,
vo
.
getQyzgshbxzyhmc
());
json
.
put
(
fileName
,
vo
.
getQyzgshbxzyhmc
());
}
else
{
}
else
if
(
Common
.
isNotNull
(
vo
.
getQyzgjbylbxcbdjb
()))
{
json
.
put
(
fileName
,
qyzgshbxzyhmclbArr
);
json
.
put
(
fileName
,
vo
.
getQyzgjbylbxcbdjb
()
);
}
}
}
else
if
(
Common
.
isNotNull
(
vo
.
getQyzgjbylbxcbdjb
()))
{
}
else
{
JSONArray
qyzgshbxzyhmclbArr
=
new
JSONArray
();
JSONArray
qyzgshbxzyhmclbArr
=
new
JSONArray
();
qyzgshbxzyhmclbArr
.
add
(
vo
.
getQyzgjbylbxcbdjb
());
if
(
Common
.
isNotNull
(
vo
.
getQyzgshbxzyhmc
()))
{
qyzgshbxzyhmclbArr
.
add
(
vo
.
getQyzgshbxzyhmc
());
}
else
if
(
Common
.
isNotNull
(
vo
.
getQyzgjbylbxcbdjb
()))
{
qyzgshbxzyhmclbArr
.
add
(
vo
.
getQyzgjbylbxcbdjb
());
}
if
(
type
<
3
&&
vo
.
getImgListYgs
()
!=
null
&&
!
vo
.
getImgListYgs
().
isEmpty
())
{
if
(
type
<
3
&&
vo
.
getImgListYgs
()
!=
null
&&
!
vo
.
getImgListYgs
().
isEmpty
())
{
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYgs
());
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYgs
());
...
@@ -188,9 +180,7 @@ public class SocialFriendConfig {
...
@@ -188,9 +180,7 @@ public class SocialFriendConfig {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYsd
());
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYsd
());
}
}
if
(
type
==
2
||
type
==
4
)
{
if
(!
qyzgshbxzyhmclbArr
.
isEmpty
())
{
json
.
put
(
fileName
,
vo
.
getQyzgjbylbxcbdjb
());
}
else
{
json
.
put
(
fileName
,
qyzgshbxzyhmclbArr
);
json
.
put
(
fileName
,
qyzgshbxzyhmclbArr
);
}
}
}
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
View file @
a01c8de4
...
@@ -1042,7 +1042,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
...
@@ -1042,7 +1042,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
TSocialFriendBackLog
backLog
=
new
TSocialFriendBackLog
();
TSocialFriendBackLog
backLog
=
new
TSocialFriendBackLog
();
backLog
.
setType
(
CommonConstants
.
SEVEN_INT
);
backLog
.
setType
(
CommonConstants
.
SEVEN_INT
);
backLog
.
setSocialId
(
searchVo
.
getSocialId
());
backLog
.
setSocialId
(
searchVo
.
getSocialId
());
R
<
String
>
ulrR
=
excelToImage
.
excelToImg
(
inputStreamOut
,
socialFriendConfig
,
restTemplate
,
backLog
);
R
<
String
>
ulrR
=
excelToImage
.
excelToImg
(
searchVo
.
getSocialId
(),
ossUtil
,
tSocialFriendBackLogService
,
inputStreamOut
,
socialFriendConfig
,
restTemplate
,
backLog
);
tSocialFriendBackLogService
.
save
(
backLog
);
tSocialFriendBackLogService
.
save
(
backLog
);
return
ulrR
;
return
ulrR
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -1313,9 +1314,9 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
...
@@ -1313,9 +1314,9 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
backLog
.
setSocialId
(
vo
.
getSocialId
());
backLog
.
setSocialId
(
vo
.
getSocialId
());
backLog
.
setType
(
CommonConstants
.
SIX_INT
);
backLog
.
setType
(
CommonConstants
.
SIX_INT
);
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
// 上传花名册到阿里云
this
.
uploadHuaMingCeToOss
(
vo
,
fileName
,
inputStreamOut
);
R
<
String
>
ulrR
=
excelToImage
.
excelToImg
(
vo
.
getSocialId
(),
ossUtil
,
tSocialFriendBackLogService
R
<
String
>
ulrR
=
excelToImage
.
excelToImg
(
inputStreamOut
,
socialFriendConfig
,
restTemplate
,
backLog
);
,
inputStreamOut
,
socialFriendConfig
,
restTemplate
,
backLog
);
tSocialFriendBackLogService
.
save
(
backLog
);
tSocialFriendBackLogService
.
save
(
backLog
);
return
ulrR
;
return
ulrR
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -1335,35 +1336,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
...
@@ -1335,35 +1336,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
}
}
}
}
/**
* @param vo
* @param fileName
* @param inputStreamOut
* @Description: 上传花名册到阿里云
* @Author: hgw
* @Date: 2025/9/12 14:18
* @return: void
**/
private
void
uploadHuaMingCeToOss
(
SociaFriendYgsAddVo
vo
,
String
fileName
,
FileInputStream
inputStreamOut
)
{
try
{
String
key
=
"socialFriend/"
+
vo
.
getSocialId
()
+
"/"
+
System
.
currentTimeMillis
()
+
fileName
;
ossUtil
.
uploadFileByStream
(
inputStreamOut
,
key
,
null
);
TSocialFriendBackLog
backLogFile
=
new
TSocialFriendBackLog
();
backLogFile
.
setSocialId
(
vo
.
getSocialId
());
backLogFile
.
setType
(
19
);
backLogFile
.
setCreateTime
(
LocalDateTime
.
now
());
if
(
Common
.
isNotNull
(
key
))
{
URL
fileUrl
=
ossUtil
.
getObjectUrl
(
null
,
key
);
if
(
Common
.
isNotNull
(
fileUrl
))
{
key
+=
fileUrl
.
toString
();
}
}
backLogFile
.
setLogInfo
(
key
);
tSocialFriendBackLogService
.
save
(
backLogFile
);
}
catch
(
Exception
e
)
{
log
.
info
(
"花名册上传到阿里云失败,查看文件使用,没有找税友要也行"
);
}
}
/**
/**
* 填充主表数据
* 填充主表数据
...
@@ -1777,7 +1750,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
...
@@ -1777,7 +1750,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
backLog
.
setSocialId
(
searchVo
.
getSocialId
());
backLog
.
setSocialId
(
searchVo
.
getSocialId
());
backLog
.
setType
(
CommonConstants
.
SIX_INT
);
backLog
.
setType
(
CommonConstants
.
SIX_INT
);
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
R
<
String
>
ulrR
=
excelToImage
.
excelToImg
(
inputStreamOut
,
socialFriendConfig
,
restTemplate
,
backLog
);
R
<
String
>
ulrR
=
excelToImage
.
excelToImg
(
searchVo
.
getSocialId
(),
ossUtil
,
tSocialFriendBackLogService
,
inputStreamOut
,
socialFriendConfig
,
restTemplate
,
backLog
);
tSocialFriendBackLogService
.
save
(
backLog
);
tSocialFriendBackLogService
.
save
(
backLog
);
return
ulrR
;
return
ulrR
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/ExcelToImage.java
View file @
a01c8de4
...
@@ -9,16 +9,20 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
...
@@ -9,16 +9,20 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
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.config.SocialFriendConfig
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendBackLogService
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.BufferedImage
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.time.LocalDateTime
;
import
java.util.Base64
;
import
java.util.Base64
;
/**
/**
...
@@ -40,7 +44,8 @@ public class ExcelToImage {
...
@@ -40,7 +44,8 @@ public class ExcelToImage {
private
final
static
String
toImagOSSError
=
":ExcelToImage上传OSS异常"
;
private
final
static
String
toImagOSSError
=
":ExcelToImage上传OSS异常"
;
public
R
<
String
>
excelToImg
(
InputStream
inputStream
,
SocialFriendConfig
socialFriendConfig
public
R
<
String
>
excelToImg
(
String
socialId
,
OSSUtil
ossUtil
,
TSocialFriendBackLogService
tSocialFriendBackLogService
,
InputStream
inputStream
,
SocialFriendConfig
socialFriendConfig
,
RestTemplate
restTemplate
,
TSocialFriendBackLog
backLog
){
,
RestTemplate
restTemplate
,
TSocialFriendBackLog
backLog
){
backLog
.
setLogInfo
(
"开始转换excel为图片"
);
backLog
.
setLogInfo
(
"开始转换excel为图片"
);
if
(
null
==
inputStream
||
null
==
socialFriendConfig
){
if
(
null
==
inputStream
||
null
==
socialFriendConfig
){
...
@@ -72,6 +77,8 @@ public class ExcelToImage {
...
@@ -72,6 +77,8 @@ public class ExcelToImage {
if
(
Common
.
isEmpty
(
url
)){
if
(
Common
.
isEmpty
(
url
)){
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
+
toImagOSSError
);
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
+
toImagOSSError
);
}
}
// 上传花名册到阿里云
this
.
uploadHuaMingCeToOss
(
ossUtil
,
tSocialFriendBackLogService
,
socialId
,
file
.
getName
(),
file
);
return
R
.
ok
(
url
);
return
R
.
ok
(
url
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -91,6 +98,38 @@ public class ExcelToImage {
...
@@ -91,6 +98,38 @@ public class ExcelToImage {
}
}
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
);
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
);
}
}
/**
* @param socialId
* @param fileName
* @param file
* @Description: 上传花名册到阿里云
* @Author: hgw
* @Date: 2025/9/12 14:18
* @return: void
**/
private
void
uploadHuaMingCeToOss
(
OSSUtil
ossUtil
,
TSocialFriendBackLogService
tSocialFriendBackLogService
,
String
socialId
,
String
fileName
,
File
file
)
{
try
{
String
key
=
"socialFriend/"
+
socialId
+
"/"
+
System
.
currentTimeMillis
()
+
fileName
;
ossUtil
.
uploadFileByFile
(
file
,
key
,
null
);
TSocialFriendBackLog
backLogFile
=
new
TSocialFriendBackLog
();
backLogFile
.
setSocialId
(
socialId
);
backLogFile
.
setType
(
19
);
backLogFile
.
setCreateTime
(
LocalDateTime
.
now
());
if
(
Common
.
isNotNull
(
key
))
{
URL
fileUrl
=
ossUtil
.
getObjectUrl
(
null
,
key
);
if
(
Common
.
isNotNull
(
fileUrl
))
{
key
+=
fileUrl
.
toString
();
}
}
backLogFile
.
setLogInfo
(
key
);
tSocialFriendBackLogService
.
save
(
backLogFile
);
}
catch
(
Exception
e
)
{
// log.info("花名册上传到阿里云失败,查看文件使用,没有找税友要也行")
}
}
//压缩文件到指定大小
//压缩文件到指定大小
private
File
compressImage
(
File
originalFile
,
String
projectRoot
)
throws
IOException
{
private
File
compressImage
(
File
originalFile
,
String
projectRoot
)
throws
IOException
{
BufferedImage
image
=
ImageIO
.
read
(
originalFile
);
BufferedImage
image
=
ImageIO
.
read
(
originalFile
);
...
...
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