设计符合性确认、Pre-Homo确认、验证符合性确认都做完一半了

This commit is contained in:
CD
2022-11-01 16:41:03 +08:00
parent 13bf640867
commit d3e96de8b4
4 changed files with 554 additions and 198 deletions
@@ -2502,12 +2502,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
cnContentLower = "项目: " + PRN +
"\n法规: " + LAW_CN +
"\n发起人: " + initiatorLark +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
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());
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
color = MsgColorEnum.GREEN.getValue();
@@ -2533,12 +2533,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
cnContentLower = "项目: " + PRN +
"\n法规: " + LAW_CN +
"\n发起人: " + sysUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
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());
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
color = MsgColorEnum.GREEN.getValue();
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) {
@@ -2561,12 +2561,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
cnContentLower = "项目: " + PRN +
"\n法规: " + LAW_CN +
"\n发起人: " + sysUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
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());
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
color = MsgColorEnum.GREEN.getValue();
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) {
@@ -2589,12 +2589,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
cnContentLower = "项目: " + PRN +
"\n法规: " + LAW_CN +
"\n发起人: " + sysUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
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());
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
color = MsgColorEnum.GREEN.getValue();
@@ -2618,12 +2618,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
cnContentLower = "项目: " + PRN +
"\n法规: " + LAW_CN +
"\n发起人: " + sysUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
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());
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate());
color = MsgColorEnum.RED.getValue();
@@ -2659,6 +2659,20 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,请及时查看处理此项任务,谢谢!";
cnContentLower = "项目: " + PRN +
"\n法规: " + LAW_CN +
"\n发起人: " + sysUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!";
enContentLower = "Project: " + PRN +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + sysUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
color = MsgColorEnum.GREEN.getValue();
} else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_START_MSG.getValue())){
String prehomoDutyId = jsonObject.getString("prehomoDutyId"); //pre-Home责任人id
userIdList.add(prehomoDutyId);
@@ -2678,6 +2692,19 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId())
);
initiatorLark = initiatorLarkInfo.getUsername();
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
cnContentUpper = "您好,请及时查看处理此项任务,谢谢!";
cnContentLower = "项目: " + PRN +
"\n法规: " + LAW_CN +
"\n发起人: " + initiatorLark +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
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.getPrehomoDueDate());
color = MsgColorEnum.GREEN.getValue();
} else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_START_MSG.getValue())){
String verifyDutyId = jsonObject.getString("verifyDutyId"); //验证符合性责任人id
userIdList.add(verifyDutyId);
@@ -7,9 +7,15 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result;
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.vo.LoginUser;
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.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.JumpLinkEnum;
@@ -32,6 +38,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -71,6 +79,11 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
@Value(value = "${jero.backUrl}")
private String backUrl;
@Autowired
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
@Autowired
private IFeishuService feishuService;
/**
* 保存
*
@@ -341,61 +354,113 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
String id = UUID.randomUUID().toString().replace("-", "");
//String id = UUID.randomUUID().toString().replace("-", "");
MessageTypeEnum messageTypeEnum = null;
String msgContentEN = "";
//MessageTypeEnum messageTypeEnum = null;
//String msgContentEN = "";
String msgTitle = "";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
String cnContentUpper = "";//中文上部分
String cnContentLower = "";//中文下部分
String enContentUpper = "";//英文上部分
String enContentLower = "";//英文下部分
//项目名称
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;
//法规中英文
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");
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
//给工程师下发消息
if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())){
//XXX has distributed the design compliance confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time.
msgContentEN = currentUser.getUsername() + " has assigned the design compliance confirmation process of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " to you. Please check and handle it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a design compliance task to complete";
//msgContentEN = currentUser.getUsername() + " has assigned the design compliance confirmation process of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + " to you. Please check and handle it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + ": You have a design compliance task to complete";
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task in a timely manner.";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.PREHOMO_ISSUE_DRE_MSG.getValue())){
//XXX has distributed the Pre-Homo confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time.
msgContentEN = currentUser.getUsername() + " has assigned the Pre-Homo confirmation process of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " to you. Please check and handle it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a Pre-Homo task to complete";
//msgContentEN = currentUser.getUsername() + " has assigned the Pre-Homo confirmation process of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + " to you. Please check and handle it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + ": You have a Pre-Homo task to complete";
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task in a timely manner.";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.VERIFY_ISSUE_DRE_MSG.getValue())){
//XXX has distributed the Verify compliance confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time.
msgContentEN = currentUser.getUsername() + " has assigned the validation compliance confirmation process of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " to you. Please check and handle it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a validation compliance task to complete";
//msgContentEN = currentUser.getUsername() + " has assigned the validation compliance confirmation process of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + " to you. Please check and handle it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + ": You have a validation compliance task to complete";
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task in a timely manner.";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
}
if(CollectionUtils.isNotEmpty(userIdList) && org.apache.commons.lang3.StringUtils.isNotEmpty(msgContentEN)){
if(CollectionUtils.isNotEmpty(userIdList) && org.apache.commons.lang3.StringUtils.isNotEmpty(msgTitle)){
//飞书跳转链接
String hrefFeishu = backUrl
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
@@ -403,17 +468,36 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
+ "&projectName=" + projectNameInfoEO.getProjectName();
//系统内部跳转链接
String href = "<a href='"
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
+ "&projectName=" + projectNameInfoEO.getProjectName()
+ "'>" + " View details" + "</a>";
String contentInfo = msgContentEN + " " + href;
Map<String,Object> sendMessageMap = new HashMap<>();
sendMessageMap.put("hrefFeishu",hrefFeishu);
sendMessageMap.put("contentInfo",contentInfo);
//String href = "<a href='"
// + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
// + "&projectName=" + projectNameInfoEO.getProjectName()
// + "'>" + " View details" + "</a>";
//String contentInfo = msgContentEN + " " + href;
//Map<String,Object> sendMessageMap = new HashMap<>();
//sendMessageMap.put("hrefFeishu",hrefFeishu);
//sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
List<String> 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(MsgColorEnum.GREEN.getValue()); // 颜色
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
} catch (IOException e) {
log.error("飞书消息推送失败");
}
}
}
}
@@ -6,10 +6,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result;
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;
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.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.*;
@@ -24,6 +30,7 @@ import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.entity.SysUserRole;
import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysUserRoleService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.wkflow.enums.DesignComplianceNodeEnum;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
@@ -91,6 +98,12 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
@Value(value = "${jero.backUrl}")
private String backUrl;
@Autowired
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IFeishuService feishuService;
/**
* 保存
@@ -380,58 +393,116 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id
userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
String msgContentEN = "";
//String msgContentEN = "";
String msgTitle = "";
MessageTypeEnum messageTypeEnum = null;
//MessageTypeEnum messageTypeEnum = null;
String cnContentUpper = "";//中文上部分
String cnContentLower = "";//中文下部分
String enContentUpper = "";//英文上部分
String enContentLower = "";//英文下部分
//项目名称
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;
//法规中英文
QueryWrapper<ProjectLawsInventoryEO> projectLawsInventoryEOQueryWrapper = new QueryWrapper<>();
projectLawsInventoryEOQueryWrapper.eq("project_library_id", projectLibraryId).eq("serial_number", serialNumber);
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectOne(projectLawsInventoryEOQueryWrapper);
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");
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_REMIND_MSG.getValue())){
//Please check and deal with the design compliance confirmation process of GB 7258 in XXX (project name) in time.
msgContentEN = "Please check and deal with the design compliance confirmation process of "
+ serialNumber + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a design compliance task to complete";
//msgContentEN = "Please check and deal with the design compliance confirmation process of "
// + serialNumber + " in "
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + " in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + ": You have a design compliance task to complete";
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
//feishuMsgVo.setRegulationNo(serialNumber);
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(msgType,MsgTypeEnum.PREHOMO_REMIND_MSG.getValue())){
//Please check and deal with the Pre-Homo confirmation process of GB 7258 in XXX (project name) in time.
msgContentEN = "Please check and address the Pre-Homo confirmation process of "
+ serialNumber + " in "+ projectNameInfoEO.getProjectName()
+ " in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a Pre-Homo task to complete";
//msgContentEN = "Please check and address the Pre-Homo confirmation process of "
// + serialNumber + " in "+ projectNameInfoEO.getProjectName()
// + " in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + ": You have a Pre-Homo task to complete";
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
//feishuMsgVo.setRegulationNo(serialNumber);
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(msgType,MsgTypeEnum.VERIFY_REMIND_MSG.getValue())){
//Please check and deal with the Verify compliance confirmation process of GB 7258 in XXX (project name) in time.
msgContentEN = "Please check and address the validation compliance confirmation process of "
+ serialNumber + " in "+ projectNameInfoEO.getProjectName()
+ " in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a validation compliance task to complete";
//msgContentEN = "Please check and address the validation compliance confirmation process of "
// + serialNumber + " in "+ projectNameInfoEO.getProjectName()
// + " in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
// + ": You have a validation compliance task to complete";
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
//feishuMsgVo.setRegulationNo(serialNumber);
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
}
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgTitle)){
//飞书跳转链接
String hrefFeishu = backUrl
@@ -441,20 +512,40 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
+ projectYearNameInfoEO.getYearName()
+ "&targetMarket=" + projectLibraryBase.getTargetMarket();
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
List<String> 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(MsgColorEnum.GREEN.getValue()); // 颜色
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
} catch (IOException e) {
log.error("飞书消息推送失败");
}
//系统内部跳转链接
String href = "<a href='"
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
+ projectYearNameInfoEO.getYearName()
+ "&targetMarket=" + projectLibraryBase.getTargetMarket()
+ "'>" + " View details" + "</a>";
String contentInfo = msgContentEN + " " + href;
Map<String,Object> sendMessageMap = new HashMap<>();
sendMessageMap.put("hrefFeishu",hrefFeishu);
sendMessageMap.put("contentInfo",contentInfo);
//String href = "<a href='"
// + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
// + projectYearNameInfoEO.getYearName()
// + "&targetMarket=" + projectLibraryBase.getTargetMarket()
// + "'>" + " View details" + "</a>";
//String contentInfo = msgContentEN + " " + href;
//Map<String,Object> sendMessageMap = new HashMap<>();
//sendMessageMap.put("hrefFeishu",hrefFeishu);
//sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
}
return new Result<>().success("提醒办理成功!");
}
@@ -1,8 +1,14 @@
package com.jero.modules.project.service.impl;
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.common.system.vo.LoginUser;
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.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.FeedBackHistoryDataStatusEnum;
@@ -24,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -63,6 +70,12 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
@Value(value = "${jero.backUrl}")
private String backUrl;
@Autowired
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
@Autowired
private IFeishuService feishuService;
/**
* 保存
*
@@ -150,56 +163,108 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
ProjectYearNameInfoEO projectYearNameInfoEO = this.projectYearNameInfoEOService.getOne(projectYearInfoEOQueryWrapper);
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has replied to your engineering deliverable information. Please check and address it in a timely manner.");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
//feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has replied to your engineering deliverable information. Please check and address it in a timely manner.");
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
MessageTypeEnum messageTypeEnum = null;
//MessageTypeEnum messageTypeEnum = null;
//消息内容
String msgContentEN = "";
//String msgContentEN = "";
String msgTitle = "";
String initiatorId = "";
//String initiatorId = "";
String cnContentUpper = "";//中文上部分
String cnContentLower = "";//中文下部分
String enContentUpper = "";//英文上部分
String enContentLower = "";//英文下部分
//项目名称
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getProjectVersion())) ? "00" : projectLibraryBaseInfo.getProjectVersion();
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBaseInfo.getTargetMarket() + "-" + projectVersion;
//法规中英文
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
String flowType = projectTaskInventoryFeedbackEO.getFlowType();
if(StringUtils.equals(flowType,FlowTypeEnum.SJFHXSHLC.getValue())){
msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + " for design compliance confirmation. Please check and address it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
+ ": You have a design compliance task to complete";
//msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + " for design compliance confirmation. Please check and address it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
// + ": You have a design compliance task to complete";
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
initiatorId = projectLawsInventoryEO.getDesignInitiatorId();
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
//initiatorId = projectLawsInventoryEO.getDesignInitiatorId();
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"回复了您提交的工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has replied to your engineering deliverable information. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(flowType,FlowTypeEnum.PREHOMOQRLC.getValue())){
msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + " for Pre-Homo compliance confirmation. Please check and address it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
+ ": You have a Pre-Homo task to complete";
//msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + " for Pre-Homo compliance confirmation. Please check and address it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
// + ": You have a Pre-Homo task to complete";
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
initiatorId = projectLawsInventoryEO.getPrehomoInitiatorId();
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
//initiatorId = projectLawsInventoryEO.getPrehomoInitiatorId();
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"回复了您提交的工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has replied to your engineering deliverable information. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
+ ": You have a validation compliance task to complete";
//msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
// + ": You have a validation compliance task to complete";
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
initiatorId = projectLawsInventoryEO.getVerifyInitiatorId();
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
//initiatorId = projectLawsInventoryEO.getVerifyInitiatorId();
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ currentUser.getUsername() +"回复了您提交的工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
enContentUpper = "Hello! "+ currentUser.getUsername() +" has replied to your engineering deliverable information. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}
//飞书跳转链接
@@ -209,28 +274,47 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
+ projectYearNameInfoEO.getYearName()
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket();
//系统内部跳转链接
String href = "<a href='"
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
+ projectYearNameInfoEO.getYearName()
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
+ "'>" + " View details" + "</a>";
String contentInfo = msgContentEN + " " + href;
Map<String,Object> sendMessageMap = new HashMap<>();
sendMessageMap.put("hrefFeishu",hrefFeishu);
sendMessageMap.put("contentInfo",contentInfo);
String initiator = "";
if(StringUtils.isNotEmpty(initiatorId)){
QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
initiator = sysUser.getUsername();
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
List<String> thirdIdList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(sysUsers)){
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
}
feishuMsgVo.setInitiator(initiator);
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(MsgColorEnum.GREEN.getValue()); // 颜色
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
} catch (IOException e) {
log.error("飞书消息推送失败");
}
//系统内部跳转链接
//String href = "<a href='"
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
// + projectYearNameInfoEO.getYearName()
// + "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
// + "'>" + " View details" + "</a>";
//String contentInfo = msgContentEN + " " + href;
//Map<String,Object> sendMessageMap = new HashMap<>();
//sendMessageMap.put("hrefFeishu",hrefFeishu);
//sendMessageMap.put("contentInfo",contentInfo);
//String initiator = "";
//if(StringUtils.isNotEmpty(initiatorId)){
// QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
// queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
// SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
// initiator = sysUser.getUsername();
//}
//feishuMsgVo.setInitiator(initiator);
//发送消息
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
}
}
}
@@ -372,11 +456,11 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
}
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has submitted the engineering deliverable information. Please check and address it in a timely manner.");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
//feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has submitted the engineering deliverable information. Please check and address it in a timely manner.");
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
String initiator = "";
if (StringUtils.isNotEmpty(initiatorId)) {
@@ -385,48 +469,99 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
initiator = sysUser.getUsername();
}
feishuMsgVo.setInitiator(initiator);
//feishuMsgVo.setInitiator(initiator);
MessageTypeEnum messageTypeEnum = null;
//MessageTypeEnum messageTypeEnum = null;
//消息内容
String msgContentEN = "";
//String msgContentEN = "";
String msgTitle = "";
String cnContentUpper = "";//中文上部分
String cnContentLower = "";//中文下部分
String enContentUpper = "";//英文上部分
String enContentLower = "";//英文下部分
//项目名称
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getProjectVersion())) ? "00" : projectLibraryBaseInfo.getProjectVersion();
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBaseInfo.getTargetMarket() + "-" + projectVersion;
//法规中英文
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
String flowType = projectTaskInventoryFeedbackEO.getFlowType();
if(StringUtils.equals(flowType,FlowTypeEnum.SJFHXSHLC.getValue())){
msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + "for design compliance confirmation. Please check and address it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
+ ": You have a design compliance task to complete";
//msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + "for design compliance confirmation. Please check and address it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
// + ": You have a design compliance task to complete";
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
enContentUpper = "Hello! "+ initiator +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(flowType,FlowTypeEnum.PREHOMOQRLC.getValue())){
msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + " for Pre-Homo confirmation. Please check and address it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
+ ": You have a Pre-Homo task to complete";
//msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + " for Pre-Homo confirmation. Please check and address it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
// + ": You have a Pre-Homo task to complete";
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
enContentUpper = "Hello! "+ initiator +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}else if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
+ projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
+ ": You have a validation compliance task to complete";
//msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
// + projectLawsInventoryEO.getSerialNumber() + " in "
// + projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
// + ": You have a validation compliance task to complete";
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
enContentUpper = "Hello! "+ initiator +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
}
//飞书跳转链接
@@ -436,20 +571,39 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
+ projectYearNameInfoEO.getYearName()
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket();
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
List<String> 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(MsgColorEnum.GREEN.getValue()); // 颜色
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
} catch (IOException e) {
log.error("飞书消息推送失败");
}
//系统内部跳转链接
String href = "<a href='"
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
+ projectYearNameInfoEO.getYearName()
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
+ "'>" + " View details" + "</a>";
String contentInfo = msgContentEN + " " + href;
Map<String,Object> sendMessageMap = new HashMap<>();
sendMessageMap.put("hrefFeishu",hrefFeishu);
sendMessageMap.put("contentInfo",contentInfo);
//String href = "<a href='"
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
// + projectYearNameInfoEO.getYearName()
// + "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
// + "'>" + " View details" + "</a>";
//String contentInfo = msgContentEN + " " + href;
//Map<String,Object> sendMessageMap = new HashMap<>();
//sendMessageMap.put("hrefFeishu",hrefFeishu);
//sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
}
}
}