From c2db893fb898ccf0b66806cecfb7e20c60c91493 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jan 2022 00:35:33 +0800 Subject: [PATCH] =?UTF-8?q?bpm=20=E5=A2=9E=E5=8A=A0=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=A2=AB=E9=80=9A=E8=BF=87=E3=80=81=E4=B8=8D=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=8F=91=E9=80=81=E7=9F=AD=E4=BF=A1=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../convert/message/BpmMessageConvert.java | 18 +++++++++ .../bpm/enums/message/BpmMessageEnum.java | 2 + .../BpmProcessInstanceDeleteReasonEnum.java | 2 +- .../service/message/BpmMessageService.java | 22 +++++++++++ ...eSendWhenProcessInstanceApproveReqDTO.java | 27 +++++++++++++ ...geSendWhenProcessInstanceRejectReqDTO.java | 33 ++++++++++++++++ .../BpmMessageSendWhenTaskCreatedReqDTO.java | 2 +- .../message/impl/BpmMessageServiceImpl.java | 25 +++++++++++- .../task/BpmProcessInstanceService.java | 17 ++++----- .../impl/BpmProcessInstanceServiceImpl.java | 38 ++++++++++++------- .../service/task/impl/BpmTaskServiceImpl.java | 5 +-- 11 files changed, 160 insertions(+), 31 deletions(-) create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceApproveReqDTO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceRejectReqDTO.java diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java index 869f7b741..7d7f1518f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/message/BpmMessageConvert.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.message; +import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO; +import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO; import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO; import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; import org.activiti.api.task.model.Task; @@ -36,4 +38,20 @@ public interface BpmMessageConvert { }) void copyTo(Task task, @MappingTarget BpmMessageSendWhenTaskCreatedReqDTO to); + default BpmMessageSendWhenProcessInstanceRejectReqDTO convert(ProcessInstance processInstance, String comment) { + BpmMessageSendWhenProcessInstanceRejectReqDTO reqDTO = new BpmMessageSendWhenProcessInstanceRejectReqDTO(); + copyTo(processInstance, reqDTO); + reqDTO.setComment(comment); + return reqDTO; + } + @Mapping(source = "name", target = "processInstanceName") + void copyTo(ProcessInstance from, @MappingTarget BpmMessageSendWhenProcessInstanceRejectReqDTO to); + + @Mappings({ + @Mapping(source = "id", target = "processInstanceId"), + @Mapping(source = "name", target = "processInstanceName"), + @Mapping(source = "initiator", target = "startUserId") + }) + BpmMessageSendWhenProcessInstanceApproveReqDTO convert(org.activiti.api.process.model.ProcessInstance processInstance); + } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/message/BpmMessageEnum.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/message/BpmMessageEnum.java index 5632ff47e..79afd41cb 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/message/BpmMessageEnum.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/message/BpmMessageEnum.java @@ -13,6 +13,8 @@ import lombok.Getter; @Getter public enum BpmMessageEnum { + PROCESS_INSTANCE_APPROVE("bpm_process_instance_approve"), // 流程任务被审批通过时,发送给申请人 + PROCESS_INSTANCE_REJECT("bpm_process_instance_reject"), // 流程任务被审批不通过时,发送给申请人 TASK_ASSIGNED("bpm_task_assigned"); // 任务被分配时,发送给审批人 /** diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/task/BpmProcessInstanceDeleteReasonEnum.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/task/BpmProcessInstanceDeleteReasonEnum.java index 2c979ee4b..5032dd857 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/task/BpmProcessInstanceDeleteReasonEnum.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/task/BpmProcessInstanceDeleteReasonEnum.java @@ -12,7 +12,7 @@ import lombok.Getter; @AllArgsConstructor public enum BpmProcessInstanceDeleteReasonEnum { - REJECT_TASK("驳回任务"); + REJECT_TASK("不通过任务,原因:{}"); private final String reason; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/BpmMessageService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/BpmMessageService.java index 43ce86fdb..20a25abe0 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/BpmMessageService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/BpmMessageService.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.message; +import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO; +import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO; import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO; import javax.validation.Valid; @@ -13,6 +15,26 @@ import javax.validation.Valid; */ public interface BpmMessageService { + /** + * 发送流程实例被通过的消息 + * + * @param reqDTO 发送信息 + */ + void sendMessageWhenProcessInstanceApprove(@Valid BpmMessageSendWhenProcessInstanceApproveReqDTO reqDTO); + + + /** + * 发送流程实例被不通过的消息 + * + * @param reqDTO 发送信息 + */ + void sendMessageWhenProcessInstanceReject(@Valid BpmMessageSendWhenProcessInstanceRejectReqDTO reqDTO); + + /** + * 发送任务被分配的消息 + * + * @param reqDTO 发送信息 + */ void sendMessageWhenTaskAssigned(@Valid BpmMessageSendWhenTaskCreatedReqDTO reqDTO); } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceApproveReqDTO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceApproveReqDTO.java new file mode 100644 index 000000000..ca46631f8 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceApproveReqDTO.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * BPM 发送流程实例被通过 Request DTO + */ +@Data +public class BpmMessageSendWhenProcessInstanceApproveReqDTO { + + /** + * 流程实例的编号 + */ + @NotEmpty(message = "流程实例的编号不能为空") + private String processInstanceId; + /** + * 流程实例的名字 + */ + @NotEmpty(message = "流程实例的名字不能为空") + private String processInstanceName; + @NotNull(message = "发起人的用户编号") + private Long startUserId; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceRejectReqDTO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceRejectReqDTO.java new file mode 100644 index 000000000..ae444ad34 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenProcessInstanceRejectReqDTO.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * BPM 发送流程实例被不通过 Request DTO + */ +@Data +public class BpmMessageSendWhenProcessInstanceRejectReqDTO { + + /** + * 流程实例的编号 + */ + @NotEmpty(message = "流程实例的编号不能为空") + private String processInstanceId; + /** + * 流程实例的名字 + */ + @NotEmpty(message = "流程实例的名字不能为空") + private String processInstanceName; + @NotNull(message = "发起人的用户编号") + private Long startUserId; + + /** + * 不通过理由 + */ + @NotEmpty(message = "不通过理由不能为空") + private String comment; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java index a3905e9d2..51d3dc830 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/dto/BpmMessageSendWhenTaskCreatedReqDTO.java @@ -6,7 +6,7 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; /** - * BPM 发送任务创建的 Request DTO + * BPM 发送任务被分配 Request DTO */ @Data public class BpmMessageSendWhenTaskCreatedReqDTO { diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/impl/BpmMessageServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/impl/BpmMessageServiceImpl.java index 20f987c4c..c16fd476f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/impl/BpmMessageServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/message/impl/BpmMessageServiceImpl.java @@ -2,6 +2,8 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.message.impl; import cn.iocoder.yudao.adminserver.modules.bpm.enums.message.BpmMessageEnum; import cn.iocoder.yudao.adminserver.modules.bpm.service.message.BpmMessageService; +import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO; +import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO; import cn.iocoder.yudao.adminserver.modules.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO; import cn.iocoder.yudao.coreservice.modules.system.service.sms.SysSmsCoreService; import lombok.extern.slf4j.Slf4j; @@ -29,18 +31,37 @@ public class BpmMessageServiceImpl implements BpmMessageService { @Value("${yudao.url.admin-ui}") private String adminUiUrl; + @Override + public void sendMessageWhenProcessInstanceApprove(BpmMessageSendWhenProcessInstanceApproveReqDTO reqDTO) { + Map templateParams = new HashMap<>(); + templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); + templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); + smsCoreService.sendSingleSmsToAdmin(null, reqDTO.getStartUserId(), + BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsCode(), templateParams); + } + + @Override + public void sendMessageWhenProcessInstanceReject(BpmMessageSendWhenProcessInstanceRejectReqDTO reqDTO) { + Map templateParams = new HashMap<>(); + templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); + templateParams.put("comment", reqDTO.getComment()); + templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); + smsCoreService.sendSingleSmsToAdmin(null, reqDTO.getStartUserId(), + BpmMessageEnum.PROCESS_INSTANCE_REJECT.getSmsCode(), templateParams); + } + @Override public void sendMessageWhenTaskAssigned(BpmMessageSendWhenTaskCreatedReqDTO reqDTO) { Map templateParams = new HashMap<>(); templateParams.put("processInstanceName", reqDTO.getProcessInstanceName()); templateParams.put("taskName", reqDTO.getTaskName()); templateParams.put("startUserNickname", reqDTO.getStartUserNickname()); - templateParams.put("taskDetailUrl", getTaskDetailUrl(reqDTO.getTaskId())); + templateParams.put("detailUrl", getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId())); smsCoreService.sendSingleSmsToAdmin(null, reqDTO.getAssigneeUserId(), BpmMessageEnum.TASK_ASSIGNED.getSmsCode(), templateParams); } - private String getTaskDetailUrl(String taskId) { + private String getProcessInstanceDetailUrl(String taskId) { return adminUiUrl + "bpm/process-instance/detail?id=" + taskId; } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java index 63ee8c51c..55abbcadd 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmProcessInstanceService.java @@ -46,15 +46,6 @@ public interface BpmProcessInstanceService { @Deprecated void deleteProcessInstance(String id, String reason); - /** - * 更新流程实例的结果 - * 1. 如果更新为已拒绝时,会进行任务的删除 - * - * @param id 流程编号 - * @param result 结果,{@link BpmProcessInstanceResultEnum} - */ - void updateProcessInstanceResult(String id, Integer result); - /** * 获得流程实例的分页 * @@ -153,4 +144,12 @@ public interface BpmProcessInstanceService { */ void updateProcessInstanceExtComplete(org.activiti.api.process.model.ProcessInstance instance); + /** + * 更新 ProcessInstance 拓展记录为不通过 + * + * @param id 流程编号 + * @param comment 理由。例如说,审批不通过时,需要传递该值 + */ + void updateProcessInstanceExtReject(String id, String comment); + } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java index 41d4a28f7..55b66bf85 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java @@ -2,9 +2,9 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.task.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; -import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.instance.*; +import cn.iocoder.yudao.adminserver.modules.bpm.convert.message.BpmMessageConvert; import cn.iocoder.yudao.adminserver.modules.bpm.convert.task.BpmProcessInstanceConvert; import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; @@ -13,6 +13,7 @@ import cn.iocoder.yudao.adminserver.modules.bpm.enums.task.BpmProcessInstanceDel import cn.iocoder.yudao.adminserver.modules.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.adminserver.modules.bpm.enums.task.BpmProcessInstanceStatusEnum; import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; +import cn.iocoder.yudao.adminserver.modules.bpm.service.message.BpmMessageService; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmProcessInstanceService; import cn.iocoder.yudao.adminserver.modules.bpm.service.task.BpmTaskService; import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.dept.SysDeptDO; @@ -28,7 +29,6 @@ import org.activiti.engine.history.HistoricProcessInstance; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; -import org.mapstruct.ap.shaded.freemarker.template.utility.StringUtil; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -72,6 +72,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService private BpmTaskService taskService; @Resource private BpmProcessDefinitionService processDefinitionService; + @Resource + private BpmMessageService messageService; @Resource private BpmProcessInstanceExtMapper processInstanceExtMapper; @@ -132,18 +134,6 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService runtimeService.deleteProcessInstance(id, reason); } - @Override - @Transactional(rollbackFor = Exception.class) - public void updateProcessInstanceResult(String id, Integer result) { - // 删除流程实例,以实现驳回任务时,取消整个审批流程 - if (Objects.equals(result, BpmProcessInstanceResultEnum.REJECT.getResult())) { - deleteProcessInstance(id, BpmProcessInstanceDeleteReasonEnum.REJECT_TASK.getReason()); - } - // 更新 status + result - processInstanceExtMapper.updateByProcessInstanceId(new BpmProcessInstanceExtDO().setProcessInstanceId(id) - .setStatus(BpmProcessInstanceStatusEnum.FINISH.getStatus()).setResult(result)); - } - @Override public PageResult getMyProcessInstancePage(Long userId, BpmProcessInstanceMyPageReqVO pageReqVO) { @@ -251,6 +241,26 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService .setStatus(BpmProcessInstanceStatusEnum.FINISH.getStatus()) .setResult(BpmProcessInstanceResultEnum.APPROVE.getResult()); // 如果正常完全,说明审批通过 processInstanceExtMapper.updateByProcessInstanceId(instanceExtDO); + + // 发送流程被通过的消息 + messageService.sendMessageWhenProcessInstanceApprove(BpmMessageConvert.INSTANCE.convert(instance)); + } + + @Transactional(rollbackFor = Exception.class) + public void updateProcessInstanceExtReject(String id, String comment) { + ProcessInstance processInstance = getProcessInstance(id); + // 删除流程实例,以实现驳回任务时,取消整个审批流程 + deleteProcessInstance(id, StrUtil.format(BpmProcessInstanceDeleteReasonEnum.REJECT_TASK.getReason(), comment)); + + // 更新 status + result + // 注意,不能和上面的逻辑更换位置。因为 deleteProcessInstance 会触发流程的取消,进而调用 updateProcessInstanceExtCancel 方法, + // 设置 result 为 BpmProcessInstanceStatusEnum.CANCEL,显然和 result 不一定是一致的 + processInstanceExtMapper.updateByProcessInstanceId(new BpmProcessInstanceExtDO().setProcessInstanceId(id) + .setStatus(BpmProcessInstanceStatusEnum.FINISH.getStatus()) + .setResult(BpmProcessInstanceResultEnum.REJECT.getResult())); + + // 发送流程被不通过的消息 + messageService.sendMessageWhenProcessInstanceReject(BpmMessageConvert.INSTANCE.convert(processInstance, comment)); } } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java index d9b434673..b9a0ec344 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.task.impl; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.adminserver.modules.bpm.controller.task.vo.task.*; import cn.iocoder.yudao.adminserver.modules.bpm.convert.message.BpmMessageConvert; @@ -38,7 +37,6 @@ import org.springframework.transaction.support.TransactionSynchronizationManager import javax.annotation.Resource; import javax.validation.Valid; import java.util.*; -import java.util.concurrent.TimeUnit; import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -254,8 +252,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { } // 更新流程实例为不通过 - processInstanceService.updateProcessInstanceResult(instance.getProcessInstanceId(), - BpmProcessInstanceResultEnum.REJECT.getResult()); + processInstanceService.updateProcessInstanceExtReject(instance.getProcessInstanceId(), reqVO.getComment()); // 更新任务拓展表为不通过 taskExtMapper.updateByTaskId(new BpmTaskExtDO().setTaskId(task.getId())