fix:即时通消息通知包结构修改
This commit is contained in:
@@ -7,6 +7,7 @@ public enum MessageTemplateEnum {
|
||||
|
||||
TASK_ISSUE("任务通知", "收到一条下发的新任务:%s,请前去[任务管理-我执行的]进行处理"),
|
||||
DATA_ALERT("数据通知", "您的数据存储空间已达阈值,可前往[系统管理-数据存储-存储设置]查看"),
|
||||
APPROVE_ALERT("审批通知", "收到一条%s审批任务代办,请前往任务中心-代办任务-流程任务审批"),
|
||||
HPC_START("作业通知", "作业已发起"),
|
||||
HPC_END("作业通知", "作业已结束")
|
||||
;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.sdm.system.model.thirdparty;
|
||||
package com.sdm.outbridge.mode;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.sdm.system.model.thirdparty;
|
||||
package com.sdm.outbridge.mode;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.sdm.system.service.impl;
|
||||
package com.sdm.outbridge.service.impl.lyric;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
@@ -9,9 +9,9 @@ import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.system.SysUserFeignClientImpl;
|
||||
import com.sdm.common.utils.HttpClientUtil;
|
||||
import com.sdm.system.model.thirdparty.FreeLinkParamDto;
|
||||
import com.sdm.system.model.thirdparty.FreeLinkResp;
|
||||
import com.sdm.system.service.ISimulationExternalService;
|
||||
import com.sdm.outbridge.mode.FreeLinkParamDto;
|
||||
import com.sdm.outbridge.mode.FreeLinkResp;
|
||||
import com.sdm.outbridge.service.lyric.IFreeLinkService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -20,9 +20,9 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SimulationExternalServiceImpl implements ISimulationExternalService {
|
||||
public class FreeLinkServiceImpl implements IFreeLinkService {
|
||||
|
||||
@Value("${thirdparty.api.freeLinkUrl:}")
|
||||
@Value("${freeLinkUrl:}")
|
||||
private String freeLinkUrl;
|
||||
|
||||
@Autowired
|
||||
@@ -1,14 +1,12 @@
|
||||
package com.sdm.system.service;
|
||||
package com.sdm.outbridge.service.lyric;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.SendMsgReq;
|
||||
import com.sdm.system.model.thirdparty.FreeLinkParamDto;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 对接外部第三方系统服务
|
||||
*/
|
||||
public interface ISimulationExternalService {
|
||||
public interface IFreeLinkService {
|
||||
|
||||
SdmResponse syncMsgToFreelink(SendMsgReq req);
|
||||
|
||||
@@ -33,6 +33,9 @@ QUERY_TODO_RESULT_SUFFIX : /todoApi/todo/emulation/dm/result
|
||||
# 查询待办附加url后缀
|
||||
QUERY_TOD_ATTACHMENT_SUFFIX : /todoApi/todo/emulation/dm/attachments
|
||||
|
||||
# 即时通消息通知
|
||||
freeLinkUrl: http://freelink.haihui.com/wechat/InformApi/FreelinkAndDingdingInform
|
||||
|
||||
# 海葵云 数据库连接
|
||||
URL : jdbc:mysql://127.0.0.1:3306/spdm_baseline?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
# 海葵云 数据库用户名
|
||||
|
||||
@@ -645,6 +645,8 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
taskMemberNode.setUserId(userId);
|
||||
taskMemberNode.setType(MemberTypeEnum.EXECUTOR.getCode());
|
||||
projectNodeMemberList.add(taskMemberNode);
|
||||
// 发送消息通知
|
||||
sendMessage(MessageTemplateEnum.TASK_ISSUE, task.getNodeName(), userId);
|
||||
}
|
||||
}
|
||||
List<TaskExtraNode> extraList = task.getExtras();
|
||||
@@ -696,8 +698,6 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
));
|
||||
for (TaskNode taskNode : taskNodeList) {
|
||||
createDir(taskNode.getUuid(), parentUuid, taskNode.getNodeName());
|
||||
// 发送消息通知
|
||||
sendMessage(MessageTemplateEnum.TASK_ISSUE, taskNode.getNodeName(), taskNode.getUuid());
|
||||
}
|
||||
for (TaskNode taskNode : taskNodeList) {
|
||||
// 更新文件权限
|
||||
|
||||
@@ -81,6 +81,20 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--外部系统交互-->
|
||||
<dependency>
|
||||
<groupId>com.sdm</groupId>
|
||||
<artifactId>outbridge</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>*</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"com.sdm.system","com.sdm.common"})
|
||||
@SpringBootApplication(scanBasePackages = {"com.sdm.system","com.sdm.common","com.sdm.outbridge"})
|
||||
@EnableDiscoveryClient
|
||||
@EnableScheduling
|
||||
@EnableFeignClients(basePackages = "com.sdm.common.feign")
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.sdm.system.controller;
|
||||
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.SendMsgReq;
|
||||
import com.sdm.common.feign.inter.system.ISysExternalFeignClient;
|
||||
import com.sdm.system.service.ISimulationExternalService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/external")
|
||||
@Tag(name = "外部第三方接口模块")
|
||||
public class SimulationExternalController implements ISysExternalFeignClient {
|
||||
|
||||
@Autowired
|
||||
private ISimulationExternalService externalService;
|
||||
|
||||
@PostMapping("/syncMessage")
|
||||
public SdmResponse syncMessage(@RequestBody SendMsgReq req) {
|
||||
return externalService.syncMsgToFreelink(req);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,8 +7,10 @@ import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.common.entity.constants.NumberConstants;
|
||||
import com.sdm.common.entity.req.system.FlowStatusParam;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.req.system.SendMsgReq;
|
||||
import com.sdm.common.log.CoreLogger;
|
||||
import com.sdm.common.utils.HttpClientUtil;
|
||||
import com.sdm.outbridge.service.lyric.IFreeLinkService;
|
||||
import com.sdm.system.dao.SimulationApproveMapper;
|
||||
import com.sdm.system.model.entity.ApproveTemplateBean;
|
||||
import com.sdm.system.service.ISimulatinoApprovalService;
|
||||
@@ -63,6 +65,9 @@ public class SimulationApproveServiceImpl implements ISimulatinoApprovalService
|
||||
@Autowired
|
||||
private ApproveNoticeStrategyFactory approveNoticeStrategyFactory;
|
||||
|
||||
@Autowired
|
||||
private IFreeLinkService freeLinkService;
|
||||
|
||||
/**
|
||||
* 向CID发起审批流程
|
||||
* @param flowId
|
||||
@@ -250,6 +255,11 @@ public class SimulationApproveServiceImpl implements ISimulatinoApprovalService
|
||||
else
|
||||
{
|
||||
sdmResponse.setData(cidFlowId);
|
||||
// 同步即时通
|
||||
SendMsgReq req = new SendMsgReq();
|
||||
req.setUserId(String.valueOf(flowBean.userId));
|
||||
req.setContent("收到一条审批消息");
|
||||
SdmResponse response = freeLinkService.syncMsgToFreelink(req);
|
||||
}
|
||||
}
|
||||
return sdmResponse;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.SendMsgReq;
|
||||
import com.sdm.common.utils.HttpClientUtil;
|
||||
import com.sdm.system.service.ISimulationExternalService;
|
||||
import com.sdm.outbridge.service.lyric.IFreeLinkService;
|
||||
import com.sdm.system.service.ISimulationMessageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -27,7 +27,7 @@ public class SimulationMessageServiceImpl implements ISimulationMessageService {
|
||||
private HttpClientUtil httpClientUtil;
|
||||
|
||||
@Autowired
|
||||
private ISimulationExternalService externalService;
|
||||
private IFreeLinkService freeLinkService;
|
||||
|
||||
@Override
|
||||
public SdmResponse sendMessage(SendMsgReq req) {
|
||||
@@ -38,10 +38,10 @@ public class SimulationMessageServiceImpl implements ISimulationMessageService {
|
||||
SdmResponse response = JSON.parseObject(resultString, SdmResponse.class);
|
||||
if (response.isSuccess()) {
|
||||
// 同步即时通
|
||||
SdmResponse sdmResponse = externalService.syncMsgToFreelink(req);
|
||||
if (!sdmResponse.isSuccess()) {
|
||||
return sdmResponse;
|
||||
}
|
||||
SdmResponse sdmResponse = freeLinkService.syncMsgToFreelink(req);
|
||||
// if (!sdmResponse.isSuccess()) {
|
||||
// return sdmResponse;
|
||||
// }
|
||||
return response;
|
||||
}
|
||||
return SdmResponse.failed("发送消息通知失败:");
|
||||
|
||||
Reference in New Issue
Block a user