From 426ab49fc173cbf0fbd1a9bfabd14fa7b700849d Mon Sep 17 00:00:00 2001 From: wangzhijiang Date: Fri, 31 Mar 2023 17:26:40 +0800 Subject: [PATCH] =?UTF-8?q?67412=20=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95-?= =?UTF-8?q?=E5=82=AC=E5=8A=9E=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 157 ++++++++++++------ 1 file changed, 104 insertions(+), 53 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index e3a7242c3..590d1ea76 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -9649,62 +9649,61 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl projectLawsInventoryEOList = this.baseMapper.selectList(lawsInventoryEOQueryWrapper); - // 只有studio催办的时候,才会给法规工程师发消息 - if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_STUDIO_EXPEDITING.getValue())){ - // 如果设计符合性或验证符合性流程状态其中一个为 清单待校核,催办时就需要给这一条数据的法规工程师发消息 - List toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { - boolean flag =false; - if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - || StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ - flag = true; - } - return flag; - }).collect(Collectors.toList()); - - if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){ - Map> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); - for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { - String regulationOwnerId = regulationOwnerMap.getKey(); - List lawsInventoryEOList = regulationOwnerMap.getValue(); - if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ - continue; - } - - this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList); - Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate(); - String endTime = ""; - if(inventoryAffirmDueDate != null){ - endTime = DateUtils.formatDate(inventoryAffirmDueDate); - } - String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); - - List userIdList = Arrays.asList(regulationOwnerId.split(",")); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!"); - params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!"); - params.put("projectLibraryId",projectLibraryId); - params.put("endTime",endTime); - params.put("userIdList",userIdList); - params.put("serialNumbers",serialNumbers); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取法规清单 - 飞书跳转链接 - Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); - params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); - params.put("Initiator",projectLibraryBase.getStudioEngineerName()); - - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params); - } - } - } - // 催办类型 可以只催设计符合性 也可以只催验证符合性 String expeditingType = json.getString("expeditingType"); if(StringUtils.contains(expeditingType,OperatorTypeEnum.LAWS_INVENTORY_DESIGN_EXPEDITING.getValue())){ + // 只有studio催办的时候,才会给法规工程师发消息 + if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_STUDIO_EXPEDITING.getValue())){ + // 如果设计符合性流程状态为 清单待校核,催办时就需要给这一条数据的法规工程师发消息 + List toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){ + Map> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); + for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { + String regulationOwnerId = regulationOwnerMap.getKey(); + List lawsInventoryEOList = regulationOwnerMap.getValue(); + if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList); + Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate(); + String endTime = ""; + if(inventoryAffirmDueDate != null){ + endTime = DateUtils.formatDate(inventoryAffirmDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(regulationOwnerId.split(",")); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!"); + params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!"); + params.put("projectLibraryId",projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取法规清单 - 飞书跳转链接 + Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("Initiator",projectLibraryBase.getStudioEngineerName()); + + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params); + } + } + } + // 催办设计符合性流程状态为 清单待确认的 责任人 List toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { boolean flag =false; @@ -9809,6 +9808,58 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { + boolean flag =false; + if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){ + Map> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId)); + for (Map.Entry> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) { + String regulationOwnerId = regulationOwnerMap.getKey(); + List lawsInventoryEOList = regulationOwnerMap.getValue(); + if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){ + continue; + } + + this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList); + Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate(); + String endTime = ""; + if(inventoryAffirmDueDate != null){ + endTime = DateUtils.formatDate(inventoryAffirmDueDate); + } + String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + + List userIdList = Arrays.asList(regulationOwnerId.split(",")); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!"); + params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!"); + params.put("projectLibraryId",projectLibraryId); + params.put("endTime",endTime); + params.put("userIdList",userIdList); + params.put("serialNumbers",serialNumbers); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId); + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取法规清单 - 飞书跳转链接 + Map hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN); + params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("Initiator",projectLibraryBase.getStudioEngineerName()); + + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params); + } + } + } + // 催办验证符合性流程状态为 清单待确认的 责任人 List toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> { boolean flag =false;