feat:任务下发发送消息通知&流程节点返回详细信息

This commit is contained in:
2025-12-04 14:47:37 +08:00
parent 3755778972
commit d6ee86d2c5
5 changed files with 95 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
package com.sdm.common.entity.enums;
/**
* 消息通知模板枚举
*/
public enum MessageTemplateEnum {
TASK_ISSUE("任务通知", "收到一条下发的新任务:%s请前去[任务管理-我执行的]进行处理"),
HPC_START("作业通知", "作业已发起"),
HPC_END("作业通知", "作业已结束")
;
private final String title;
private final String content;
MessageTemplateEnum(String title, String content) {
this.title = title;
this.content = content;
}
public String getTitle() {
return title;
}
public String getContent() {
return content;
}
/**
* 获取模板内容(含参数替换)
*/
public String getContent(String taskName) {
return String.format(content, taskName);
}
}

View File

@@ -1,6 +1,7 @@
package com.sdm.common.entity.req.capability;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sdm.common.entity.flowable.dto.NodeDetailInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -59,4 +60,7 @@ public class FlowNodeDto {
private LocalDateTime updateTime;
private List<FlowNodeDto> flowNodeDtoList;
@Schema(description = "节点详细信息 来自flowable")
private NodeDetailInfo nodeDetailInfo;
}

View File

@@ -0,0 +1,36 @@
package com.sdm.common.feign.impl.system;
import com.alibaba.fastjson2.JSONObject;
import com.sdm.common.common.SdmResponse;
import com.sdm.common.entity.req.system.SendMsgReq;
import com.sdm.common.feign.inter.system.IMessageFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Optional;
@Slf4j
@Component
public class MessageFeignClientImpl implements IMessageFeignClient {
@Autowired
private IMessageFeignClient messageFeignClient;
@Override
public SdmResponse sendMessage(SendMsgReq req) {
SdmResponse response=null ;
try {
response = messageFeignClient.sendMessage(req);
if(response==null || !response.isSuccess()){
log.error("sendMessage failed response:{}", JSONObject.toJSONString(Optional.ofNullable(response)));
return SdmResponse.failed("发送消息通知失败");
}
} catch (Exception e) {
log.error("sendMessage error response:{}", JSONObject.toJSONString(Optional.ofNullable(response)));
return SdmResponse.failed("发送消息通知异常");
}
return response;
}
}