Commit a77104c7 authored by hongguangwu's avatar hongguangwu

1.7.21-优化临时文件

parent 9a0b6ff7
......@@ -331,14 +331,14 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
rosterAutoFlagYgs = Common.isEmpty(vo.getRosterAutoFlagYgs()) || CommonConstants.ONE_STRING.equals(vo.getRosterAutoFlagYgs());
if (rosterAutoFlagYgs && !huaListVo.isEmpty()) {
//urlR = doExportRosterNew(vo, type, huaListVo, zhangMap, templateSrcMap);
// 新增:强制垃圾回收以清理 Spire.XLS 的临时字体文件
urlR = doExportRosterNew(vo, type, huaListVo, zhangMap, templateSrcMap);
// 新增:强制垃圾回收以清理 Spire.XLS 的临时字体文件
//System.gc();
// 房工接口,获取 企业职工基本医疗保险参保登记表 url
//urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo)
/*if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgshbxzyhmc(urlR.getData());
}*/
}
}
if (isSingle && Common.isNotNull(vo.getDispatchId())) {
......@@ -651,13 +651,13 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
rosterAutoFlagYsd = Common.isEmpty(vo.getRosterAutoFlagYsd()) || CommonConstants.ONE_STRING.equals(vo.getRosterAutoFlagYsd());
if (rosterAutoFlagYsd && !huaListVo.isEmpty()) {
//urlR = doExportRosterNew(vo, type, huaListVo, zhangMap, templateSrcMap);
urlR = doExportRosterNew(vo, type, huaListVo, zhangMap, templateSrcMap);
// 房工接口,获取 企业职工基本医疗保险参保登记表 url
//urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo)
//if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
//vo.setQyzgjbylbxcbdjb(urlR.getData());
//}
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgjbylbxcbdjb(urlR.getData());
}
}
// 派减且是要自动生成离职证明:
if (isAutoLeaveDoc) {
......@@ -1347,13 +1347,12 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
throw new RuntimeException("填充Excel模板失败", e);
}
File inputFile = null;
FileInputStream inputStream = null;
InputStream inStream = null;
try {
//读取文件 生成电子章
inputFile = new File(filePath);
inputStream = new FileInputStream(inputFile);
createFile = new File(filePath);
inputStream = new FileInputStream(createFile);
if (Common.isEmpty(url)) {
return R.failed(CommonConstants.RESULT_DATA_FAIL + ":电子印章OSS获取URL异常");
......@@ -1377,7 +1376,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
return R.failed("税友附件生成异常:" + e.getMessage());
} finally {
// 清理文件
finallyClose(inputFile, null, null, inputStream, null, inStream, null);
finallyClose(null, null, null, inputStream, null, inStream, null);
}
} catch (Exception e) {
if (excelWriter != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment