@@ -0,0 +1,21 @@ | |||||
package com.hz.pm.api.common.model.dingtalk; | |||||
import lombok.Data; | |||||
/** | |||||
* <p> | |||||
* AbstractDingTalkMsg | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 19:31 2023/3/14 | |||||
*/ | |||||
@Data | |||||
public abstract class AbstractDingTalkMsg { | |||||
/** | |||||
* msgtype:消息类型 | |||||
*/ | |||||
private String msgtype; | |||||
} |
@@ -0,0 +1,41 @@ | |||||
package com.hz.pm.api.common.model.dingtalk; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.NoArgsConstructor; | |||||
/** | |||||
* <p> | |||||
* DingTalkMarkdownPo | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 13:01 2022/11/7 | |||||
*/ | |||||
@Data | |||||
@NoArgsConstructor | |||||
@EqualsAndHashCode(callSuper = true) | |||||
public class DingTalkMarkdownMsgDTO extends AbstractDingTalkMsg { | |||||
/** | |||||
* markdown | |||||
*/ | |||||
private MarkdownDTO markdown; | |||||
/** | |||||
* MarkdownDTO | |||||
*/ | |||||
@Data | |||||
@NoArgsConstructor | |||||
public static class MarkdownDTO { | |||||
/** | |||||
* title | |||||
*/ | |||||
private String title; | |||||
/** | |||||
* text | |||||
*/ | |||||
private String text; | |||||
} | |||||
} |
@@ -0,0 +1,48 @@ | |||||
package com.hz.pm.api.common.util; | |||||
import cn.hutool.http.HttpRequest; | |||||
import cn.hutool.http.HttpResponse; | |||||
import cn.hutool.http.HttpUtil; | |||||
import cn.hutool.json.JSONUtil; | |||||
import com.hz.pm.api.common.model.dingtalk.DingTalkMarkdownMsgDTO; | |||||
import com.hz.pm.api.common.model.dingtalk.DingTalkMarkdownMsgDTO.MarkdownDTO; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
/** | |||||
* <p> | |||||
* DIngTalkMsgClient | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 09:38 2024/10/21 | |||||
*/ | |||||
@Slf4j | |||||
public class DingTalkMsgClient { | |||||
private DingTalkMsgClient() { | |||||
} | |||||
private static final String WEB_HOOK = "https://oapi.dingtalk.com/robot/send?access_token=176a8522d9662b231f873f68725e973762d600245ce5fd5ece8ced1be7a6111c"; | |||||
public static void send(String receiver, String content, Object extraParam) { | |||||
HttpRequest request = HttpUtil.createPost(WEB_HOOK); | |||||
DingTalkMarkdownMsgDTO msg = new DingTalkMarkdownMsgDTO(); | |||||
MarkdownDTO markdown = new MarkdownDTO(); | |||||
markdown.setTitle("模拟待办发送"); | |||||
StringBuilder msgObj = new StringBuilder() | |||||
.append("#### 接收人\n") | |||||
.append(receiver) | |||||
.append("\n#### 待办或提醒内容") | |||||
.append("\n").append(content) | |||||
.append("\n#### 拓展参数") | |||||
.append(JSONUtil.toJsonStr(extraParam)); | |||||
markdown.setText(JSONUtil.toJsonStr(msgObj)); | |||||
msg.setMarkdown(markdown); | |||||
msg.setMsgtype("markdown"); | |||||
request.body(JSONUtil.toJsonStr(msg)); | |||||
try (HttpResponse response = request.executeAsync()) { | |||||
log.info("模拟待办发送:{}", response); | |||||
} | |||||
} | |||||
} |
@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil; | |||||
import cn.hutool.http.HttpUtil; | import cn.hutool.http.HttpUtil; | ||||
import cn.hutool.json.JSONObject; | import cn.hutool.json.JSONObject; | ||||
import cn.hutool.json.JSONUtil; | import cn.hutool.json.JSONUtil; | ||||
import com.hz.pm.api.common.util.DingTalkMsgClient; | |||||
import com.hz.pm.api.common.util.EnvironmentUtil; | import com.hz.pm.api.common.util.EnvironmentUtil; | ||||
import com.hz.pm.api.external.model.dto.*; | import com.hz.pm.api.external.model.dto.*; | ||||
import com.hz.pm.api.external.model.enumeration.MhDictType; | import com.hz.pm.api.external.model.enumeration.MhDictType; | ||||
@@ -134,6 +135,7 @@ public class MhApiClient { | |||||
public boolean sendZwddWorkNotice(MhZwddWorkNoticeDTO notice) { | public boolean sendZwddWorkNotice(MhZwddWorkNoticeDTO notice) { | ||||
log.info("发送浙政钉工作通知:{}", notice); | log.info("发送浙政钉工作通知:{}", notice); | ||||
if (environmentUtil.isDevEnv()) { | if (environmentUtil.isDevEnv()) { | ||||
DingTalkMsgClient.send(notice.getTargetUserName(), notice.getContent(), null); | |||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
notice.setClientId(zwddWorkNoticeClientId); | notice.setClientId(zwddWorkNoticeClientId); | ||||
@@ -38,5 +38,6 @@ public class MhZwddWorkNoticeDTO { | |||||
*/ | */ | ||||
private String targetUser; | private String targetUser; | ||||
private transient String targetUserName; | |||||
} | } |
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.TypeReference; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.hz.pm.api.common.util.DingTalkMsgClient; | |||||
import com.hz.pm.api.common.util.EnvironmentUtil; | import com.hz.pm.api.common.util.EnvironmentUtil; | ||||
import com.hz.pm.api.external.todo.dto.MhTodoRequestDTO; | import com.hz.pm.api.external.todo.dto.MhTodoRequestDTO; | ||||
import com.hz.pm.api.external.todo.dto.MhTodoRetDTO; | import com.hz.pm.api.external.todo.dto.MhTodoRetDTO; | ||||
@@ -77,6 +78,7 @@ public class MHTodoClient { | |||||
.build(); | .build(); | ||||
log.info("发送信产待办:{}", todoReq); | log.info("发送信产待办:{}", todoReq); | ||||
if (environmentUtil.isDevEnv()) { | if (environmentUtil.isDevEnv()) { | ||||
DingTalkMsgClient.send(receiver.getUsername(), content,paramObjs); | |||||
return; | return; | ||||
} | } | ||||
String url = mhApiHost + TODO_ADD; | String url = mhApiHost + TODO_ADD; | ||||
@@ -18,30 +18,64 @@ public enum MHTodoTypeEnum { | |||||
SELF_TEST_APPLY("系统自测", null, | SELF_TEST_APPLY("系统自测", null, | ||||
"您单位的【%s】开工文件备案已通过,可在过程管理-适配改造中进行提交系统自测信息的操作。", | "您单位的【%s】开工文件备案已通过,可在过程管理-适配改造中进行提交系统自测信息的操作。", | ||||
"【%s】系统自测信息需要您处理,请及时处理", null, null), | |||||
TEST_VALID_APPLY("监理核实验证", null, "您单位的【%s】系统自测备案已通过,可在过程管理-适配改造中进行填写监理核实验证信息的操作。", | |||||
"【%s】监理核实验证需要您处理,请及时处理", null, null), | |||||
FINAL_INSPECT_APPLY("终验申请", null, "您单位的【%s】已完成初验备案,可在过程管理-终验申请中进行终验申请的操作。", | |||||
"【%s】终验申请需要您处理,请及时处理", null, null), | |||||
ADAPTION_APPLY("上传开工文件", null, "您单位的【%s】已完成实施计划填写,可在过程管理-适配改造中进行上传开工文件的操作。", | |||||
"【%s】上传开工文件需要您处理,请及时处理", null, null), | |||||
PROJECT_REVIEW_APPLY("项目复核", null, "您单位的【%s】的专家评审已通过,可在过程管理-项目评审-项目复核中进行提交复核的操作。", | |||||
"【%s】项目复核需要您处理,请及时处理", null, null), | |||||
WITHOUT_BUILD_SCHEME("上传建设方案盖章件", null, "您单位的【%s】的合规性审査已通过,可在过程管理-项目评审-专家评审中进行上传建设方案盖章件的操作。", | |||||
"【%s】上传建设方案盖章件需要您处理,请及时处理", null, null), | |||||
WITHOUT_PURCHASE_NOTICE("发布采购公告", null, "您单位的【%s】立项备案已通过,可在过程管理-招标采购中进行发布采购公告的操作。", | |||||
"【%s】发布采购公告需要您处理,请及时处理", null, null), | |||||
WITHOUT_PURCHASE_CONTRACT("采购&合同信息备案", null, "您单位的【%s】已完成发布采购公告,可在过程管理-招标采购中进行采购&合同信息备案的操作。", | |||||
"【%s】采购&合同信息备案需要您处理,请及时处理", null, null), | |||||
WITHOUT_OPERATION_PLAN("实施计划填写", null, "您单位的【%s】已完成采购&合同信息备案,可在过程管理-适配改造中进行填写实施计划的操作。", | |||||
"【%s】实施计划需要您处理,请及时处理", null, null), | |||||
WITHOUT_FIRST_ACCEPT_RECORD("初验备案", null, "您单位的【%s】已完成适配改造,可在过程管理-初验申请中进行初验备案的操作。", | |||||
"【%s】初验备案需要您处理,请及时处理", null, null), | |||||
WITHOUT_ORG_CONFIRM("单位确认", null, "您单位的【%s】监理核实验证备案已通过,可在过程管理-适配改造中进行单位确认的操作。", | |||||
"【%s】单位确认需要您处理,请及时处理", null, null), | |||||
DECLARED_RECORD_APPLY("立项备案申请", null, "您单位的【%s】已下达资金,可在过程管理-项目立项中进行立项备案的操作。", | |||||
"【%s】立项备案需要您处理,请及时处理", null, | |||||
"mhProjectId=${mhProjectId}&status=${status}&projectCode=${projectCode}&projectId=${projectId}&userId=${userId}&userName=${userName}&path=${path}"), | |||||
"【%s】系统自测信息需要您处理,请及时处理", | |||||
"/declareManage/projectManages/adaptiveTransformation", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=1100"), | |||||
TEST_VALID_APPLY("监理核实验证", null, | |||||
"您单位的【%s】系统自测备案已通过,可在过程管理-适配改造中进行填写监理核实验证信息的操作。", | |||||
"【%s】监理核实验证需要您处理,请及时处理", | |||||
"/declareManage/projectManages/adaptiveTransformation", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=3100"), | |||||
FINAL_INSPECT_APPLY("终验申请", null, | |||||
"您单位的【%s】已完成初验备案,可在过程管理-终验申请中进行终验申请的操作。", | |||||
"【%s】终验申请需要您处理,请及时处理", | |||||
"/declareManage/projectManages/finalInspectionDeclare", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=401"), | |||||
ADAPTION_APPLY("上传开工文件", null, | |||||
"您单位的【%s】已完成实施计划填写,可在过程管理-适配改造中进行上传开工文件的操作。", | |||||
"【%s】上传开工文件需要您处理,请及时处理", | |||||
"/declareManage/projectManages/adaptiveTransformation", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=2100"), | |||||
PROJECT_REVIEW_APPLY("项目复核", null, | |||||
"您单位的【%s】的专家评审已通过,可在过程管理-项目评审-项目复核中进行提交复核的操作。", | |||||
"【%s】项目复核需要您处理,请及时处理", | |||||
"/declareManage/projectManages/projectRecheck", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=10040"), | |||||
WITHOUT_BUILD_SCHEME("上传建设方案盖章件", null, | |||||
"您单位的【%s】的合规性审査已通过,可在过程管理-项目评审-专家评审中进行上传建设方案盖章件的操作。", | |||||
"【%s】上传建设方案盖章件需要您处理,请及时处理", | |||||
"/declareManage/projectManages/expertReview", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=10050"), | |||||
WITHOUT_PURCHASE_NOTICE("发布采购公告", null, | |||||
"您单位的【%s】立项备案已通过,可在过程管理-招标采购中进行发布采购公告的操作。", | |||||
"【%s】发布采购公告需要您处理,请及时处理", | |||||
"/declareManage/projectManages/purchaseResults", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=20001"), | |||||
WITHOUT_PURCHASE_CONTRACT("采购&合同信息备案", null, | |||||
"您单位的【%s】已完成发布采购公告,可在过程管理-招标采购中进行采购&合同信息备案的操作。", | |||||
"【%s】采购&合同信息备案需要您处理,请及时处理", | |||||
"/declareManage/projectManages/purchaseResults", | |||||
"/instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=101"), | |||||
WITHOUT_OPERATION_PLAN("实施计划填写", null, | |||||
"您单位的【%s】已完成采购&合同信息备案,可在过程管理-适配改造中进行填写实施计划的操作。", | |||||
"【%s】实施计划需要您处理,请及时处理", | |||||
"/declareManage/projectManages/adaptiveTransformation", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=103"), | |||||
WITHOUT_FIRST_ACCEPT_RECORD("初验备案", null, | |||||
"您单位的【%s】已完成适配改造,可在过程管理-初验申请中进行初验备案的操作。", | |||||
"【%s】初验备案需要您处理,请及时处理", | |||||
"/declareManage/projectManages/initialInspectionRecord", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=201"), | |||||
WITHOUT_ORG_CONFIRM("单位确认", null, | |||||
"您单位的【%s】监理核实验证备案已通过,可在过程管理-适配改造中进行单位确认的操作。", | |||||
"【%s】单位确认需要您处理,请及时处理", | |||||
"/declareManage/projectManages/adaptiveTransformation", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=104"), | |||||
DECLARED_RECORD_APPLY("立项备案申请", null, | |||||
"您单位的【%s】已下达资金,可在过程管理-项目立项中进行立项备案的操作。", | |||||
"【%s】立项备案需要您处理,请及时处理", | |||||
"/declareManage/projectManages/projectFiling", | |||||
"instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&activeName=10022"), | |||||
/** | /** | ||||
* 流程审批待办 | * 流程审批待办 | ||||
*/ | */ | ||||
@@ -70,6 +70,7 @@ public class MhTodoSendListener { | |||||
MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | ||||
.content(zwddMsg) | .content(zwddMsg) | ||||
.title(nextStep.getVal()) | .title(nextStep.getVal()) | ||||
.targetUserName(user.getRealName()) | |||||
.targetUser(user.getMhUserId()) | .targetUser(user.getMhUserId()) | ||||
.build(); | .build(); | ||||
mhApiClient.sendZwddWorkNotice(notice); | mhApiClient.sendZwddWorkNotice(notice); | ||||
@@ -176,6 +176,7 @@ public class UserTaskCreateOrFinishListener { | |||||
MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | ||||
.content(zzdContent) | .content(zzdContent) | ||||
.title(todoType.getVal()) | .title(todoType.getVal()) | ||||
.targetUserName(assignee.getRealName()) | |||||
.targetUser(assignee.getMhUserId()) | .targetUser(assignee.getMhUserId()) | ||||
.build(); | .build(); | ||||
mhApiClient.sendZwddWorkNotice(notice); | mhApiClient.sendZwddWorkNotice(notice); | ||||
@@ -250,6 +251,7 @@ public class UserTaskCreateOrFinishListener { | |||||
MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | ||||
.content(zzdContent) | .content(zzdContent) | ||||
.title(todoType.getVal()) | .title(todoType.getVal()) | ||||
.targetUserName(userFullInfo.getRealName()) | |||||
.targetUser(userFullInfo.getMhUserId()) | .targetUser(userFullInfo.getMhUserId()) | ||||
.build(); | .build(); | ||||
mhApiClient.sendZwddWorkNotice(notice); | mhApiClient.sendZwddWorkNotice(notice); | ||||
@@ -271,6 +273,7 @@ public class UserTaskCreateOrFinishListener { | |||||
MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | ||||
.content(zwddMsg) | .content(zwddMsg) | ||||
.title(nextStep.getVal()) | .title(nextStep.getVal()) | ||||
.targetUserName(userFullInfo.getRealName()) | |||||
.targetUser(userFullInfo.getMhUserId()) | .targetUser(userFullInfo.getMhUserId()) | ||||
.build(); | .build(); | ||||
mhApiClient.sendZwddWorkNotice(notice); | mhApiClient.sendZwddWorkNotice(notice); | ||||
@@ -132,6 +132,7 @@ public class DeclaredRecordReminderTask extends AbstractReminderTask { | |||||
MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | ||||
.title(DECLARED_RECORD_APPLY.getVal()) | .title(DECLARED_RECORD_APPLY.getVal()) | ||||
.content(content) | .content(content) | ||||
.targetUserName(user.getRealName()) | |||||
.targetUser(user.getMhUserId()) | .targetUser(user.getMhUserId()) | ||||
.build(); | .build(); | ||||
mhApiClient.sendZwddWorkNotice(notice); | mhApiClient.sendZwddWorkNotice(notice); | ||||
@@ -219,7 +219,7 @@ agent-login: | |||||
# 提醒任务 | # 提醒任务 | ||||
reminder-task: | reminder-task: | ||||
declared-record: | declared-record: | ||||
open: true | |||||
open: false | |||||
cron: 0 30 8 * * ? | cron: 0 30 8 * * ? | ||||
# 电话服务调用地址 | # 电话服务调用地址 | ||||
mobile-call: | mobile-call: | ||||