法规意见收集飞书路由跳转

This commit is contained in:
CD
2022-11-07 11:55:19 +08:00
parent e4428fff01
commit 7afa1f6faf
3 changed files with 43 additions and 25 deletions
@@ -17,10 +17,7 @@ import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.*;
/**
* 法规意见收集表 - 定时器
@@ -62,22 +59,30 @@ public class LawsOpinionGatherRemindJob implements Job {
throw new JeroBootException("日期转换错误");
}
if (days == 3) {
List<String> userIdList = this.workFlowFeignClient.getLawsOpinionGatherFlowAssigneeList(lawsOpinionGatherEO.getId());
if(CollectionUtils.isNotEmpty(userIdList)){
JSONObject sendJsonObject = new JSONObject();
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue());
sendJsonObject.put("lawsOpinionGatherId",lawsOpinionGatherEO.getId());
sendJsonObject.put("userIdList",userIdList);
this.lawsOpinionGatherEOService.workFlowSendMsg(sendJsonObject);
Map<String, String> map = this.workFlowFeignClient.getLawsOpinionGatherFlowAssigneeList(lawsOpinionGatherEO.getId());
if(!map.isEmpty()){
for (String key : map.keySet()) {
JSONObject sendJsonObject = new JSONObject();
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue());
sendJsonObject.put("lawsOpinionGatherId",lawsOpinionGatherEO.getId());
sendJsonObject.put("taskId",map.get(key));
sendJsonObject.put("actiProcInstId",lawsOpinionGatherEO.getActiProcInstId());
sendJsonObject.put("evaluatorIds",key);
this.lawsOpinionGatherEOService.workFlowSendMsg(sendJsonObject);
}
}
} else if (endTime.equals(now)) {
List<String> userIdList = this.workFlowFeignClient.getLawsOpinionGatherFlowAssigneeList(lawsOpinionGatherEO.getId());
if(CollectionUtils.isNotEmpty(userIdList)){
JSONObject sendJsonObject = new JSONObject();
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_TODAY_MSG.getValue());
sendJsonObject.put("lawsOpinionGatherId",lawsOpinionGatherEO.getId());
sendJsonObject.put("userIdList",userIdList);
this.lawsOpinionGatherEOService.workFlowSendMsg(sendJsonObject);
Map<String, String> map = this.workFlowFeignClient.getLawsOpinionGatherFlowAssigneeList(lawsOpinionGatherEO.getId());
if(!map.isEmpty()){
for (String key : map.keySet()) {
JSONObject sendJsonObject = new JSONObject();
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_TODAY_MSG.getValue());
sendJsonObject.put("lawsOpinionGatherId",lawsOpinionGatherEO.getId());
sendJsonObject.put("taskId",map.get(key));
sendJsonObject.put("actiProcInstId",lawsOpinionGatherEO.getActiProcInstId());
sendJsonObject.put("evaluatorIds",key);
this.lawsOpinionGatherEOService.workFlowSendMsg(sendJsonObject);
}
}
}
/*if(StringUtils.equals(nextDayStr,sdf.format(lawsOpinionGatherEO.getEndTime()))){
@@ -214,6 +214,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
sendMsgJson.put("lawsOpinionGatherId",jsonObject.getString("id"));
sendMsgJson.put("initiatorUserId",jsonObject.getString("initiatorUserId"));
sendMsgJson.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_COMPLETE_MSG.getValue());
sendMsgJson.put("taskId",jsonObject.getString("taskId"));
sendMsgJson.put("actiProcInstId",jsonObject.getString("actiProcInstId"));
workFlowSendMsg(sendMsgJson);
}
@@ -291,6 +293,9 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
throw new JeroBootException("发送消息类型不能为空,请检查!");
}
String hrefFeishu = "";
String taskId = jsonObject.getString("taskId");
String actiProcInstId = jsonObject.getString("actiProcInstId");
String lawsOpinionGatherId = jsonObject.getString("lawsOpinionGatherId");
//String serialNumber = jsonObject.getString("serialNumber"); //文档库编号
@@ -314,7 +319,7 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
String enContentUpper = "";
String enContentLower = "";
if(StringUtils.equals(msgType,MsgTypeEnum.LAWS_OPOMOPM_GATHER_START_MSG.getValue())){
userIdList.addAll(Arrays.asList(jsonObject.getString("evaluatorIds").split(",")));
userIdList.add(jsonObject.getString("evaluatorIds"));
//msgContentEN = "You recieved the Collection of Legislative Comments of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner.";
//msgTitle = "You have a Collection of Legislative Comments task to complete";
@@ -333,6 +338,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
"\nInitiator: " + initiator +
"\nDue Date: " + endTime;
//飞书跳转链接
hrefFeishu = backUrl + "/regulatoryProcessReview?prcId="+ actiProcInstId +"&taskIds="+ taskId +"&prcType=5&router=%2FregulatoryAssessmentTasks&prcNum="+ lawsOpinionGatherEO.getPrcNum() +"&taskDefinitionKey=pgrpg&isDisabled=false";
}else if(StringUtils.equals(msgType,MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_SUBMIT_MSG.getValue())){
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
@@ -353,9 +360,10 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
"\nInitiator: " + initiator +
"\nDue Date: " + endTime;
hrefFeishu = backUrl + "/regulatoryProcessReview?prcId="+ actiProcInstId +"&taskIds="+ taskId +"&prcType=5&router=%2FregulatoryAssessmentTasks&prcNum="+ lawsOpinionGatherEO.getPrcNum() +"&taskDefinitionKey=pgrpg&isDisabled=true";
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue())) {
userIdList = (List<String>) jsonObject.get("userIdList");
userIdList.add(jsonObject.getString("evaluatorIds"));
cnContentUpper = "您好,该任务将于3天后到期,请及时查看处理,谢谢!";
cnContentLower = "编号: " + lawsOpinionGatherEO.getSerialNumber() +
@@ -366,9 +374,10 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_TODAY_MSG.getValue())){
userIdList = (List<String>) jsonObject.get("userIdList");
hrefFeishu = backUrl + "/regulatoryProcessReview?prcId="+ actiProcInstId +"&taskIds="+ taskId +"&prcType=5&router=%2FregulatoryAssessmentTasks&prcNum="+ lawsOpinionGatherEO.getPrcNum() +"&taskDefinitionKey=pgrpg&isDisabled=false";
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_TODAY_MSG.getValue())){
userIdList.add(jsonObject.getString("evaluatorIds"));
cnContentUpper = "您好,该任务将于今天到期,请尽快查看处理,谢谢!";
cnContentLower = "编号: " + lawsOpinionGatherEO.getSerialNumber() +
"\n标题: " + lawsOpinionGatherEO.getTitle() +
@@ -378,6 +387,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
hrefFeishu = backUrl + "/regulatoryProcessReview?prcId="+ actiProcInstId +"&taskIds="+ taskId +"&prcType=5&router=%2FregulatoryAssessmentTasks&prcNum="+ lawsOpinionGatherEO.getPrcNum() +"&taskDefinitionKey=pgrpg&isDisabled=false";
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_COMPLETE_MSG.getValue())) {
userIdList.add((String) jsonObject.get("initiatorUserId"));
@@ -391,6 +402,9 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName() +
"\nDue Date: " + endTime;
hrefFeishu = backUrl + "/regulatoryProcessReview?prcId="+ actiProcInstId +"&taskIds="+ taskId +"&prcType=5&router=%2FregulatoryAssessmentTasks&prcNum="+ lawsOpinionGatherEO.getPrcNum() +"&taskDefinitionKey=pgrpg&isDisabled=true";
}
/*else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_MSG.getValue())){
userIdList = (List<String>) jsonObject.get("userIdList");
@@ -405,8 +419,7 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
if (ObjectUtils.isNotEmpty(sysUsers)) {
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
}
//飞书跳转链接
String hrefFeishu = backUrl + JumpLinkEnum.FGPG_TODO_CENTER_LINK.getLink();
try {
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
feishuMsgVo.setTitle(title);
@@ -174,7 +174,7 @@ public interface WorkFlowFeignClient {
Result<String> deleteProcessInstanceByTaskId(@RequestParam("taskId") String taskId);
@RequestMapping(value = "/bat-wkflow/task/getLawsOpinionGatherFlowAssigneeList",method = RequestMethod.GET)
List<String> getLawsOpinionGatherFlowAssigneeList(@RequestParam("lawsOpinionGatherId") String lawsOpinionGatherId);
Map<String,String> getLawsOpinionGatherFlowAssigneeList(@RequestParam("lawsOpinionGatherId") String lawsOpinionGatherId);
@RequestMapping(value = "/bat-wkflow/task/getTaskAssigneeListByPrcIds",method = RequestMethod.GET)
List<String> getTaskAssigneeListByPrcIds(@RequestParam("actiProcInstIds") String actiProcInstIds);