diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index beb27e2b6..9e16cc183 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -1169,10 +1169,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl newConfigDataEOList = new ArrayList<>(); List updateCollectManifestEOList = new ArrayList<>(); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List paramsCollectManifestLogEOList = new ArrayList<>(); // 处理数据 for (Map map : configDataList) { String paramsCollectManifestId = (String) map.get("id"); + ParamsCollectManifestEO paramsCollectManifestEO = this.paramsCollectManifestEOMapper.selectById(paramsCollectManifestId); // 修改参数项状态 ParamsCollectManifestEO updateCollectManifestEO = new ParamsCollectManifestEO(); @@ -1180,6 +1183,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl entry : map.entrySet()) { ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO(); @@ -1201,17 +1209,39 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigDataVO : paramsConfigDataVOList) { + String dataValue = (String) paramsConfigDataVO.get("dataValue"); + // 只要其中有一个值就可以进行拼接 + if(StringUtils.isNotEmpty(dataValue)){ + appendFlag = true; + break; + } + } + if(appendFlag){ + logCnContentSb.append(paramsConfigEO.getConfigName()).append("为"); + logEnContentSb.append(" configuration ").append(paramsConfigEO.getConfigName()).append(" as "); + } for (Map paramsConfigDataVO : paramsConfigDataVOList) { String type = (String) paramsConfigDataVO.get("type"); String dataValue = (String) paramsConfigDataVO.get("dataValue"); if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { paramsConfigDataEO.setTextData(dataValue); + if (StringUtils.isNotEmpty(dataValue)) { + logCnContentSb.append("\"").append(dataValue).append("\""); + logEnContentSb.append("\"").append(dataValue).append("\""); + } } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { paramsConfigDataEO.setPullData(dataValue); + if (StringUtils.isNotEmpty(dataValue)) { + logCnContentSb.append("\"").append(dataValue).append("\""); + logEnContentSb.append("\"").append(dataValue).append("\""); + } } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件 @@ -1245,15 +1275,37 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl fileInfos = ossFileService.getFileInfos(dataValue); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"").append(fileNames).append("\""); + logEnContentSb.append("\"").append(fileNames).append("\""); + } } } + + if(appendFlag){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } } newConfigDataEOList.add(paramsConfigDataEO); } + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContentSb.toString().substring(0,logCnContentSb.toString().length()-1)); + paramsCollectManifestLogEO.setLogEnContent(logEnContentSb.toString().substring(0,logEnContentSb.toString().length()-5)); + paramsCollectManifestLogEO.setParamsManifestId(paramsCollectManifestEO.getParamsManifestId()); + paramsCollectManifestLogEO.setParamsCollectManifestId(paramsCollectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); } // 批量更新 paramsConfigDataEOService.saveOrUpdateBatch(newConfigDataEOList); + + if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){ + this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList); + } return updateBatchById(updateCollectManifestEOList); } @@ -1640,10 +1692,16 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigEOList = this.paramsConfigEOService.queryList(paramsManifestId); + List updateEOList = new ArrayList<>(); + List paramsCollectManifestLogEOList = new ArrayList<>(); for (int i=0; i fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"" +fileNames+ "\""); + logEnContentSb.append("\"" +fileNames+ "\""); + } + } + + logEnContentSb.append(" of configuration " +configEO.getConfigName()+ ""); + + // 如果配置有两条或两条以上,并且不是最后一次循环 + if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } + } + + paramsConfigLenth ++; + } + + if(StringUtils.equals(currentPersonRole,CollectManifestUserTypeEnum.HOMO.getValue())){ + logCnContentSb.append("退回给填写人").append("\"").append(paramsCollectManifestEO.getDre()).append("\""); + logEnContentSb.append(" to the person ").append("\"").append(paramsCollectManifestEO.getDre()).append("\"."); + }else if(StringUtils.equals(currentPersonRole,CollectManifestUserTypeEnum.SDT.getValue())){ + logCnContentSb.append("退回给认证工程师"); + logEnContentSb.append(" to the Homo Engineer."); + } + } else if(StringUtils.equals(currentPersonRole,CollectManifestUserTypeEnum.DRE.getValue())){ + logCnContentSb.append("填写人").append("\"").append(currentUser.getUsername()).append("\"").append("退回给工程接口人").append("\"").append(paramsCollectManifestEO.getSdt()).append("\""); + logEnContentSb.append("DRE ").append("\"").append(currentUser.getUsername()).append("\"").append(" return to project Eng. Interface ").append("\"").append(paramsCollectManifestEO.getSdt()).append("\""); + } + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContentSb.toString()); + paramsCollectManifestLogEO.setLogEnContent(logEnContentSb.toString()); + paramsCollectManifestLogEO.setParamsManifestId(paramsManifestId); + paramsCollectManifestLogEO.setParamsCollectManifestId(paramsCollectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); } boolean update = updateBatchById(updateEOList); + if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){ + this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList); + } if (update) { - LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人 //飞书 for (ParamsCollectManifestEO paramsCollectManifestEO : updateEOList) { paramsCollectManifestEO = getById(paramsCollectManifestEO.getId()); @@ -1767,6 +1897,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsCollectManifestLogEOList = new ArrayList<>(); List updateEOList = new ArrayList<>(); for (int i=0; i paramsCollectManifestEOList = list(queryWrapper); Date deadline = paramsCollectManifestEOList.get(0).getDeadline(); int i = 0; + + List paramsCollectManifestLogEOList = new ArrayList<>(); for (ParamsCollectManifestEO paramsCollectManifestEO : paramsCollectManifestEOList) { if (i < 3) { connectBuilder.append(paramsCollectManifestEO.getNioNumber()).append("-").append(paramsCollectManifestEO.getParamsName()).append(","); } i++; + String logCnContent = "工程接口人\"" +currentUser.getUsername()+ "\"将参数填写人由\"空\"修改为\"" + dre + "\""; + String logEnContent = "Eng. Interface \"" +currentUser.getUsername()+ "\" Change the parameter person from \"null\" to \"" +dre+ "\"."; + if (StringUtils.isNotEmpty(paramsCollectManifestEO.getDre())) { + logCnContent = "工程接口人\"" +currentUser.getUsername()+ "\"将参数填写人由\""+ paramsCollectManifestEO.getDre() +"\"修改为\"" + dre + "\""; + logEnContent = "Eng. Interface \"" +currentUser.getUsername()+ "\" Change the parameter person from \""+ paramsCollectManifestEO.getDre() +"\" to \"" + dre + "\"."; + } + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContent); + paramsCollectManifestLogEO.setLogEnContent(logEnContent); + paramsCollectManifestLogEO.setParamsManifestId(paramsManifestId); + paramsCollectManifestLogEO.setParamsCollectManifestId(paramsCollectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); + ParamsCollectManifestEO updateEO = new ParamsCollectManifestEO(); updateEO.setId(paramsCollectManifestEO.getId()); updateEO.setDre(dre); // 设置填写人 @@ -1904,6 +2062,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsCollectManifestEOList = paramsCollectManifestEOMapper.selectBatchIds(paramsCollectManifestIdList); List addReportDetailEOList = new ArrayList<>(); List addReportConfigDataEOList = new ArrayList<>(); // 需要添加的配置数据 + List paramsCollectManifestLogEOList = new ArrayList<>(); Date syncTime = new Date(); for (ParamsCollectManifestEO collectManifestEO : paramsCollectManifestEOList) { ParamsReportDetailEO addReportDetailEO = new ParamsReportDetailEO(); @@ -2532,7 +2696,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"" +fileNames+ "\""); + logEnContentSb.append("\"" +fileNames+ "\""); + } + } + + logEnContentSb.append("of configuration " +configEO.getConfigName()+ ""); + + // 如果配置有两条或两条以上,并且不是最后一次循环 + if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } + } + + paramsConfigLenth ++; } + + logCnContentSb.append(" 同步至上报库"); + logEnContentSb.append(" to the report database"); + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContentSb.toString()); + paramsCollectManifestLogEO.setLogEnContent(logEnContentSb.toString()); + paramsCollectManifestLogEO.setParamsManifestId(paramsManifestId); + paramsCollectManifestLogEO.setParamsCollectManifestId(collectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); } List nioNumberList = paramsCollectManifestEOList.stream().map(ParamsCollectManifestEO::getNioNumber).collect(Collectors.toList()); @@ -2625,6 +2836,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl map = isCollectFinished(paramsManifestId); Boolean finish = (Boolean) map.get("finish"); @@ -2640,7 +2855,6 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl configDataQueryWrap = new QueryWrapper<>(); configDataQueryWrap.lambda().in(ParamsConfigDataEO::getParamsCollectManifestId,paramsCollectManifestIdArr); List paramsConfigDataList = this.paramsConfigDataEOService.list(configDataQueryWrap); + List paramsCollectManifestLogEOList = new ArrayList<>(); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); for (int i=0; i updateWrap = new LambdaUpdateWrapper<>(); updateWrap.set(ParamsCollectManifestEO::getSdt,null); updateWrap.set(ParamsCollectManifestEO::getDre,null); @@ -5304,6 +5527,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl