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
6fc6da3d
Commit
6fc6da3d
authored
Apr 09, 2026
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7.21-优化
parent
3f9f5c77
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
31 deletions
+29
-31
SocialTask.java
...n/java/com/yifu/cloud/plus/v1/job/compont/SocialTask.java
+12
-0
TSocialFriendController.java
...us/v1/yifu/social/controller/TSocialFriendController.java
+8
-0
TSocialFriendPushService.java
...plus/v1/yifu/social/service/TSocialFriendPushService.java
+3
-0
TSocialFriendPushServiceImpl.java
...ifu/social/service/impl/TSocialFriendPushServiceImpl.java
+5
-25
ExcelToImage.java
...com/yifu/cloud/plus/v1/yifu/social/util/ExcelToImage.java
+1
-6
No files found.
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/SocialTask.java
View file @
6fc6da3d
...
@@ -205,6 +205,18 @@ public class SocialTask {
...
@@ -205,6 +205,18 @@ public class SocialTask {
"/tsocialfriend/inner/doPushFriend"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
"/tsocialfriend/inner/doPushFriend"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------1定时任务推送税友-定时任务结束------------"
);
log
.
info
(
"------------1定时任务推送税友-定时任务结束------------"
);
}
}
/**
* @Description: 定时任务清理临时文件
* @Author: hgw
* @Date: 20260409
**/
public
void
doClearFriend
()
{
log
.
info
(
"------------定时任务清理临时文件-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprProperties
.
getAppUrl
(),
daprProperties
.
getAppId
(),
"/tsocialfriend/inner/doClearFriend"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------定时任务清理临时文件-定时任务结束------------"
);
}
/**
/**
* @Description: 2定时任务获取税友
* @Description: 2定时任务获取税友
* @Author: hgw
* @Author: hgw
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TSocialFriendController.java
View file @
6fc6da3d
...
@@ -87,6 +87,14 @@ public class TSocialFriendController {
...
@@ -87,6 +87,14 @@ public class TSocialFriendController {
return
tSocialFriendPushService
.
pushFriend
(
null
,
null
,
CommonConstants
.
ONE_INT
,
null
);
return
tSocialFriendPushService
.
pushFriend
(
null
,
null
,
CommonConstants
.
ONE_INT
,
null
);
}
}
@Operation
(
description
=
"定时任务清理临时文件"
)
@PostMapping
(
"/inner/doClearFriend"
)
@SysLog
(
"定时任务清理临时文件"
)
@Inner
public
void
doClearFriend
()
{
tSocialFriendPushService
.
doClearFriend
();
}
@Operation
(
description
=
"2定时任务获取税友"
)
@Operation
(
description
=
"2定时任务获取税友"
)
@PostMapping
(
"/inner/doGetFriendByRequestId"
)
@PostMapping
(
"/inner/doGetFriendByRequestId"
)
@SysLog
(
"2定时任务获取税友"
)
@SysLog
(
"2定时任务获取税友"
)
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TSocialFriendPushService.java
View file @
6fc6da3d
...
@@ -43,6 +43,9 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> {
...
@@ -43,6 +43,9 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> {
**/
**/
R
<
String
>
pushFriend
(
List
<
String
>
dispatchIdList
,
List
<
String
>
pushDispatchIdList
,
Integer
isAuto
,
String
userId
);
R
<
String
>
pushFriend
(
List
<
String
>
dispatchIdList
,
List
<
String
>
pushDispatchIdList
,
Integer
isAuto
,
String
userId
);
// 定时任务清理临时文件
void
doClearFriend
();
R
<
String
>
doExportRoster
(
String
socialId
,
String
type
,
String
unitCreditCode
,
List
<
SociaFriendYgsAddVo
>
listVo
);
R
<
String
>
doExportRoster
(
String
socialId
,
String
type
,
String
unitCreditCode
,
List
<
SociaFriendYgsAddVo
>
listVo
);
R
<
String
>
test
();
R
<
String
>
test
();
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
View file @
6fc6da3d
...
@@ -117,8 +117,6 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
...
@@ -117,8 +117,6 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
@Override
@Override
public
R
<
String
>
pushFriend
(
List
<
String
>
dispatchIdList
,
List
<
String
>
pushDispatchIdList
,
Integer
isAuto
,
String
userId
)
{
public
R
<
String
>
pushFriend
(
List
<
String
>
dispatchIdList
,
List
<
String
>
pushDispatchIdList
,
Integer
isAuto
,
String
userId
)
{
if
(
atomicPushFriend
.
incrementAndGet
()
<=
1
)
{
if
(
atomicPushFriend
.
incrementAndGet
()
<=
1
)
{
// 先清理上一次的文件
//cleanSpireTempFiles();
try
{
try
{
TSocialFreindSet
set
=
tSocialFreindSetService
.
getById
(
"1"
);
TSocialFreindSet
set
=
tSocialFreindSetService
.
getById
(
"1"
);
if
(
set
!=
null
&&
Common
.
isNotNull
(
set
.
getType
())
&&
1
==
set
.
getType
())
{
if
(
set
!=
null
&&
Common
.
isNotNull
(
set
.
getType
())
&&
1
==
set
.
getType
())
{
...
@@ -204,41 +202,23 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
...
@@ -204,41 +202,23 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 不可以并发,会使花名册转图片的字体不正确
// 不可以并发,会使花名册转图片的字体不正确
// 后续优化,考虑升级(spire.xls)的版本
// 后续优化,考虑升级(spire.xls)的版本
// 此方法是:删除临时文件
// 此方法是:删除临时文件
public
void
cleanSpireTempFiles
()
{
@Override
public
void
doClearFriend
()
{
try
{
try
{
// 暂停1分钟:不暂停,删10分钟前的数据
/*try {
Thread.sleep(60000);
} catch (InterruptedException e) {
}*/
String
tempDirPath
=
System
.
getProperty
(
"java.io.tmpdir"
);
String
tempDirPath
=
System
.
getProperty
(
"java.io.tmpdir"
);
File
tempDir
=
new
File
(
tempDirPath
);
File
tempDir
=
new
File
(
tempDirPath
);
if
(
tempDir
.
exists
()
&&
tempDir
.
isDirectory
())
{
if
(
tempDir
.
exists
()
&&
tempDir
.
isDirectory
())
{
File
[]
spireTempFiles
=
tempDir
.
listFiles
((
dir
,
name
)
->
File
[]
spireTempFiles
=
tempDir
.
listFiles
((
dir
,
name
)
->
name
.
startsWith
(
"+~JF"
)
&&
name
.
endsWith
(
".tmp"
)
name
.
startsWith
(
"+~JF"
)
&&
name
.
endsWith
(
".tmp"
)
);
);
if
(
spireTempFiles
!=
null
&&
spireTempFiles
.
length
>
0
)
{
if
(
spireTempFiles
!=
null
&&
spireTempFiles
.
length
>
0
)
{
int
count
=
0
;
long
totalSize
=
0
;
// 删30分钟前的数据
// 删30分钟前的数据
long
oneMinuteAgo
=
System
.
currentTimeMillis
()
-
30L
*
60
*
1000
;
long
thirtyMinutesAgo
=
System
.
currentTimeMillis
()
-
30L
*
60
*
1000
;
long
fileSize
;
for
(
File
file
:
spireTempFiles
)
{
for
(
File
file
:
spireTempFiles
)
{
if
(
file
.
isFile
()
&&
file
.
canWrite
())
{
if
(
file
.
isFile
()
&&
file
.
canWrite
()
&&
file
.
lastModified
()
<
thirtyMinutesAgo
)
{
if
(
file
.
isFile
()
&&
file
.
canWrite
()
&&
file
.
lastModified
()
<
oneMinuteAgo
)
{
file
.
delete
();
fileSize
=
file
.
length
();
if
(
file
.
delete
())
{
count
++;
totalSize
+=
fileSize
;
}
}
}
}
}
}
log
.
info
(
"清理 Spire.XLS 临时文件完成:删除 {} 个文件,释放 {} MB 空间"
,
count
,
totalSize
/
1024
/
1024
);
}
}
}
}
}
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 @
6fc6da3d
...
@@ -90,12 +90,7 @@ public class ExcelToImage {
...
@@ -90,12 +90,7 @@ public class ExcelToImage {
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
+
toImagConvertError
+
e
.
getMessage
());
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
+
toImagConvertError
+
e
.
getMessage
());
}
finally
{
}
finally
{
if
(
wb
!=
null
)
{
if
(
wb
!=
null
)
{
try
{
wb
.
dispose
();
// 重要:释放资源并删除临时文件
wb
.
dispose
();
Thread
.
sleep
(
100
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
if
(
tempFile
!=
null
&&
tempFile
.
exists
()){
if
(
tempFile
!=
null
&&
tempFile
.
exists
()){
tempFile
.
delete
();
tempFile
.
delete
();
...
...
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