工作流消息通知集成
This commit is contained in:
parent
702e8b0427
commit
9165ca7baa
2
pom.xml
2
pom.xml
|
@ -17,7 +17,7 @@
|
|||
<module>yudao-module-infra</module>
|
||||
<module>yudao-module-fta</module>
|
||||
<!-- <module>yudao-module-member</module>-->
|
||||
<!-- <module>yudao-module-bpm</module>-->
|
||||
<module>yudao-module-bpm</module>
|
||||
<!-- <module>yudao-module-report</module>-->
|
||||
<!-- <module>yudao-module-mp</module>-->
|
||||
<!-- <module>yudao-module-pay</module>-->
|
||||
|
|
|
@ -6,6 +6,8 @@ import cn.iocoder.yudao.module.bpm.enums.message.BpmMessageEnum;
|
|||
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.sms.SmsSendApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -31,13 +33,17 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|||
@Resource
|
||||
private WebProperties webProperties;
|
||||
|
||||
@Resource
|
||||
private NotifyMessageSendApi notifySendApi;
|
||||
|
||||
@Override
|
||||
public void sendMessageWhenProcessInstanceApprove(BpmMessageSendWhenProcessInstanceApproveReqDTO reqDTO) {
|
||||
Map<String, Object> templateParams = new HashMap<>();
|
||||
templateParams.put("processInstanceName", reqDTO.getProcessInstanceName());
|
||||
templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId()));
|
||||
smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(),
|
||||
BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsTemplateCode(), templateParams));
|
||||
String templateCode = "fta_workflow_task_pass";
|
||||
notifySendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO().setUserId(reqDTO.getStartUserId())
|
||||
.setTemplateCode(templateCode).setTemplateParams(templateParams));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,19 +52,20 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|||
templateParams.put("processInstanceName", reqDTO.getProcessInstanceName());
|
||||
templateParams.put("reason", reqDTO.getReason());
|
||||
templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId()));
|
||||
smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(),
|
||||
BpmMessageEnum.PROCESS_INSTANCE_REJECT.getSmsTemplateCode(), templateParams));
|
||||
String templateCode = "fta_workflow_task_not_pass";
|
||||
notifySendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO().setUserId(reqDTO.getStartUserId())
|
||||
.setTemplateCode(templateCode).setTemplateParams(templateParams));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageWhenTaskAssigned(BpmMessageSendWhenTaskCreatedReqDTO reqDTO) {
|
||||
Map<String, Object> templateParams = new HashMap<>();
|
||||
Map<String,Object> templateParams = new HashMap<String,Object>();
|
||||
templateParams.put("processInstanceName", reqDTO.getProcessInstanceName());
|
||||
templateParams.put("startUserNickname",reqDTO.getStartUserNickname());
|
||||
templateParams.put("taskName", reqDTO.getTaskName());
|
||||
templateParams.put("startUserNickname", reqDTO.getStartUserNickname());
|
||||
templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId()));
|
||||
smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getAssigneeUserId(),
|
||||
BpmMessageEnum.TASK_ASSIGNED.getSmsTemplateCode(), templateParams));
|
||||
String templateCode = "fta_workflow_task";
|
||||
notifySendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO().setUserId(reqDTO.getAssigneeUserId())
|
||||
.setTemplateCode(templateCode).setTemplateParams(templateParams));
|
||||
}
|
||||
|
||||
private String getProcessInstanceDetailUrl(String taskId) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.module.fta.controller.admin.enterpriseinformation.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
|
|
@ -79,4 +79,12 @@ public class EnterpriseInformationRespVO {
|
|||
@ExcelProperty("经营许可范围")
|
||||
private String operatePermitRange;
|
||||
|
||||
@Schema(description = "审批结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelIgnore
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "流程编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelIgnore
|
||||
private String processInstanceId;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue