diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java index ba74f1908..f8064cc7e 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java @@ -4,7 +4,7 @@ public enum MsgColorEnum { GREEN("其他","green"), RED("任务被拒绝","red"), - YELLOW("任务预期","yellow"); + YELLOW("任务逾期","yellow"); String label; String value; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index d9b7e1175..42b30a509 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -5265,15 +5265,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl hrefListAdd = new ArrayList<>(); if(serialNumberAddList.size() != 0){ - List hrefList = new ArrayList<>(); + for (DummyInventoryInfoEO dummyInventoryInfoEO : collectAdd) { String href = "" + dummyInventoryInfoEO.getSerialNumber() + ""; - hrefList.add(href); + hrefListAdd.add(href); } - contentLog += count+". New regulations: " + StringUtils.join(hrefList,",") + "
"; + contentLog += count+". New regulations: " + StringUtils.join(hrefListAdd,",") + "
"; contentLogFeishu += count+". New regulations: " + StringUtils.join(serialNumberAddList,",") + " "; count++; } + List hrefListDelete = new ArrayList<>(); if(serialNumberDeleteList.size() != 0){ - List hrefList = new ArrayList<>(); for (DummyInventoryInfoEO dummyInventoryInfoEO : collectDelete) { String href = "" + dummyInventoryInfoEO.getSerialNumber() + ""; - hrefList.add(href); + hrefListDelete.add(href); } - contentLog += count + ". Remove regulations: " + StringUtils.join(hrefList,",") + "
"; + contentLog += count + ". Remove regulations: " + StringUtils.join(hrefListDelete,",") + "
"; contentLogFeishu += count + ". Remove regulations: " + StringUtils.join(serialNumberDeleteList,",") + " "; } if(serialNumberAddList.size() != 0 || serialNumberDeleteList.size() != 0){ + int countNo = 1; + StringBuilder sbContentNo = new StringBuilder(); + if(ObjectUtils.isNotEmpty(serialNumberAddList)){ + sbContentNo.append(countNo+". New regulations: "+StringUtils.join(serialNumberAddList,",")+", "); + countNo ++; + } + if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){ + sbContentNo.append(countNo+". Remove regulations: "+StringUtils.join(serialNumberDeleteList,",")); + } + + int countYes = 1; + StringBuilder sbContentYes = new StringBuilder(); + if(ObjectUtils.isNotEmpty(serialNumberAddList)){ + sbContentYes.append(countYes+". New regulations: "+StringUtils.join(hrefListAdd,",")+"
"); + countYes ++; + } + if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){ + sbContentYes.append(countYes+". Remove regulations: "+StringUtils.join(hrefListDelete,",")); + } + //消息英文--不带标签 + String contentNo = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + sbContentNo; + //消息英文--带标签 + String contentYes = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:"+ "
" + sbContentYes;; + + int countInfoNo = 1; + StringBuilder sbContentINfoNo = new StringBuilder(); + if(ObjectUtils.isNotEmpty(serialNumberAddList)){ + sbContentINfoNo.append(countInfoNo+". 新增文档: "+StringUtils.join(serialNumberAddList,",")+", "); + countInfoNo ++; + } + if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){ + sbContentINfoNo.append(countInfoNo+". 删除文档: "+StringUtils.join(serialNumberDeleteList,",")); + } + + int countInfoYes = 1; + StringBuilder sbContentInfoYes = new StringBuilder(); + if(ObjectUtils.isNotEmpty(serialNumberAddList)){ + sbContentInfoYes.append(countInfoYes+". 新增文档: "+StringUtils.join(hrefListAdd,",")+"
"); + countInfoYes ++; + } + if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){ + sbContentInfoYes.append(countInfoYes+". 删除文档: "+StringUtils.join(hrefListDelete,",")); + } + + //消息中文--不带标签 + String contentInfoNo = "您所订阅的"+baseEO.getName()+"虚拟清单已更新,更新内容如下:"+sbContentINfoNo; + //消息中文--带标签 + String contentInfoYes = "您所订阅的"+baseEO.getName()+"虚拟清单已更新,更新内容如下:"+"
"+sbContentInfoYes; + + + List userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId()); List thirdIdList = new ArrayList<>(); if(userNameList.size() != 0){ @@ -444,12 +497,12 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl" + " View details" + ""; String contentInfo = msgContentEN + " " + href; + + String ContentENNo = currentUser.getUsername()+" shared " + problemKnowledgeBaseTitle + " with you.Please be reminded to check it out."; + String ContentInfoENYes = currentUser.getUsername()+" shared " + problemKnowledgeBaseTitle + " with you.Please be reminded to check it out."+ " " + href; + + String contentCnNo = currentUser.getUsername()+"向您分享了"+problemKnowledgeBaseTitle+",请查看."; + String contentInfoCnYes = currentUser.getUsername()+"向您分享了"+problemKnowledgeBaseTitle+",请查看"+ " " + href; + + //封装消息的实体类 - SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, msgContentEN, contentInfo,MessageTypeEnum.PUSH.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, + msgTitle, + ContentENNo, + ContentInfoENYes, + MessageTypeEnum.PUSH.getValue(), + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), + contentCnNo, + contentInfoCnYes); + this.sysAnnouncementService.saveAnnouncement(sysAnnouncement); this.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo); //飞书 @@ -922,7 +938,9 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl queryWrapperInventory = new QueryWrapper<>(); queryWrapperInventory.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(queryWrapperInventory); @@ -96,125 +114,269 @@ public class InventoryAffirmJob implements Job { projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId()); ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper); - List threeDaysUserIdList = new ArrayList<>(); - List currentDaysUserIdList = new ArrayList<>(); + + Map> threeDaysMap = new HashMap<>(); + Map> currentDaysMap = new HashMap<>(); + Map> overdueMap = new HashMap<>(); for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOList) { if(StringUtils.equals(projectLibraryBase.getId(),projectLawsInventoryEO.getProjectLibraryId())){ if(projectLawsInventoryEO.getInventoryAffirmDueDate() != null){ //如果清单确认结束日期是当前日期 if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))){ + List currentDaysUserIdList = new ArrayList<>(); if(StringUtils.isEmpty(projectLawsInventoryEO.getSendMsgFlag())){ - if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){ - currentDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); - } - if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){ - currentDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); + //if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){ + // currentDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); + //} + //if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){ + // currentDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); + //} + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())||StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())) { + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + currentDaysUserIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson()); + } } projectLawsInventoryEO.setSendMsgFlag(SendMsgFlagEnum.FALSE.getValue()); projectLawsInventoryEOMapper.updateById(projectLawsInventoryEO); } + if (ObjectUtils.isNotEmpty(currentDaysUserIdList)) { + currentDaysMap.put(projectLawsInventoryEO.getId(), currentDaysUserIdList); + } } //如果清单确认结束时间是当前系统时间后三天 if(StringUtils.equals(threeDaysStr,sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))){ + List threeDaysUserIdList = new ArrayList<>(); if(StringUtils.isEmpty(projectLawsInventoryEO.getSendMsgCurrentFlag())){ - if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){ - threeDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); - } - if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){ - threeDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); + //if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){ + // threeDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); + //} + //if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){ + // threeDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); + //} + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())||StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())) { + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + threeDaysUserIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson()); + } } projectLawsInventoryEO.setSendMsgCurrentFlag(SendMsgFlagEnum.FALSE.getValue()); projectLawsInventoryEOMapper.updateById(projectLawsInventoryEO); } + if (ObjectUtils.isNotEmpty(threeDaysUserIdList)) { + threeDaysMap.put(projectLawsInventoryEO.getId(), threeDaysUserIdList); + } } + + //逾期3天、七天、14天 + Calendar day3Later=new GregorianCalendar(); + day3Later.setTime(projectLawsInventoryEO.getInventoryAffirmDueDate()); + day3Later.add(Calendar.DATE,3); + Date overdue3Days = day3Later.getTime(); + + Calendar day7Later=new GregorianCalendar(); + day7Later.setTime(projectLawsInventoryEO.getInventoryAffirmDueDate()); + day7Later.add(Calendar.DATE,7); + Date overdue7Days = day7Later.getTime(); + + Calendar day14Later=new GregorianCalendar(); + day14Later.setTime(projectLawsInventoryEO.getInventoryAffirmDueDate()); + day14Later.add(Calendar.DATE,14); + Date overdue14Days = day14Later.getTime(); + + if(StringUtils.equals(sdf.format(overdue3Days),sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate())) + ||StringUtils.equals(sdf.format(overdue7Days),sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate())) + ||StringUtils.equals(sdf.format(overdue14Days),sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))){ + List overdueUserIdList = new ArrayList<>(); + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())||StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())) { + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + overdueUserIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson()); + } + } + if (ObjectUtils.isNotEmpty(overdueUserIdList)) { + overdueMap.put(projectLawsInventoryEO.getId(), overdueUserIdList); + } + } + } } } - if(CollectionUtils.isNotEmpty(threeDaysUserIdList)){ - threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList()); + //飞书跳转链接 + String hrefFeishu = backUrl + + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + + projectLibraryBase.getId() + + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType() + + "&projectName=" + projectNameInfoEO.getProjectName() + "-" + + projectYearNameInfoEO.getYearName() + + "&targetMarket=" + projectLibraryBase.getTargetMarket(); - /*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务确认剩余处理时间还有3天,请及时查看处理";*/ + //项目名称 + String PRN = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectLibraryBase.getProjectVersion(); + if(!threeDaysMap.isEmpty()){ + for (String key : threeDaysMap.keySet()) { + List threeDaysUserIdList = threeDaysMap.get(key); + threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList()); + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(threeDaysUserIdList); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //法规中英文 + ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key); + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务将于3天后到期,请及时查看处理,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: 系统通知"); + feishuMsgVo.setEnContentUpper("Hello! This task will expire in 3 days. Please check and address it in a timely manner. Thank you!"); + feishuMsgVo.setEnContentLower("Project:" + PRN + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + + } + + + *//*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务确认剩余处理时间还有3天,请及时查看处理";*//* // XXX . - String msgContentEN = "The remaining processing time for the regulation task confirmation for " - + projectNameInfoEO.getProjectName() + "-" - + projectYearNameInfoEO.getYearName()+ " " - + projectLibraryBase.getTargetMarket() - + " are 3 days. Please check and address it in a timely manner."; - String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //String msgContentEN = "The remaining processing time for the regulation task confirmation for " + // + projectNameInfoEO.getProjectName() + "-" + // + projectYearNameInfoEO.getYearName()+ " " + // + projectLibraryBase.getTargetMarket() + // + " are 3 days. Please check and address it in a timely manner."; + //String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; + + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner."); + //feishuMsgVo.setTaskType("Regulation Task Confirmation"); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner."); - feishuMsgVo.setTaskType("Regulation Task Confirmation"); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - //飞书跳转链接 - String hrefFeishu = backUrl - + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() - + projectLibraryBase.getId() - + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType() - + "&projectName=" + projectNameInfoEO.getProjectName() + "-" - + projectYearNameInfoEO.getYearName() - + "&targetMarket=" + projectLibraryBase.getTargetMarket(); //系统内部跳转链接 - String href = "" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + // sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, threeDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + //projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, threeDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); } - if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){ - currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList()); + if(!currentDaysMap.isEmpty()){ + for (String key : currentDaysMap.keySet()) { + List currentDaysUserIdList = currentDaysMap.get(key); + currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList()); + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(currentDaysUserIdList); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //法规中英文 + ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key); + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务今天即将到期,请尽快查看处理,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " +projectLawsInventoryEO.getTitle() + + "\n发起人: 系统通知"); + feishuMsgVo.setEnContentUpper("Hello! This task will expire today. Please check and address the task ASAP. Thank you!"); + feishuMsgVo.setEnContentLower("Project:" + PRN + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + } - /*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*/ - String msgContentEN = "The regulation task confirmation for " - + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + " will expire today. Please check and address it in a timely manner."; - String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner."); - feishuMsgVo.setTaskType("Regulation Task Confirmation"); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + *//*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*//* + //String msgContentEN = "The regulation task confirmation for " + // + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + " will expire today. Please check and address it in a timely manner."; + //String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; + + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner."); + //feishuMsgVo.setTaskType("Regulation Task Confirmation"); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + - //飞书跳转链接 - String hrefFeishu = backUrl - + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() - + projectLibraryBase.getId() - + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType() - + "&projectName=" + projectNameInfoEO.getProjectName() + "-" - + projectYearNameInfoEO.getYearName() - + "&targetMarket=" + projectLibraryBase.getTargetMarket(); //系统内部跳转链接 - String href = "" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, currentDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + //projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, currentDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); } + + if(!overdueMap.isEmpty()){ + for (String key : overdueMap.keySet()) { + List overdueUserIdList = overdueMap.get(key); + overdueUserIdList = overdueUserIdList.stream().distinct().collect(Collectors.toList()); + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(overdueUserIdList); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //法规中英文 + ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key); + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + + String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务已逾期,请尽快处理,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: 系统通知" + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! This task is overdue. Please address it ASAP. Thank you!"); + feishuMsgVo.setEnContentLower("Project:" + PRN + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName() + + "\nDue Date: " + dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.YELLOW.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + } + } + } } - } + }*/ log.info("清单确认流程,定时任务结束 ====================================================="); } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/TaskAffirmJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/TaskAffirmJob.java new file mode 100644 index 000000000..bd19f9e9b --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/TaskAffirmJob.java @@ -0,0 +1,271 @@ +package com.jero.modules.project.job; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.jero.common.constant.enums.MessageType2Enum; +import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.constant.enums.MsgColorEnum; +import com.jero.modules.document.entity.BussDocumentLibraryEO; +import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsg2Vo; +import com.jero.modules.project.entity.ProjectLawsInventoryEO; +import com.jero.modules.project.entity.ProjectLibraryBase; +import com.jero.modules.project.entity.ProjectNameInfoEO; +import com.jero.modules.project.entity.ProjectYearNameInfoEO; +import com.jero.modules.project.enums.InventoryAffirmStatusEnum; +import com.jero.modules.project.enums.JumpLinkEnum; +import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper; +import com.jero.modules.project.mapper.ProjectLibraryBaseMapper; +import com.jero.modules.project.mapper.ProjectNameInfoEOMapper; +import com.jero.modules.project.mapper.ProjectYearNameInfoEOMapper; +import com.jero.modules.system.entity.SysUser; +import com.jero.modules.system.service.ISysUserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +public class TaskAffirmJob implements Job { + + @Autowired + private ProjectLawsInventoryEOMapper projectLawsInventoryEOMapper; + + @Autowired + private ProjectLibraryBaseMapper projectLibraryBaseMapper; + + @Autowired + private ProjectNameInfoEOMapper projectNameInfoEOMapper; + + @Autowired + private ProjectYearNameInfoEOMapper projectYearNameInfoEOMapper; + + @Autowired + private IFeishuService feishuService; + + @Value(value = "${jero.backUrl}") + private String backUrl; + + @Autowired + private ISysUserService sysUserService; + @Autowired + private IBussDocumentLibraryEOService bussDocumentLibraryEOService; + + + /** + * 任务确认流程定时 + * @param context + * @throws JobExecutionException + */ + @Override + public void execute(JobExecutionContext context) throws JobExecutionException { + log.info("任务确认流程,定时任务开启 ====================================================="); + + QueryWrapper queryWrapperInventory = new QueryWrapper<>(); + queryWrapperInventory.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(queryWrapperInventory); + if (ObjectUtils.isNotEmpty(projectLawsInventoryEOList)) { + List projectLibraryIdList = projectLawsInventoryEOList.stream().distinct() + .map(ProjectLawsInventoryEO::getProjectLibraryId).collect(Collectors.toList()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ProjectLibraryBase::getId,projectLibraryIdList); + List projectLibraryBaseList = projectLibraryBaseMapper.selectList(queryWrapper); + if (ObjectUtils.isNotEmpty(projectLibraryBaseList)) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + Date currentDate = new Date(); + + //获取后三天前的时间 + Calendar calendar=new GregorianCalendar(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE,3); + Date threeDays = calendar.getTime(); + + String threeDaysStr = sdf.format(threeDays); + String currentDateStr = sdf.format(currentDate); + + for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) { + + QueryWrapper projectNameInfoEOQueryWrapper = new QueryWrapper<>(); + projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId, projectLibraryBase.getProjectNameId()); + ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper); + + QueryWrapper projectYearInfoEOQueryWrapper = new QueryWrapper<>(); + projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId, projectLibraryBase.getYearNameId()); + ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper); + + + Map threeDaysMap = new HashMap<>(); + Map currentDaysMap = new HashMap<>(); + Map overdueMap = new HashMap<>(); + + for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOList) { + if (StringUtils.equals(projectLibraryBase.getId(), projectLawsInventoryEO.getProjectLibraryId())) { + if (projectLawsInventoryEO.getTaskAffirmDueDate() != null) { + //结束日期是当前日期 + if (StringUtils.equals(currentDateStr, sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()))) { + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + currentDaysMap.put(projectLawsInventoryEO.getId(), projectLawsInventoryEO.getEngineeringInterfacePerson()); + } + } + + //如果清单确认结束时间是当前系统时间后三天 + if (StringUtils.equals(threeDaysStr, sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()))) { + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + threeDaysMap.put(projectLawsInventoryEO.getId(), projectLawsInventoryEO.getEngineeringInterfacePerson()); + } + } + + //逾期3天、七天、14天 + Calendar day3Later = new GregorianCalendar(); + day3Later.setTime(projectLawsInventoryEO.getTaskAffirmDueDate()); + day3Later.add(Calendar.DATE, 3); + Date overdue3Days = day3Later.getTime(); + + Calendar day7Later = new GregorianCalendar(); + day7Later.setTime(projectLawsInventoryEO.getTaskAffirmDueDate()); + day7Later.add(Calendar.DATE, 7); + Date overdue7Days = day7Later.getTime(); + + Calendar day14Later = new GregorianCalendar(); + day14Later.setTime(projectLawsInventoryEO.getTaskAffirmDueDate()); + day14Later.add(Calendar.DATE, 14); + Date overdue14Days = day14Later.getTime(); + + if (StringUtils.equals(sdf.format(overdue3Days), sdf.format(currentDate)) + || StringUtils.equals(sdf.format(overdue7Days), sdf.format(currentDate)) + || StringUtils.equals(sdf.format(overdue14Days), sdf.format(currentDate))) { + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + overdueMap.put(projectLawsInventoryEO.getId(), projectLawsInventoryEO.getEngineeringInterfacePerson()); + } + } + + } + } + } + + //飞书跳转链接 + String hrefFeishu = backUrl + + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + + projectLibraryBase.getId() + + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType() + + "&projectName=" + projectNameInfoEO.getProjectName() + "-" + + projectYearNameInfoEO.getYearName() + + "&targetMarket=" + projectLibraryBase.getTargetMarket(); + + //项目名称 + String PRN = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectLibraryBase.getProjectVersion(); + if (!threeDaysMap.isEmpty()) { + for (String key : threeDaysMap.keySet()) { + String[] ids = threeDaysMap.get(key).split(","); + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(Arrays.asList(ids)); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //法规中英文 + ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key); + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务将于3天后到期,请及时查看处理,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: 系统通知"); + feishuMsgVo.setEnContentUpper("Hello! This task will expire in 3 days. Please check and address it in a timely manner. Thank you!"); + feishuMsgVo.setEnContentLower("Project:" + PRN + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + + } + } + + if (!currentDaysMap.isEmpty()) { + for (String key : currentDaysMap.keySet()) { + String[] ids = currentDaysMap.get(key).split(","); + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(Arrays.asList(ids)); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //法规中英文 + ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key); + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务今天即将到期,请尽快查看处理,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: 系统通知"); + feishuMsgVo.setEnContentUpper("Hello! This task will expire today. Please check and address the task ASAP. Thank you!"); + feishuMsgVo.setEnContentLower("Project:" + PRN + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + } + } + + if (!overdueMap.isEmpty()) { + for (String key : overdueMap.keySet()) { + String[] ids = overdueMap.get(key).split(","); + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(Arrays.asList(ids)); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //法规中英文 + ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key); + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + + String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务已逾期,请尽快处理,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: 系统通知" + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! This task is overdue. Please address it ASAP. Thank you!"); + feishuMsgVo.setEnContentLower("Project:" + PRN + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName() + + "\nDue Date: " + dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.YELLOW.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + } + } + } + } + } + + log.info("任务确认流程,定时任务结束 ====================================================="); + } +} 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 bbff2d4c0..60da241f7 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 @@ -19,7 +19,9 @@ import com.jero.common.api.vo.Result; import com.jero.common.constant.CommonConstant; import com.jero.common.constant.WebsocketConst; import com.jero.common.constant.enums.CutEnum; +import com.jero.common.constant.enums.MessageType2Enum; import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.constant.enums.MsgColorEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.vo.LoginUser; @@ -35,6 +37,7 @@ import com.jero.modules.dummy.service.impl.DummyInventoryBaseEOServiceImpl; import com.jero.modules.dummy.util.DeepCopyListUtil; import com.jero.modules.dummy.util.ListDiff; import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsg2Vo; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.message.websocket.WebSocket; import com.jero.modules.oss.entity.OSSFile; @@ -229,6 +232,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl projectYearInfoEOQueryWrapper = new QueryWrapper<>(); projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId()); ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper); + + //项目名称 + String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion(); + String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + "-" + projectVersion; //TODO 切换成枚举,不要在代码里出现魔数 if(StringUtils.equals(operatorType, OperatorTypeEnum.INVENTORY_AFFIRM.getValue())){ String ids = json.getString("ids"); @@ -1495,21 +1508,25 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } //消息内容 - String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for " - + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ". The due date is " + inventoryAffirmDueDate+ ". Please check and address it in a timely manner."; - String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation list confirmation task to complete"; + //String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for " + // + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ". The due date is " + inventoryAffirmDueDate+ ". Please check and address it in a timely manner."; + //String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation list confirmation task to complete"; // 飞书消息封装 - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); - feishuMsgVo.setTaskType("Regulation List Confirmation"); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - feishuMsgVo.setInitiator(studioUserInfo.getUsername()); - feishuMsgVo.setDueDate(inventoryAffirmDueDate); + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); + //feishuMsgVo.setTaskType("Regulation List Confirmation"); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setInitiator(studioUserInfo.getUsername()); + //feishuMsgVo.setDueDate(inventoryAffirmDueDate); //飞书跳转链接 String hrefFeishu = backUrl @@ -1518,20 +1535,39 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,currentUser.getUsername()); + //sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,currentUser.getUsername()); //往待办中心添加数据。 ProcessInfoEO processInfoEO = new ProcessInfoEO(); @@ -1632,24 +1668,24 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 List userIdList = new ArrayList<>(); userIdList.add(projectLibraryBase.getStudioEngineer()); - sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); - + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_LIST_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_LIST_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务被"+ currentUser.getUsername() +"拒绝,请及时查看处理"); + feishuMsgVo.setCnContentLower("项目: " + projectName + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! This task is rejected by "+ currentUser.getUsername() +". Please check and address it in a timely manner"); + feishuMsgVo.setEnContentLower("Project: " + projectName + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: "+ dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.RED.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } if(isProjectRole == Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue()) || isProjectRole == Integer.parseInt(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue())){ - msgContentEN = "The regulation list confirmation of "+projectLawsInventoryEO.getSerialNumber() + " for " - + projectNameInfoEO.getProjectName() +" is rejected by " + currentUser.getUsername() +". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + - ": You have a regulation list confirmation task to complete"; + //msgContentEN = "The regulation list confirmation of "+projectLawsInventoryEO.getSerialNumber() + " for " + // + projectNameInfoEO.getProjectName() +" is rejected by " + currentUser.getUsername() +". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + + // ": You have a regulation list confirmation task to complete"; // 飞书消息封装 - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - feishuMsgVo.setContent("Hello! This task is rejected by "+currentUser.getUsername()+". Please check and address it in a timely manner."); - feishuMsgVo.setTaskType("Regulation List Confirmation"); - feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber()); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - feishuMsgVo.setInitiator(studioUserInfo.getUsername()); - feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate())); + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //feishuMsgVo.setContent("Hello! This task is rejected by "+currentUser.getUsername()+". Please check and address it in a timely manner."); + //feishuMsgVo.setTaskType("Regulation List Confirmation"); + //feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber()); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setInitiator(studioUserInfo.getUsername()); + //feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate())); //飞书跳转链接 String hrefFeishu = backUrl @@ -1700,21 +1760,46 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 List userIdList = new ArrayList<>(); userIdList.add(projectLibraryBase.getStudioEngineer()); - sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_LIST_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_LIST_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务被"+ currentUser.getUsername() +"拒绝,请及时查看处理"); + feishuMsgVo.setCnContentLower("项目: " + projectName + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! This task is rejected by "+ currentUser.getUsername() +". Please check and address it in a timely manner"); + feishuMsgVo.setEnContentLower("Project: " + projectName + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: "+ dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.RED.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } } @@ -1725,7 +1810,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl userIdList = new ArrayList<>(); userIdList.add(projectLibraryBase.getStudioEngineer()); sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); - } + }*/ } } }else { @@ -2345,7 +2430,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, currentUserId)); - String msgContentEN = ""; + //String msgContentEN = ""; String msgTitle = ""; List userIdList = new ArrayList<>(); - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - MessageTypeEnum messageTypeEnum = null; - String taskType = ""; + //MessageTypeEnum messageTypeEnum = null; + //String taskType = ""; String initiator = ""; String initiatorLark = ""; + String cnContentUpper = "";//中文上部分 + String cnContentLower = "";//中文下部分 + String enContentUpper = "";//英文上部分 + String enContentLower = "";//英文下部分 + String color = "";//颜色 + + ProjectLibraryBase LibraryBase = projectLibraryBaseService.queryById(projectLibraryId, CutEnum.CN.getValue()).get(0); + String PRN = LibraryBase.getProjectName();//项目名称 + String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规 + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) { userIdList.add(engineeringInterfacePerson); - msgContentEN = sysUser.getUsername() + " initiated the regulation task confirmation of " + projectNameInfoEO.getProjectName() - + ". The due date is " + taskAffirmDueDate + ". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " initiated the regulation task confirmation of " + projectNameInfoEO.getProjectName() + // + ". The due date is " + taskAffirmDueDate + ". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); + //feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; initiator = studioUserInfo.getUsername(); initiatorLark = studioUserInfo.getUsername(); + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + initiatorLark + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + initiatorLark + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.GREEN.getValue(); + + } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue())) { String dreUserId = jsonObject.getString("dreUserId"); //dre用户id userIdList.add(dreUserId); - msgContentEN = sysUser.getUsername() + " has assigned the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName() - + " to you. The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has assigned the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName() + // + " to you. The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; initiator = studioUserInfo.getUsername(); initiatorLark = studioUserInfo.getUsername(); + + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ sysUser.getUsername() +"向您询问意见,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! "+ sysUser.getUsername() +" asked you for opinion. Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.GREEN.getValue(); + } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) { userIdList.add(engineeringInterfacePerson); - msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; initiator = studioUserInfo.getUsername(); initiatorLark = studioUserInfo.getUsername(); + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,该任务被"+ sysUser.getUsername() +"退回,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! This task is rejected by "+ sysUser.getUsername() +". Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.GREEN.getValue(); + } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) { userIdList.add(engineeringInterfacePerson); - msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has submitted the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has submitted the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; initiator = studioUserInfo.getUsername(); initiatorLark = studioUserInfo.getUsername(); + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ sysUser.getUsername() +"已向您提交回复,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! "+ sysUser.getUsername() +" has replied to you. Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.GREEN.getValue(); + + } else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_REJECTED_MSG.getValue())){ userIdList.add(projectLibraryBase.getStudioEngineer()); - msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; initiator = studioUserInfo.getUsername(); initiatorLark = studioUserInfo.getUsername(); - } else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ACCEPTED_MSG.getValue())){ + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,该任务被"+ sysUser.getUsername() +"拒绝,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! This task is rejected by "+ sysUser.getUsername() +". Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.RED.getValue(); + + + } /*else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ACCEPTED_MSG.getValue())){ userIdList.add(projectLibraryBase.getStudioEngineer()); - msgContentEN = sysUser.getUsername() + " has accepted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation notification to check"; + //msgContentEN = sysUser.getUsername() + " has accepted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation notification to check"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has accepted the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has accepted the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; initiator = studioUserInfo.getUsername(); initiatorLark = studioUserInfo.getUsername(); - } else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_START_MSG.getValue())){ + } */else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_START_MSG.getValue())){ String designDutyId = jsonObject.getString("designDutyId"); //设计符合性责任人id userIdList.add(designDutyId); - msgContentEN = "You recieved the design compliance task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " + sdf.format(projectLawsInventoryEO.getDesignDueDate()) + ". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a design compliance task to complete"; + //msgContentEN = "You recieved the design compliance task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " + sdf.format(projectLawsInventoryEO.getDesignDueDate()) + ". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a design compliance task to complete"; - feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); + //feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Design Compliance Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Design Compliance Confirmation"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( @@ -2488,15 +2659,15 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) ); initiatorLark = initiatorLarkInfo.getUsername(); + + msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + initiatorLark + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + initiatorLark + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.GREEN.getValue(); + } else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_CHARGE_PERSON_SUBMIT_MSG.getValue())){ String designInitiatorId = jsonObject.getString("designInitiatorId"); //设计符合性发起人id userIdList.add(designInitiatorId); - msgContentEN = sysUser.getUsername() + " has submitted the design compliance confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". Please check and review it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a design compliance task to complete"; + //msgContentEN = sysUser.getUsername() + " has submitted the design compliance confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". Please check and review it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a design compliance task to complete"; - feishuMsgVo.setContent("Hello! The compliance confirmation has been submitted. Please check and review it in a timely manner."); + //feishuMsgVo.setContent("Hello! The compliance confirmation has been submitted. Please check and review it in a timely manner."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Design Compliance Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Design Compliance Confirmation"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - feishuMsgVo.setAssignee(sysUser.getUsername()); + //feishuMsgVo.setAssignee(sysUser.getUsername()); // SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( // new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId()) // ); @@ -2544,18 +2729,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId()) // ); @@ -2563,18 +2748,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) // ); @@ -2582,15 +2767,15 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; + //href = "" + " View details" + ""; }else if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_START_MSG.getValue()) ||StringUtils.equals(msgType,MsgTypeEnum.PREHOMO_START_MSG.getValue()) ||StringUtils.equals(msgType,MsgTypeEnum.VERIFY_START_MSG.getValue()) @@ -2674,21 +2859,40 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; + //href = "" + " View details" + ""; } - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,initiator); + //sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,initiator); + + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(msgTitle); + feishuMsgVo.setCnContentUpper(cnContentUpper); + feishuMsgVo.setCnContentLower(cnContentLower); + feishuMsgVo.setEnContentUpper(enContentUpper); + feishuMsgVo.setEnContentLower(enContentLower); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(color); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java index 93e4cb4f6..527eb8527 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java @@ -373,7 +373,7 @@ public class LawsWarnService { thirdIdList.addAll(thirdId); } } - + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); //查询文档 List> mapList = bussDocumentLibraryEOMapper.selectMapsAll(documentIds); List serialNumberList = new ArrayList<>(); @@ -409,27 +409,52 @@ public class LawsWarnService { "&serial_number=" + map.get("serial_number") + "'" + " target='_blank'>" + map.get("serial_number") + ""; urlList.add(url); hrefList.add(href+timeContent); + + //推送多条时, 每条单独发消息 + //编号, 标题, 新车型实施日期, 在产车实施日期 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String serialNumber = StringUtils.valueOf(map.get("serial_number")); + String titleCn = StringUtils.valueOf(map.get("title")); + String titleEn = StringUtils.valueOf(map.get("title_en")); + String newType = ""; + if(ObjectUtils.isNotEmpty(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"))){ + newType = sdf.format(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1")); + } + String newVehicle = ""; + if(ObjectUtils.isNotEmpty(map.get("implement_time"))){ + newVehicle = sdf.format(map.get("implement_time")); + } + //消息-英文 + String contentNo = sysUser.getUsername() +" shared Regulation Early Warning infomation with you, " + +"Regulation No: "+serialNumber+",Title: "+titleEn+",New Type Execution Date: "+newType+",New Vehicle Execution Date: "+newVehicle; + String contentInfoYes = sysUser.getUsername() +" shared Regulation Early Warning infomation with you, "+"
" + +"Regulation No: "+href+"
" + +"Title: "+titleEn+"
" + +"New Type Execution Date: "+newType+"
" + +"New Vehicle Execution Date: "+newVehicle; + + + //消息中文 + String contentCnNo = sysUser.getUsername() +"向您分享了法规预警信息, "+"编号: "+serialNumber+",标题: "+titleCn+",新车型实施日期: "+newType+",在产车实施日期: "+newVehicle; + String contentInfoCnYes = sysUser.getUsername() +"向您分享了法规预警信息,"+"
" + +"编号: "+href+"
" + +"标题: "+titleCn+"
" + +"新车型实施日期: "+newType+"
" + +"在产车实施日期: "+newVehicle; + + //封装消息的实体类 + SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, + null, + contentNo, + contentInfoYes, + MessageTypeEnum.PUSH.getValue(), + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), + contentCnNo,contentInfoCnYes); + sysAnnouncementService.saveAnnouncement(sysAnnouncement); + bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfoCnYes); } - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - String content = StringUtils.join(serialNumberList, ",") + " has been shared with you, please check."; - //消息详情模板 - // XXX has pushed GB 7258 to you as the implementation date of vehicle production is XXXX-XX-XX, - // GB 7258 to you as the implementation date of vehicle production is XXXX-XX-XX, Please be reminded to check it out. - String contentInfo = sysUser.getUsername() + " has pushed " + StringUtils.join(hrefList, ",") + ", Please be reminded to check it out."; - String title = content; - - //封装消息的实体类 - SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, - title, - content, - contentInfo, - MessageTypeEnum.PUSH.getValue(), - MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), - null,null); - sysAnnouncementService.saveAnnouncement(sysAnnouncement); - bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo); //飞书 try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @@ -473,7 +498,7 @@ public class LawsWarnService { } catch (IOException e) { e.printStackTrace(); } - bussDocumentLibraryEOService.sendWebsocket(documentIds, contentInfo); + bussDocumentLibraryEOService.sendWebsocket(documentIds, documentIds); return "推送成功"; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java index f8cc2140e..397ac8803 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java @@ -124,27 +124,33 @@ public class TimedTaskWarn implements Job { //当前时间的前12个月 String beforeTimeSixTen = beforeTime(12,xin1Che1Xing2Shi2Shi1Ri4Qi1); - if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ - //发送站内消息和飞书消息 - String format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); - String content = "The implementation date of the " + category +" "+ serialNumber - + " new model you subscribed to is "+format+",please pay attention to check"; - String contentInfo = "The implementation date of the " + category +" "+ href - + " new model you subscribed to is "+format+",please pay attention to check"; - String msgTitle = content; - sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); - } +// if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ +// //发送站内消息和飞书消息 +// String format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); +// String content = "The implementation date of the " + category +" "+ serialNumber +// + " new model you subscribed to is "+format+",please pay attention to check"; +// String contentInfo = "The implementation date of the " + category +" "+ href +// + " new model you subscribed to is "+format+",please pay attention to check"; +// String msgTitle = content; +// sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); +// } if(currentTime.equals(beforeTimeSixTen)){ //发送飞书消息(提前一年) sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href); } if(currentTime.equals(beforeTimeSix)){ //发送飞书消息(提前6个月) sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href); } if(currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ //发送飞书消息(当天) sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href); } } @@ -165,19 +171,25 @@ public class TimedTaskWarn implements Job { String contentInfo = "The implementation date of the " + category +" "+ href + " production vehicle you subscribed to is "+format+",please pay attention to check"; String msgTitle = content; - sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); +// sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); } if(currentTime.equals(beforeTimeSixTen)){ //发送飞书消息(提前一年) sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href); } if(currentTime.equals(beforeTimeSix)){ //发送飞书消息(提前6个月) sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href); } if(currentTime.equals(implementTimeStr)){ //发送飞书消息(当天) sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href); } } } @@ -224,25 +236,98 @@ public class TimedTaskWarn implements Job { } } - private void sendMessage(String title, String content,String contentInfo,String contentFeiShu, String url, List userIdList, List thirdIdList) { - //站内消息 +// private void sendMessage(String title, String content,String contentInfo,String contentFeiShu, String url, List userIdList, List thirdIdList) { +// //站内消息 +// //封装消息的实体类 +// SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, +// title, +// content, +// contentInfo, +// MessageTypeEnum.WARN.getValue(), +// MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), +// null,null); +// sysAnnouncementService.saveAnnouncement(sysAnnouncement); +// bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), content); +// +//// //飞书消息 +//// try { +//// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentFeiShu, MessageTypeEnum.WARN.getName(), url); +//// } catch (IOException e) { +//// e.printStackTrace(); +//// } +// } + private void sendMessage(BussDocumentLibraryEO bussDocumentLibraryEO, + List userIdList, + String flag, + SimpleDateFormat sdf, + String href) { + String number = bussDocumentLibraryEO.getSerialNumber(); + String title = bussDocumentLibraryEO.getTitle(); + String titleEn = bussDocumentLibraryEO.getTitleEn(); + Date xin1Che1Xing2Shi2Shi1Ri4Qi1 = bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1(); + Date implementTime = bussDocumentLibraryEO.getImplementTime(); + String newType = ""; + String newVehicle = ""; + if(ObjectUtils.isNotEmpty(xin1Che1Xing2Shi2Shi1Ri4Qi1)){ + newType = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); + } + if(ObjectUtils.isNotEmpty(implementTime)){ + newVehicle = sdf.format(implementTime); + } + String contentCn = ""; + String contentInfoCn = ""; + String contentEn = ""; + String contentInfoEn = ""; + //"
" + + contentCn = ",编号: "+number + +",标题: "+title + +",新车型实施日期: "+newType + +",在产车实施日期: "+newVehicle; + contentInfoCn = "编号: "+href+"
" + +"标题: "+title+"
" + +"新车型实施日期: "+newType+"
" + +"在产车实施日期: "+newVehicle; + + contentEn = ",Regulation No: "+number + +",Title: "+titleEn + +",New Type Execution Date: "+newType + +",New Vehicle Execution Date: "+newVehicle; + + contentInfoEn = "Regulation No: "+href+"
" + +"Title: "+titleEn+"
" + +"New Type Execution Date: "+newType+"
" + +"New Vehicle Execution Date: "+newVehicle; + + if("1".equals(flag)){ + contentCn = "您所订阅的法规将于1年后实施"+contentCn; + contentInfoCn = "您所订阅的法规将于1年后实施"+"
"+contentInfoCn; + contentEn = "The regulation you subscribed to will be implemented in one year"+contentEn; + contentInfoEn = "The regulation you subscribed to will be implemented in one year"+"
"+contentInfoEn; + } + if("6".equals(flag)){ + contentCn = "您所订阅的法规将于6个月后实施"+contentCn; + contentInfoCn = "您所订阅的法规将于6个月后实施"+"
"+contentInfoCn; + contentEn = "The regulation you subscribed to will be implemented in six months"+contentEn; + contentInfoEn = "The regulation you subscribed to will be implemented in six months"+"
"+contentInfoEn; + } + if("0".equals(flag)){ + contentCn = "您所订阅的法规已实施"+contentCn; + contentInfoCn = "您所订阅的法规已实施"+"
"+contentInfoCn; + contentEn = "The regulation you subscribed to is implemented"+contentEn; + contentInfoEn = "The regulation you subscribed to is implemented"+"
"+contentInfoEn; + } + //封装消息的实体类 SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, - content, - contentInfo, + contentEn, + contentInfoEn, MessageTypeEnum.WARN.getValue(), MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), - null,null); + contentCn,contentInfoCn); sysAnnouncementService.saveAnnouncement(sysAnnouncement); - bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), content); - -// //飞书消息 -// try { -// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentFeiShu, MessageTypeEnum.WARN.getName(), url); -// } catch (IOException e) { -// e.printStackTrace(); -// } + bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), contentInfoEn); } private String beforeTime (int month,Date date){