From 5f1032a92bb0fdf8ded4633e43e2526869fdc135 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 20 Nov 2023 10:32:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BA=A7=E5=93=81=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=87=8D=E5=A4=8D=E6=96=87=E4=BB=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarBussStandFileController.java | 7 +++ .../service/ISarBussStandFileService.java | 1 + .../impl/SarBussStandFileServiceImpl.java | 60 +++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java index d9e266bf..b956fd27 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java @@ -91,4 +91,11 @@ public class SarBussStandFileController extends BaseController String result = sarBussStandFileEOService.batchUpdateSarBussFileRepeat(); return Result.success(result); } + + @ApiOperation(value = "企标发布稿重复问题,去重处理,产品标准下划线和斜杠问题") + @GetMapping("/batchUpdateSarBussFileRepeat2") + public ResponseMessage batchUpdateSarBussFileRepeat2() throws Exception { + String result = sarBussStandFileEOService.batchUpdateSarBussFileRepeat2(); + return Result.success(result); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java index 9225ee69..aaa764a4 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java @@ -23,4 +23,5 @@ public interface ISarBussStandFileService extends IService { ResponseMessage> batchUpdateSarBussFileMQ(); String batchUpdateSarBussFileRepeat(); + String batchUpdateSarBussFileRepeat2(); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java index bc40f93a..09aa109e 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java @@ -191,6 +191,66 @@ public class SarBussStandFileServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SarBussStandAttrInfo::getValidFlag,"0"); + wrapper.isNotNull(SarBussStandAttrInfo::getFbgbuss); + wrapper.ne(SarBussStandAttrInfo::getFbgbuss,""); + wrapper.select(SarBussStandAttrInfo::getStandId,SarBussStandAttrInfo::getFbgbuss); + List allStand = standAttrInfoService.list(wrapper); + + // 转换为Map + Map fbBussMap = new HashMap<>(); + allStand.forEach(each -> fbBussMap.put(each.getStandId(),each.getFbgbuss())); + // 循环每条数据 + for (Map.Entry entry : fbBussMap.entrySet()) { + // 把发布告文件做分割 + List attIdList = Arrays.asList(entry.getValue().split(",")); + // 根据发布稿文件查询发布告的具体信息,获取原文件名 + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(SarBussStandFile::getValidFlag,"0"); + wrapper1.in(SarBussStandFile::getAttId, attIdList); + List sarBussStandFileList = sarStandFileEODao.selectList(wrapper1); + sarBussStandFileList.forEach(each -> { + String fileName = each.getFileName().replace("/", "").replace("_", ""); + each.setFileName(fileName); + }); + // 使用 HashMap 记录已经出现过的 fileName + Map fileNameMap = new HashMap<>(); + // 最终的结果列表 + List deduplicatedList = new ArrayList<>(); + // 遍历原始列表 + for (SarBussStandFile file : sarBussStandFileList) { + String fileName = file.getFileName(); + + // 如果 fileName 已经在 map 中 + if (fileNameMap.containsKey(fileName)) { + // 比较 createTime,保留更新时间较新的对象 + SarBussStandFile existingFile = fileNameMap.get(fileName); + if (file.getCreationTime().after(existingFile.getCreationTime())) { + fileNameMap.put(fileName, file); + } + } else { + // 如果 fileName 不存在,将该 fileName 加入 map,并将当前对象加入结果列表 + fileNameMap.put(fileName, file); + deduplicatedList.add(file); + } + } + // 如果长度不相等,说明执行了去重,需要修改,重新放回企标详情表中 + String fbgbuss = deduplicatedList.stream().map(SarBussStandFile::getAttId).collect(Collectors.joining(",")); + if (fbgbuss.length() != entry.getValue().length()) { + LambdaUpdateWrapper wrapper2 = new LambdaUpdateWrapper<>(); + wrapper2.eq(SarBussStandAttrInfo::getStandId,entry.getKey()); + wrapper2.set(SarBussStandAttrInfo::getFbgbuss,fbgbuss); + standAttrInfoService.update(wrapper2); + logger.info("出现重复的企标:"+ entry.getKey() + ",去重后发布稿包含:" + fbgbuss + "---去重前发布稿包含:" + entry.getValue()); + } + } + return "去重成功"; + } public static Predicate distinctByKey(Function keyExtractor) { Set seen = ConcurrentHashMap.newKeySet(); return t -> seen.add(keyExtractor.apply(t)); From 518270aec2a956bf132a8c17787ccd0090284a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Mon, 20 Nov 2023 03:53:07 +0000 Subject: [PATCH 2/3] Revert "Merge branch 'fix_foton_20231031' into 'dev_20230829_change'" This reverts merge request !138 --- .../controller/WorkFlowController.java | 68 +++++-------------- .../adc/da/login/security/WebMvcConfig.java | 6 +- .../impl/SarBussionessStandServiceImpl.java | 4 -- .../impl/SarStandardsInfoServiceImpl.java | 14 ---- .../att/controller/AttFileEOController.java | 37 ---------- 5 files changed, 19 insertions(+), 110 deletions(-) diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java index 6b07ccdf..ac49000e 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java @@ -47,7 +47,6 @@ import com.adc.da.util.LoginUserUtil; import com.adc.da.workFlow.entity.*; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -1149,31 +1148,6 @@ public class WorkFlowController extends BaseController { return Result.success(); } - @ApiOperation(value = "根据在线文件Id查询所有onlyoffice历史文件") - @GetMapping("/getAllOnlyOfficeHisFileById") - public ResponseMessage>> getAllOnlyOfficeHisFileById(String fileId, String fileName) { - List> fileList = new ArrayList<>(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(OnlineFileLog::getHisId,fileId); - wrapper.eq(OnlineFileLog::getValidFlag, "0"); - wrapper.orderByDesc(OnlineFileLog::getCreateTime); - List onlineFileLogList = onlineFileLogDao.selectList(wrapper); - if (onlineFileLogList.size() > 0) { - for (OnlineFileLog onlineFileLog : onlineFileLogList) { - Map map = new HashMap<>(); - map.put("id", onlineFileLog.getId()); - map.put("fileName", fileName); - map.put("attFileId", onlineFileLog.getAttFileId()); - map.put("createTime", sdf.format(onlineFileLog.getCreateTime())); - map.put("fileKey", onlineFileLog.getFilekey()); - fileList.add(map); - } - return Result.success(fileList); - } - return Result.error("历史文件为空"); - } - @ApiOperation(value = "查询问题和回答") @GetMapping("/selectWenDan") public Map selectWenDan(@RequestParam("taskId") String taskId) { @@ -1484,8 +1458,7 @@ public class WorkFlowController extends BaseController { String s = ""; if (StringUtils.isBlank(prcName) || StringUtils.isBlank(json) || StringUtils.isBlank(sort)) { return Result.error("参数为空"); - } - else { + } else { prcName = sort + "-" + prcName + "-计划立项"; } JSONObject jsonObject = JSON.parseObject(json); @@ -1516,31 +1489,26 @@ public class WorkFlowController extends BaseController { } } }else { - if ("4".equals(jsonObject.getString("type")) || "3".equals(jsonObject.getString("type"))) { - s = workFlowFeignClient.endPrcName(prcName, esId); - if (StringUtils.isBlank(s)) { - return Result.error(); - } - String[] split = s.split("-"); - List asList = Arrays.asList(split); - if(split[0].equals("成功")){ - if(asList.size()>1){ - EndPrcName endPrcName = new EndPrcName(); - Map objectObjectMap = new HashMap<>(); - objectObjectMap.put("ids",split[1]); - objectObjectMap.put("prcCreateUser","xxx"); - String s1 = JSONObject.toJSONString(objectObjectMap); - endPrcName.setIds(s1); - endPrcName.setIsNot("1"); - return Result.success(endPrcName); - } + s = workFlowFeignClient.endPrcName(prcName, esId); + String[] split = s.split("-"); + List asList = Arrays.asList(split); + if(split[0].equals("成功")){ + if(asList.size()>1){ EndPrcName endPrcName = new EndPrcName(); - endPrcName.setIsNot("2"); - endPrcName.setIds("xxx"); + Map objectObjectMap = new HashMap<>(); + objectObjectMap.put("ids",split[1]); + objectObjectMap.put("prcCreateUser","xxx"); + String s1 = JSONObject.toJSONString(objectObjectMap); + endPrcName.setIds(s1); + endPrcName.setIsNot("1"); return Result.success(endPrcName); - }else { - return Result.error(); } + EndPrcName endPrcName = new EndPrcName(); + endPrcName.setIsNot("2"); + endPrcName.setIds("xxx"); + return Result.success(endPrcName); + }else { + return Result.error(); } } return Result.success(); diff --git a/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java b/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java index 95249a3c..a16dbe18 100644 --- a/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java +++ b/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java @@ -154,7 +154,6 @@ public class WebMvcConfig implements WebMvcConfigurer { addInterceptor.excludePathPatterns("/api/OtConvert/convertFileToFileId"); addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNew"); - addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNewOnlyOffice"); addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarWaterMarkNew"); addInterceptor.excludePathPatterns("/api/att/attFile/uploadNew"); addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/importSarBussionessStandFile"); @@ -200,9 +199,6 @@ public class WebMvcConfig implements WebMvcConfigurer { // 政策资料导出接口 addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportLawsInformationInfo"); - // 获取onlyOffice历史文件接口 - addInterceptor.excludePathPatterns("/api/lawss/activiti/getAllOnlyOfficeHisFileById"); - // 内外部会议模板下载 addInterceptor.excludePathPatterns("/api/lawss/insideOutsideMeeting/exportTemplateFile"); @@ -215,7 +211,7 @@ public class WebMvcConfig implements WebMvcConfigurer { // 标准体系列表导出 addInterceptor.excludePathPatterns("/api/lawss/sarMenuStandardLimit/standardSystemListExport"); - // 添加自定义拦截器,并拦截对应 url +// // 添加自定义拦截器,并拦截对应 url addInterceptor.addPathPatterns("/**"); } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java index 250c4a57..38650130 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java @@ -53,7 +53,6 @@ import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao; import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO; import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage; import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; -import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog; import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; import com.adc.da.slrs.sarUser.dao.TsUserDao; import com.adc.da.slrs.sarUser.service.ITsUserService; @@ -348,9 +347,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl bussMap = new HashMap<>(); - bussMap.put("ONLINEID",fileId); - String id = createOnlineAttIdFileMQUtil.CreateOnlineAttIdFileMQ(bussMap); - if(StringUtils.isNotBlank(id)) { - fileId = id; - } - } - } - - AttFileEO attFileEO = attFileEOService.getFileInfo(fileId); - InputStream is = null; - OutputStream os = null; - response.reset(); - try { - String fileOldName = fileNameEncoding(attFileEO.getOldFileName(),request); - response.setCharacterEncoding(StandardCharsets.UTF_8.name()); - response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\""); - response.setContentType("application/octet-stream"); - File file = new File(filePath+attFileEO.getFilePath()+attFileEO.getFileName()); - is = new FileInputStream(file); - os = response.getOutputStream(); - IOUtils.copy(is, os); - os.flush(); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } finally { - IOUtils.closeQuietly(is); - IOUtils.closeQuietly(os); - } - } - @ApiOperation(value = "|File|下载文件加水印") @GetMapping("/downloadFileForSarWaterMark") // @RequiresPermissions("sys:file:downloadFileForSar") From 8ed946635bc815e80e4b1c15c551f7be5aa8280c Mon Sep 17 00:00:00 2001 From: gaosong Date: Mon, 20 Nov 2023 11:58:39 +0800 Subject: [PATCH 3/3] Revert "Revert "Merge branch 'fix_foton_20231031' into 'dev_20230829_change'"" This reverts commit 518270aec2a956bf132a8c17787ccd0090284a89. --- .../controller/WorkFlowController.java | 68 ++++++++++++++----- .../adc/da/login/security/WebMvcConfig.java | 6 +- .../impl/SarBussionessStandServiceImpl.java | 4 ++ .../impl/SarStandardsInfoServiceImpl.java | 14 ++++ .../att/controller/AttFileEOController.java | 37 ++++++++++ 5 files changed, 110 insertions(+), 19 deletions(-) diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java index ac49000e..6b07ccdf 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java @@ -47,6 +47,7 @@ import com.adc.da.util.LoginUserUtil; import com.adc.da.workFlow.entity.*; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -1148,6 +1149,31 @@ public class WorkFlowController extends BaseController { return Result.success(); } + @ApiOperation(value = "根据在线文件Id查询所有onlyoffice历史文件") + @GetMapping("/getAllOnlyOfficeHisFileById") + public ResponseMessage>> getAllOnlyOfficeHisFileById(String fileId, String fileName) { + List> fileList = new ArrayList<>(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(OnlineFileLog::getHisId,fileId); + wrapper.eq(OnlineFileLog::getValidFlag, "0"); + wrapper.orderByDesc(OnlineFileLog::getCreateTime); + List onlineFileLogList = onlineFileLogDao.selectList(wrapper); + if (onlineFileLogList.size() > 0) { + for (OnlineFileLog onlineFileLog : onlineFileLogList) { + Map map = new HashMap<>(); + map.put("id", onlineFileLog.getId()); + map.put("fileName", fileName); + map.put("attFileId", onlineFileLog.getAttFileId()); + map.put("createTime", sdf.format(onlineFileLog.getCreateTime())); + map.put("fileKey", onlineFileLog.getFilekey()); + fileList.add(map); + } + return Result.success(fileList); + } + return Result.error("历史文件为空"); + } + @ApiOperation(value = "查询问题和回答") @GetMapping("/selectWenDan") public Map selectWenDan(@RequestParam("taskId") String taskId) { @@ -1458,7 +1484,8 @@ public class WorkFlowController extends BaseController { String s = ""; if (StringUtils.isBlank(prcName) || StringUtils.isBlank(json) || StringUtils.isBlank(sort)) { return Result.error("参数为空"); - } else { + } + else { prcName = sort + "-" + prcName + "-计划立项"; } JSONObject jsonObject = JSON.parseObject(json); @@ -1489,26 +1516,31 @@ public class WorkFlowController extends BaseController { } } }else { - s = workFlowFeignClient.endPrcName(prcName, esId); - String[] split = s.split("-"); - List asList = Arrays.asList(split); - if(split[0].equals("成功")){ - if(asList.size()>1){ + if ("4".equals(jsonObject.getString("type")) || "3".equals(jsonObject.getString("type"))) { + s = workFlowFeignClient.endPrcName(prcName, esId); + if (StringUtils.isBlank(s)) { + return Result.error(); + } + String[] split = s.split("-"); + List asList = Arrays.asList(split); + if(split[0].equals("成功")){ + if(asList.size()>1){ + EndPrcName endPrcName = new EndPrcName(); + Map objectObjectMap = new HashMap<>(); + objectObjectMap.put("ids",split[1]); + objectObjectMap.put("prcCreateUser","xxx"); + String s1 = JSONObject.toJSONString(objectObjectMap); + endPrcName.setIds(s1); + endPrcName.setIsNot("1"); + return Result.success(endPrcName); + } EndPrcName endPrcName = new EndPrcName(); - Map objectObjectMap = new HashMap<>(); - objectObjectMap.put("ids",split[1]); - objectObjectMap.put("prcCreateUser","xxx"); - String s1 = JSONObject.toJSONString(objectObjectMap); - endPrcName.setIds(s1); - endPrcName.setIsNot("1"); + endPrcName.setIsNot("2"); + endPrcName.setIds("xxx"); return Result.success(endPrcName); + }else { + return Result.error(); } - EndPrcName endPrcName = new EndPrcName(); - endPrcName.setIsNot("2"); - endPrcName.setIds("xxx"); - return Result.success(endPrcName); - }else { - return Result.error(); } } return Result.success(); diff --git a/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java b/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java index a16dbe18..95249a3c 100644 --- a/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java +++ b/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java @@ -154,6 +154,7 @@ public class WebMvcConfig implements WebMvcConfigurer { addInterceptor.excludePathPatterns("/api/OtConvert/convertFileToFileId"); addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNew"); + addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNewOnlyOffice"); addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarWaterMarkNew"); addInterceptor.excludePathPatterns("/api/att/attFile/uploadNew"); addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/importSarBussionessStandFile"); @@ -199,6 +200,9 @@ public class WebMvcConfig implements WebMvcConfigurer { // 政策资料导出接口 addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportLawsInformationInfo"); + // 获取onlyOffice历史文件接口 + addInterceptor.excludePathPatterns("/api/lawss/activiti/getAllOnlyOfficeHisFileById"); + // 内外部会议模板下载 addInterceptor.excludePathPatterns("/api/lawss/insideOutsideMeeting/exportTemplateFile"); @@ -211,7 +215,7 @@ public class WebMvcConfig implements WebMvcConfigurer { // 标准体系列表导出 addInterceptor.excludePathPatterns("/api/lawss/sarMenuStandardLimit/standardSystemListExport"); -// // 添加自定义拦截器,并拦截对应 url + // 添加自定义拦截器,并拦截对应 url addInterceptor.addPathPatterns("/**"); } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java index 38650130..250c4a57 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java @@ -53,6 +53,7 @@ import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao; import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO; import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage; import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; +import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog; import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; import com.adc.da.slrs.sarUser.dao.TsUserDao; import com.adc.da.slrs.sarUser.service.ITsUserService; @@ -347,6 +348,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl bussMap = new HashMap<>(); + bussMap.put("ONLINEID",fileId); + String id = createOnlineAttIdFileMQUtil.CreateOnlineAttIdFileMQ(bussMap); + if(StringUtils.isNotBlank(id)) { + fileId = id; + } + } + } + + AttFileEO attFileEO = attFileEOService.getFileInfo(fileId); + InputStream is = null; + OutputStream os = null; + response.reset(); + try { + String fileOldName = fileNameEncoding(attFileEO.getOldFileName(),request); + response.setCharacterEncoding(StandardCharsets.UTF_8.name()); + response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\""); + response.setContentType("application/octet-stream"); + File file = new File(filePath+attFileEO.getFilePath()+attFileEO.getFileName()); + is = new FileInputStream(file); + os = response.getOutputStream(); + IOUtils.copy(is, os); + os.flush(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } finally { + IOUtils.closeQuietly(is); + IOUtils.closeQuietly(os); + } + } + @ApiOperation(value = "|File|下载文件加水印") @GetMapping("/downloadFileForSarWaterMark") // @RequiresPermissions("sys:file:downloadFileForSar")