diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java index 44680a396..895537666 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java @@ -12,12 +12,13 @@ public enum JumpLinkEnum { * 103:跳转 项目库 - 任务清单 * 104:跳转 项目库 - 未符合项 * 105:跳转 项目库 - 认证参数收集 + * 106:跳转 项目库 - 认证清单 */ INVENTORY_AFFIRM_LINK("清单确认链接","1","/ProjectDetails?id=","&type=102"), PREHOMO_AFFIRM_LINK("prehomo确认链接","2","/ProjectDetails?id=","&type=103"), VERIFY_AFFIRM_LINK("验证符合性确认链接","3","/ProjectDetails?id=","&type=103"), DESIGN_AFFIRM_LINK("设计符合性确认链接","4","/ProjectDetails?id=","&type=103"), - CERTIFICATION_INVENTORY_LINK("认证清单链接","5","/ProjectDetails?id=","&type=104"), + CERTIFICATION_INVENTORY_LINK("认证清单链接","5","/ProjectDetails?id=","&type=106"), TASK_AFFIRM_LINK("任务确认链接","2","/ProcessCenter",""), FGPG_TODO_CENTER_LINK("法规评估任务待办中心链接","88","/regulatoryAssessmentTasks",""), XMCS_TODO_CENTER_LINK("项目参数任务待办中心链接","99","/projectParameterTasks",""), diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 6c67522b1..0804587db 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -1329,10 +1329,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); @@ -1344,11 +1346,18 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerIdList = Arrays.asList(certificationEngineerIds.split(",")); - List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); - String standName = ""; - String itemName = ""; + List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + StringBuilder standNameSb = new StringBuilder(); + StringBuilder itemNameSb = new StringBuilder(); - for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { - //TODO 处理数据,飞书卡片消息中展示的标准名称、条目名称 需求没有定如何展示,暂时无法处理。 - } + // 根据结束时间进行排序,获取最近的时间,发消息时使用。 + Collections.sort(certificationInventoryEOList, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + return p1.getEndTime().compareTo(p2.getEndTime()); + } + }); + Date endTime = certificationInventoryEOList.get(0).getEndTime(); - if(CollectionUtils.isNotEmpty(certificationEngineerList)){ - for (String certificationEngineerId : certificationEngineerIdList) { - String thirdId = certificationEngineerList.stream().filter(certificationEngineer -> { - boolean flag = false; - if(StringUtils.equals(certificationEngineerId,certificationEngineer.getId())){ - flag = true; + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { + if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getInspectionItem())){ + itemNameSb.append(projectCertificationInventoryEO.getInspectionItem()).append(","); + } + if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getSerialNumber())){ + standNameSb.append(projectCertificationInventoryEO.getSerialNumber()).append(","); + } + } + + String standName = ""; + if(StringUtils.isNotEmpty(standNameSb.toString())){ + standName = standNameSb.toString().substring(0,standNameSb.toString().length()-1); + } + String itemName = ""; + if(StringUtils.isNotEmpty(itemNameSb.toString())){ + itemName = itemNameSb.toString().substring(0,itemNameSb.toString().length()-1); + } + + if(CollectionUtils.isNotEmpty(certificationEngineerList)){ + for (String certificationEngineerId : certificationEngineerIdList) { + String thirdId = certificationEngineerList.stream().filter(certificationEngineer -> { + boolean flag = false; + if(StringUtils.equals(certificationEngineerId,certificationEngineer.getId())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()).get(0).getThirdId(); + + try { + JSONObject larkMesJson = new JSONObject(); + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue()); + larkMesJson.put("userIds",thirdId); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn",PRN_EN); + templateVariableMap.put("projectNameEn",PRN_EN); + templateVariableMap.put("standName",standName); + templateVariableMap.put("itemName",itemName); + templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } catch (Exception e) { + log.error("飞书消息推送失败"); } - return flag; - }).collect(Collectors.toList()).get(0).getThirdId(); - - try { - JSONObject larkMesJson = new JSONObject(); - larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue()); - larkMesJson.put("userIds",thirdId); - - Map templateVariableMap = new HashMap<>(); - templateVariableMap.put("projectName",PRN); - templateVariableMap.put("standName",standName); - templateVariableMap.put("itemName",itemName); - templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); - templateVariableMap.put("endTime",""); - templateVariableMap.put("back_url",hrefFeishu); - - larkMesJson.put("templateVariableMap",templateVariableMap); - this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); - } catch (Exception e) { - log.error("飞书消息推送失败"); } } } @@ -1439,10 +1475,24 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl templateVariableMap = new HashMap<>(); - templateVariableMap.put("projectName",PRN); + templateVariableMap.put("projectNameCn",PRN_EN); + templateVariableMap.put("projectNameEn",PRN_EN); templateVariableMap.put("standName",standName); - templateVariableMap.put("itemName",standName); + templateVariableMap.put("itemName",itemName); templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); templateVariableMap.put("endTime",DateUtils.formatDate(endTime)); - templateVariableMap.put("back_url",hrefFeishu); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); larkMesJson.put("templateVariableMap",templateVariableMap); this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);