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
bf1bf5bc
Commit
bf1bf5bc
authored
Mar 26, 2026
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7.21-税友花名册,去除多余tmp
parent
5b151414
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
TSocialFriendPushServiceImpl.java
...ifu/social/service/impl/TSocialFriendPushServiceImpl.java
+36
-0
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
View file @
bf1bf5bc
...
...
@@ -190,6 +190,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
}
}
finally
{
atomicPushFriend
.
decrementAndGet
();
cleanSpireTempFiles
();
}
return
R
.
ok
();
}
else
{
...
...
@@ -198,6 +199,41 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
}
}
// 2026-03-26 hgw
// 不可以并发,会使花名册转图片的字体不正确
// 后续优化,考虑升级(spire.xls)的版本
// 此方法是:删除临时文件
public
void
cleanSpireTempFiles
()
{
try
{
String
tempDirPath
=
System
.
getProperty
(
"java.io.tmpdir"
);
File
tempDir
=
new
File
(
tempDirPath
);
if
(
tempDir
.
exists
()
&&
tempDir
.
isDirectory
())
{
File
[]
spireTempFiles
=
tempDir
.
listFiles
((
dir
,
name
)
->
name
.
startsWith
(
"+~JF"
)
&&
name
.
endsWith
(
".tmp"
)
);
if
(
spireTempFiles
!=
null
&&
spireTempFiles
.
length
>
0
)
{
int
count
=
0
;
long
totalSize
=
0
;
for
(
File
file
:
spireTempFiles
)
{
if
(
file
.
isFile
()
&&
file
.
canWrite
())
{
long
fileSize
=
file
.
length
();
if
(
file
.
delete
())
{
count
++;
totalSize
+=
fileSize
;
}
}
}
log
.
info
(
"清理 Spire.XLS 临时文件完成:删除 {} 个文件,释放 {} MB 空间"
,
count
,
totalSize
/
1024
/
1024
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"清理 Spire.XLS 临时文件失败"
,
e
);
}
}
// 获取特殊的户名称,当前给 徽州区 使用,徽州区需要走不同的分支
private
Map
<
String
,
Integer
>
getSpecialHuNameMap
()
{
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
...
...
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