From 4395297f4021cf2eb7530e8404b2f7299380c253 Mon Sep 17 00:00:00 2001 From: CD <1103614279@qq.com> Date: Fri, 28 Oct 2022 16:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E6=B6=88=E6=81=AF=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 497 +++++++++++------- 1 file changed, 301 insertions(+), 196 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 bf57d39ec..09d075aff 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,9 @@ 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"); @@ -1484,21 +1494,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 @@ -1507,20 +1521,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(); @@ -1621,24 +1654,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 @@ -1689,21 +1746,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("飞书消息推送失败"); + } } } @@ -1714,7 +1796,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 { @@ -2334,7 +2416,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 = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规 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(); } 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(); } 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(); } 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(); } 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())){ 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())){ 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( @@ -2477,15 +2568,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 + + "\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 + + "\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()) // ); @@ -2533,18 +2638,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId()) // ); @@ -2552,18 +2657,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) // ); @@ -2571,15 +2676,15 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " 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); } }