diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 8e105fc78..3a03f22b5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -2939,9 +2939,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl userIdList = new ArrayList<>(); - String msgContentEN = ""; - String msgTitle = ""; + //String msgContentEN = ""; + //String msgTitle = ""; String initiator = ""; + String evaluationTitle= jsonObject.getString("title"); + String endTime = jsonObject.getString("endTime"); //截止日期 + String title = MessageType2Enum.REGULATION_TECHNICAL_ASSESSMENT.getCn() + "/" + MessageType2Enum.REGULATION_TECHNICAL_ASSESSMENT.getEn(); + String cnContentUpper = ""; + String cnContentLower = ""; + String enContentUpper = ""; + String enContentLower = ""; if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_START_MSG.getValue())){ userIdList.add(jsonObject.getString("evaluationId")); - String endTime = jsonObject.getString("endTime"); //截止日期 + //String endTime = jsonObject.getString("endTime"); //截止日期 //您收到GB 7258 的法规技术评估流程任务,请及时查看处理。 - msgContentEN = "You recieved the Regulatory and technical assessment of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = "You recieved the Regulatory and technical assessment of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id SysUser currentUser = sysUserService.getBaseMapper().selectOne(new QueryWrapper().lambda().eq(SysUser::getId, currentUserId)); initiator = currentUser.getUsername(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "编号:" + serialNumber + + "\n标题: " + evaluationTitle + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Regulation No :" + serialNumber + + "\nTitle: " + evaluationTitle + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; }else if(StringUtils.equals(msgType,MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_ENALUATOR_SUBMIT_MSG.getValue())){ String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id SysUser currentUser = this.sysUserService.getBaseMapper().selectOne(new QueryWrapper().lambda().eq(SysUser::getId, currentUserId)); userIdList.add(jsonObject.getString("initiatorUserId")); //XXX(人员账号)已提交GB 7258 的法规意见收集流程,请及时查看审核。 - msgContentEN = currentUser.getUsername() + " has submitted the collection process of Regulatory and technical assessment of "+serialNumber+", Please check and address it in time."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = currentUser.getUsername() + " has submitted the collection process of Regulatory and technical assessment of "+serialNumber+", Please check and address it in time."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + cnContentUpper = "您好,"+ currentUser.getUsername() +"已提交评估结果,请审核"; + cnContentLower = "编号:" + serialNumber + + "\n标题: " + evaluationTitle + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the assessment result. Please review it"; + enContentLower = "Regulation No :" + serialNumber + + "\nTitle: " + evaluationTitle + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; }else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_AUDIT_ACCEPTED_MSG.getValue())){ userIdList.add(jsonObject.getString("evaluationId")); //您提交的GB 7258 的法规技术评估流程已通过。 - msgContentEN = "The regulatory and technical assessment process for "+serialNumber+" you submitted has passed."; - msgTitle = "You have a Regulatory and technical assessment task completed"; + //msgContentEN = "The regulatory and technical assessment process for "+serialNumber+" you submitted has passed."; + //msgTitle = "You have a Regulatory and technical assessment task completed"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + cnContentUpper = "您好,您提交的评估结果已通过"; + cnContentLower = "编号:" + serialNumber + + "\n标题: " + evaluationTitle + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "Hello! The assessment result you submitted has passed"; + enContentLower = "Regulation No :" + serialNumber + + "\nTitle: " + evaluationTitle + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; }else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_AUDIT_REJECTED_MSG.getValue())){ userIdList.add(jsonObject.getString("evaluationId")); //您提交的GB 7258 的法规技术评估流程已被退回,请及时查看处理。 - msgContentEN = "The regulatory and technical assessment process of "+serialNumber+" you submitted has been returned, Please check and address it in time."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = "The regulatory and technical assessment process of "+serialNumber+" you submitted has been returned, Please check and address it in time."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - }else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_MSG.getValue())){ + cnContentUpper = "您好,您提交的评估结果被退回,请及时查看处理"; + cnContentLower = "编号:" + serialNumber + + "\n标题: " + evaluationTitle + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "\n" + + "Hello! The assessment result you submitted has been rejected. Please check and address it in a timely manner"; + enContentLower = "Regulation No :" + serialNumber + + "\nTitle: " + evaluationTitle + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; + }/*else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_MSG.getValue())){ userIdList = (List) jsonObject.get("userIdList"); //您GB 7258的法规技术评估流程将于明天结束,请及时查看处理 - msgContentEN = "The the Regulatory and technical assessment of "+serialNumber+" will expire tomorrow. Please check and address it in time."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = "The the Regulatory and technical assessment of "+serialNumber+" will expire tomorrow. Please check and address it in time."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - } + }*/ + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(userIdList); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } //飞书跳转链接 String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink(); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(title); + feishuMsgVo.setCnContentUpper(cnContentUpper); + feishuMsgVo.setCnContentLower(cnContentLower); + feishuMsgVo.setEnContentUpper(enContentUpper); + feishuMsgVo.setEnContentLower(enContentLower); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } //系统内部跳转链接 - String href = "" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); - SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsTechnologyEvaluationId,sendMessageMap,null, MessageTypeEnum.REGULATORY_AND_TECHNICAL_ASSESSMENT,initiator); + //SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsTechnologyEvaluationId,sendMessageMap,null, MessageTypeEnum.REGULATORY_AND_TECHNICAL_ASSESSMENT,initiator); } @Override