Commit a77104c7 authored by hongguangwu's avatar hongguangwu

1.7.21-优化临时文件

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