Merge remote-tracking branch 'origin/fix_bug_first_stage' into fix_bug_first_stage
This commit is contained in:
+5
-4
@@ -6,10 +6,11 @@ package com.jero.common.constant.enums;
|
||||
* @auth zhn
|
||||
*/
|
||||
public enum MessageTypeEnum {
|
||||
READ("订阅通知","1"),
|
||||
WARN("预警信息","2"),
|
||||
PUSH("转发推送","3"),
|
||||
COLLECT("认证消息","4");
|
||||
READ("Subscription Notification","1"),
|
||||
WARN("Early Warning","2"),
|
||||
PUSH("Share / Forward","3"),
|
||||
HOMO_TASK("Homo Parameter Task","4"),
|
||||
TASK("Regulation Compliance Task", "5");
|
||||
|
||||
String name;
|
||||
String value;
|
||||
|
||||
+50
-45
@@ -486,53 +486,58 @@ public class QueryGenerator {
|
||||
}
|
||||
name = oConvertUtils.camelToUnderline(name);
|
||||
log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value);
|
||||
switch (rule) {
|
||||
case GT:
|
||||
queryWrapper.gt(name, value);
|
||||
break;
|
||||
case GE:
|
||||
queryWrapper.ge(name, value);
|
||||
break;
|
||||
case LT:
|
||||
queryWrapper.lt(name, value);
|
||||
break;
|
||||
case LE:
|
||||
queryWrapper.le(name, value);
|
||||
break;
|
||||
case EQ:
|
||||
case EQ_WITH_ADD:
|
||||
queryWrapper.eq(name, value);
|
||||
break;
|
||||
case NE:
|
||||
queryWrapper.ne(name, value);
|
||||
break;
|
||||
case IN:
|
||||
if(value instanceof String) {
|
||||
queryWrapper.in(name, (Object[])value.toString().split(","));
|
||||
}else if(value instanceof String[]) {
|
||||
queryWrapper.in(name, (Object[]) value);
|
||||
if(" is null ".equals(value)){
|
||||
queryWrapper.isNull(name);
|
||||
}else{
|
||||
switch (rule) {
|
||||
case GT:
|
||||
queryWrapper.gt(name, value);
|
||||
break;
|
||||
case GE:
|
||||
queryWrapper.ge(name, value);
|
||||
break;
|
||||
case LT:
|
||||
queryWrapper.lt(name, value);
|
||||
break;
|
||||
case LE:
|
||||
queryWrapper.le(name, value);
|
||||
break;
|
||||
case EQ:
|
||||
case EQ_WITH_ADD:
|
||||
queryWrapper.eq(name, value);
|
||||
break;
|
||||
case NE:
|
||||
queryWrapper.ne(name, value);
|
||||
break;
|
||||
case IN:
|
||||
if(value instanceof String) {
|
||||
queryWrapper.in(name, (Object[])value.toString().split(","));
|
||||
}else if(value instanceof String[]) {
|
||||
queryWrapper.in(name, (Object[]) value);
|
||||
}
|
||||
//update-begin-author:taoyan date:20200909 for:【bug】in 类型多值查询 不适配postgresql #1671
|
||||
else if(value.getClass().isArray()) {
|
||||
queryWrapper.in(name, (Object[])value);
|
||||
}else {
|
||||
queryWrapper.in(name, value);
|
||||
}
|
||||
//update-end-author:taoyan date:20200909 for:【bug】in 类型多值查询 不适配postgresql #1671
|
||||
break;
|
||||
case LIKE:
|
||||
queryWrapper.like(name, value);
|
||||
break;
|
||||
case LEFT_LIKE:
|
||||
queryWrapper.likeLeft(name, value);
|
||||
break;
|
||||
case RIGHT_LIKE:
|
||||
queryWrapper.likeRight(name, value);
|
||||
break;
|
||||
default:
|
||||
log.info("--查询规则未匹配到---");
|
||||
break;
|
||||
}
|
||||
//update-begin-author:taoyan date:20200909 for:【bug】in 类型多值查询 不适配postgresql #1671
|
||||
else if(value.getClass().isArray()) {
|
||||
queryWrapper.in(name, (Object[])value);
|
||||
}else {
|
||||
queryWrapper.in(name, value);
|
||||
}
|
||||
//update-end-author:taoyan date:20200909 for:【bug】in 类型多值查询 不适配postgresql #1671
|
||||
break;
|
||||
case LIKE:
|
||||
queryWrapper.like(name, value);
|
||||
break;
|
||||
case LEFT_LIKE:
|
||||
queryWrapper.likeLeft(name, value);
|
||||
break;
|
||||
case RIGHT_LIKE:
|
||||
queryWrapper.likeRight(name, value);
|
||||
break;
|
||||
default:
|
||||
log.info("--查询规则未匹配到---");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
||||
+4
-4
@@ -1061,7 +1061,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
sysAnnouncement.setDelFlag("0");
|
||||
sysAnnouncement.setSendStatus("0");
|
||||
sysAnnouncement.setSendTime(new Date());
|
||||
sysAnnouncement.setMsgCategory(MessageTypeEnum.COLLECT.getValue());//消息类型
|
||||
sysAnnouncement.setMsgCategory(MessageTypeEnum.HOMO_TASK.getValue());//消息类型
|
||||
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
|
||||
sysAnnouncement.setMsgContent(content);
|
||||
sysAnnouncement.setMsgContentInfo(contentInfo);
|
||||
@@ -1070,7 +1070,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
|
||||
// 发送飞书消息
|
||||
try {
|
||||
feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.COLLECT.getName(), hrefFeishu);
|
||||
feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.HOMO_TASK.getName(), hrefFeishu);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
@@ -1126,7 +1126,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
sysAnnouncement.setDelFlag("0");
|
||||
sysAnnouncement.setSendStatus("0");
|
||||
sysAnnouncement.setSendTime(new Date());
|
||||
sysAnnouncement.setMsgCategory(MessageTypeEnum.COLLECT.getValue());//消息类型
|
||||
sysAnnouncement.setMsgCategory(MessageTypeEnum.HOMO_TASK.getValue());//消息类型
|
||||
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
|
||||
sysAnnouncement.setMsgContent(content);
|
||||
sysAnnouncement.setMsgContentInfo(contentInfo);
|
||||
@@ -1135,7 +1135,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
|
||||
// 发送飞书消息
|
||||
try {
|
||||
feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.COLLECT.getName(), hrefFeishu);
|
||||
feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.HOMO_TASK.getName(), hrefFeishu);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
+9
@@ -1,5 +1,7 @@
|
||||
package com.jero.modules.feishu.service;
|
||||
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -26,4 +28,11 @@ public interface IFeishuService {
|
||||
* @throws IOException
|
||||
*/
|
||||
String batchSendMessage(String[] userIds, String message, String title, String backUrl) throws IOException;
|
||||
|
||||
/**
|
||||
* 发送卡片消息
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
*/
|
||||
String sendCardMsg(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException;
|
||||
}
|
||||
|
||||
+127
@@ -1,8 +1,11 @@
|
||||
package com.jero.modules.feishu.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.druid.support.json.JSONUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.system.util.HttpRequestUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -111,4 +114,128 @@ public class FeishuServiceImpl implements IFeishuService {
|
||||
}
|
||||
return tokenJson.get("msg").toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送卡片消息
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
*/
|
||||
public String sendCardMsg(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException {
|
||||
String token = getTenantAccessToken();
|
||||
// 设置请求头
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("Authorization", "Bearer " + token);
|
||||
headerMap.put("Content-Type", "application/json; charset=utf-8");
|
||||
|
||||
// 示例
|
||||
StringBuilder contentSb = new StringBuilder();
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"elements\": [");
|
||||
// 补充内容
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getContent())){
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + feishuMsgVo.getContent() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
};
|
||||
// 补充tasktype、project、Initiator等的外层
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"fields\": [");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"is_short\": false,");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"**Task Type:** " + feishuMsgVo.getTaskType() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getRegulationNo())){
|
||||
contentSb.append(",");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"is_short\": false,");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"**Regulation No:** " + feishuMsgVo.getRegulationNo() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getProject())){
|
||||
contentSb.append(",");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"is_short\": false,");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"**Project:** " + feishuMsgVo.getProject() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getInitiator())){
|
||||
contentSb.append(",");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"is_short\": false,");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"**Initiator:** " + feishuMsgVo.getInitiator() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getDueDate())){
|
||||
contentSb.append(",");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"is_short\": false,");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"**Due Date:** " + feishuMsgVo.getDueDate() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
}
|
||||
contentSb.append("],");
|
||||
contentSb.append("\"tag\": \"div\"");
|
||||
contentSb.append("},");
|
||||
contentSb.append("{\"tag\": \"hr\"},");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"actions\": [");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"button\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"view\",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("},");
|
||||
contentSb.append("\"type\": \"primary\",");
|
||||
contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
contentSb.append("\"tag\": \"action\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
contentSb.append("\"header\": {");
|
||||
contentSb.append("\"template\": \"green\",");
|
||||
contentSb.append("\"title\": {");
|
||||
contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(contentSb.toString());
|
||||
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
return tokenJson.get("msg").toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jero.modules.feishu.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 飞书消息的VO
|
||||
*/
|
||||
@Data
|
||||
public class FeishuMsgVo {
|
||||
|
||||
private String title; //标题
|
||||
|
||||
private String content; //内容
|
||||
|
||||
private String taskType; //任务类型
|
||||
|
||||
private String regulationNo; //法规编号
|
||||
|
||||
private String project; //项目名称
|
||||
|
||||
private String initiator; //发起人
|
||||
|
||||
private String dueDate; //截止时间
|
||||
|
||||
private String url; //回调的网址
|
||||
|
||||
}
|
||||
|
||||
+16
-4
@@ -1,6 +1,8 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectNameInfoEO;
|
||||
@@ -140,6 +142,11 @@ public class InventoryAffirmJob implements Job {
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and handle it in time.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Regulation List Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
@@ -159,17 +166,22 @@ public class InventoryAffirmJob implements Job {
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLibraryBase.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLibraryBase.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
/*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*/
|
||||
String msgContentEN = "The the regulation list confirmation for "
|
||||
+ projectNameInfoEO.getProjectName()
|
||||
String msgContentEN = "The regulation list confirmation for "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " will expire today. Please check and address it in a timely manner.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Regulation List Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
@@ -188,7 +200,7 @@ public class InventoryAffirmJob implements Job {
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLibraryBase.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLibraryBase.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-3
@@ -1,9 +1,12 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
import com.jero.modules.project.enums.MsgTypeEnum;
|
||||
import com.jero.modules.project.enums.SendMsgFlagEnum;
|
||||
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||
@@ -142,6 +145,12 @@ public class PrehomoJob implements Job {
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and handle it in time.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
|
||||
@@ -161,7 +170,7 @@ public class PrehomoJob implements Job {
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
@@ -170,9 +179,15 @@ public class PrehomoJob implements Job {
|
||||
//您XXX(项目名称)中GB 7258的Pre-Homo确认任务今天即将结束,请及时查看处理
|
||||
//The the Pre-Homo confirmation of GB 7258 in XXX (project name) is coming to an end today. Please check and deal with it in time
|
||||
String msgContentEN = "The the Pre-Homo confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " will expire today. Please check and address it in time.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
|
||||
@@ -192,7 +207,7 @@ public class PrehomoJob implements Job {
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
-3
@@ -1,6 +1,8 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
@@ -140,6 +142,12 @@ public class VerifyComplianceJob implements Job {
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and handle it in time.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
|
||||
@@ -159,7 +167,7 @@ public class VerifyComplianceJob implements Job {
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
@@ -168,9 +176,15 @@ public class VerifyComplianceJob implements Job {
|
||||
//您XXX(项目名称)中GB 7258的验证符合性确认任务今天即将结束,请及时查看处理
|
||||
//The the Verify compliance confirmation of GB 7258 in XXX (project name) is coming to an end today. Please check and deal with it in time
|
||||
String msgContentEN = "The the validation compliance confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " will expire today. Please check and address it in time.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
|
||||
@@ -190,7 +204,7 @@ public class VerifyComplianceJob implements Job {
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
-3
@@ -1,6 +1,8 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
@@ -141,6 +143,12 @@ public class designComplianceJob implements Job {
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and address it in a timely manner.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
|
||||
@@ -160,17 +168,23 @@ public class designComplianceJob implements Job {
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
//您XXX(项目名称)中GB 7258的设计符合性确认任务今天即将结束,请及时查看处理
|
||||
String msgContentEN = "The the design compliance confirmation for "
|
||||
String msgContentEN = "The design compliance confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
|
||||
+ " will expire today. Please check and address it in time.";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
|
||||
@@ -190,7 +204,7 @@ public class designComplianceJob implements Job {
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap);
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.itextpdf.text.DocumentException;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -76,7 +78,7 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
||||
*/
|
||||
Result<?> updateStatusBatch(JSONObject json);
|
||||
|
||||
void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> params);
|
||||
void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> params, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType);
|
||||
|
||||
/**
|
||||
* 匹配相关人员
|
||||
|
||||
+65
-10
@@ -35,6 +35,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.FeishuMsgVo;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
@@ -1262,9 +1263,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
//消息内容
|
||||
String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for " + projectNameInfoEO.getProjectName()
|
||||
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.";
|
||||
|
||||
// 飞书消息封装
|
||||
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(currentUser.getUsername());
|
||||
feishuMsgVo.setDueDate(inventoryAffirmDueDate);
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
@@ -1283,7 +1293,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap);
|
||||
sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
|
||||
result = "发起清单确认";
|
||||
@@ -1397,7 +1407,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
* @param projectLibraryId
|
||||
*/
|
||||
@Override
|
||||
public void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> sendMessageMap){
|
||||
public void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType){
|
||||
String idTemp = projectLibraryId;
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
@@ -1405,7 +1415,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
//飞书跳转链接
|
||||
// //飞书跳转链接
|
||||
String hrefFeishu = (String) sendMessageMap.get("hrefFeishu");
|
||||
//消息内容
|
||||
String contentInfo = (String) sendMessageMap.get("contentInfo");
|
||||
@@ -1415,9 +1425,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket(idTemp, idTemp);
|
||||
|
||||
//飞书消息
|
||||
// //飞书消息
|
||||
try {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, MessageTypeEnum.PUSH.getName(), hrefFeishu);
|
||||
if (feishuMsgVo != null){
|
||||
// 补充飞书跳转链接
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setTitle(messageType.getName());
|
||||
iFeishuService.sendCardMsg(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
} else {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, messageType.getName(), hrefFeishu);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
@@ -1767,32 +1784,56 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
|
||||
|
||||
QueryWrapper<ProjectYearNameInfoEO> projectYearInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
|
||||
String msgContentEN = "";
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
|
||||
if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) {
|
||||
userIdList.add(engineeringInterfacePerson);
|
||||
msgContentEN = sysUser.getUsername() + " assigned the regulation task confirmation of " + projectNameInfoEO.getProjectName()
|
||||
+ ".The due date is:" +taskAffirmDueDate+ " Please check and address it in a timely manner.";
|
||||
|
||||
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task to you. Please check and and handle it in time.");
|
||||
|
||||
} 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 rejected the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
+ ".to you. the due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
|
||||
|
||||
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time.");
|
||||
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) {
|
||||
userIdList.add(engineeringInterfacePerson);
|
||||
msgContentEN = sysUser.getUsername() + " has returned the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
|
||||
+ ".The due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
|
||||
|
||||
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has returned the task. Please check and and handle it in time.");
|
||||
|
||||
} 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.";
|
||||
|
||||
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has submitted the task. Please check and and handle it in time.");
|
||||
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
|
||||
feishuMsgVo.setTaskType("Regulation Task Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
feishuMsgVo.setInitiator(sysUser.getUsername());
|
||||
feishuMsgVo.setDueDate(taskAffirmDueDate);
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink();
|
||||
//系统内部跳转链接
|
||||
@@ -1803,7 +1844,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
sendMessage(msgContentEN,userIdList,id,sendMessageMap);
|
||||
sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5982,7 +6023,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
//消息内容
|
||||
String msgContentEN = "Please address the regulation list confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. ";
|
||||
|
||||
//飞书跳转链接
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! Please address the regulation list confirmation process ASAP. ");
|
||||
feishuMsgVo.setTaskType("Regulation List Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryId
|
||||
@@ -6001,7 +6047,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
sendMessage(msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap);
|
||||
sendMessage(msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6032,9 +6078,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
|
||||
|
||||
QueryWrapper<ProjectYearNameInfoEO> projectYearInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
//消息内容
|
||||
String msgContentEN = "Please address the regulation task confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. ";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
feishuMsgVo.setTaskType("Regulation List Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink();
|
||||
//系统内部跳转链接
|
||||
@@ -6046,7 +6101,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
sendMessage(msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap);
|
||||
sendMessage(msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+3
-2
@@ -111,8 +111,9 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsByDictCode("region");
|
||||
for (ProjectLibraryBase libraryBase : projectLibraryBaseList) {
|
||||
targetMarket(projectLibraryBase, dictItemList, libraryBase);
|
||||
Map<String,Object> mapList = new HashMap<>();
|
||||
List<List<TimeNodeVO>> collect = new ArrayList<>();
|
||||
if(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime)){
|
||||
@@ -124,7 +125,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
|
||||
if(collect.size() != 0){
|
||||
index ++;
|
||||
mapList.put("index",index);
|
||||
mapList.put("projectName",libraryBase.getProjectName());
|
||||
mapList.put("projectName",libraryBase.getProjectName()+" "+libraryBase.getYearName()+"-"+libraryBase.getTargetMarket());
|
||||
mapList.put("data",collect);
|
||||
result.add(mapList);
|
||||
}
|
||||
|
||||
+29
-5
@@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
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.MessageTypeEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
import com.jero.modules.project.enums.MsgTypeEnum;
|
||||
@@ -260,22 +262,44 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
String id = UUID.randomUUID().toString().replace("-", "");
|
||||
|
||||
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 distributed the design compliance confirmation process of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "+ projectNameInfoEO.getProjectName()
|
||||
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.";
|
||||
|
||||
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());
|
||||
|
||||
}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()
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " to you. Please check and handle it in time.";
|
||||
|
||||
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());
|
||||
|
||||
}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()
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " to you. Please check and handle it in time.";
|
||||
|
||||
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());
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && org.apache.commons.lang3.StringUtils.isNotEmpty(msgContentEN)){
|
||||
//飞书跳转链接
|
||||
@@ -297,7 +321,7 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap);
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+36
-6
@@ -6,9 +6,11 @@ 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.MessageTypeEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.*;
|
||||
import com.jero.modules.project.mapper.*;
|
||||
@@ -315,21 +317,42 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
|
||||
String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id
|
||||
userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
|
||||
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()
|
||||
+ serialNumber + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " in time.";
|
||||
|
||||
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
}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.";
|
||||
|
||||
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
}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 Verify compliance confirmation process of "
|
||||
msgContentEN = "Please check and address the validation compliance confirmation process of "
|
||||
+ serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
+ " in time.";
|
||||
|
||||
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
@@ -353,7 +376,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap);
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
return new Result<>().success("提醒办理成功!");
|
||||
}
|
||||
@@ -622,10 +645,17 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
|
||||
|
||||
if (StringUtils.equals(msgType, MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())) {
|
||||
msgContentEN = sysUser.getUsername() + "has assigned the design compliance confirmation process of " + serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
+ " to you. Please check and handle it in time.";
|
||||
msgContentEN = sysUser.getUsername() + "has assigned the design compliance confirmation process of " + serialNumber + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " to you. Please check and handle it in time.";
|
||||
}
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
|
||||
//飞书跳转链接
|
||||
@@ -647,7 +677,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap);
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-2
@@ -5,6 +5,7 @@ import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.WebsocketConst;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
@@ -53,7 +54,7 @@ public class SendMessageUtils {
|
||||
SendMessageUtils.webSocket = webSocket;
|
||||
}
|
||||
|
||||
public static void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> sendMessageMap) {
|
||||
public static void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType) {
|
||||
String idTemp = projectLibraryId;
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
@@ -74,7 +75,14 @@ public class SendMessageUtils {
|
||||
|
||||
//飞书消息
|
||||
try {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, MessageTypeEnum.PUSH.getName(), hrefFeishu);
|
||||
if (feishuMsgVo != null){
|
||||
// 补充飞书跳转链接
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setTitle(messageType.getName());
|
||||
iFeishuService.sendCardMsg(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
} else {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, messageType.getName(), hrefFeishu);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user