fix(bpm):优化流程实例取消逻辑

- 当流程实例不存在时,通过历史表查询并更新状态
- 增加对已删除流程实例的处理,确保审批状态正确修改-保留原有权限校验逻辑,确保只能取消自己的流程实例- 引入 FlowableEventType 用于事件处理
- 移除冗余的事务注解,简化代码结构
This commit is contained in:
2025-11-13 10:35:14 +08:00
parent 114f37fc99
commit b0edcc4fee
2 changed files with 10 additions and 16 deletions

View File

@@ -1,12 +1,9 @@
package com.jeelowcode.service.bpm.controller; package com.jeelowcode.service.bpm.controller;
import com.jeelowcode.core.framework.controller.BaseController; import com.jeelowcode.core.framework.controller.BaseController;
import com.jeelowcode.core.framework.enums.ApproveStatusEnum;
import com.jeelowcode.framework.utils.model.ResultDataModel; import com.jeelowcode.framework.utils.model.ResultDataModel;
import com.jeelowcode.framework.utils.tool.CollectionUtil;
import com.jeelowcode.framework.utils.tool.NumberUtil; import com.jeelowcode.framework.utils.tool.NumberUtil;
import com.jeelowcode.service.bpm.controller.vo.instance.*; import com.jeelowcode.service.bpm.controller.vo.instance.*;
import com.jeelowcode.service.bpm.controller.vo.process.BpmProcessDefinitionRespVO;
import com.jeelowcode.service.bpm.service.IBpmProcessInstanceService; import com.jeelowcode.service.bpm.service.IBpmProcessInstanceService;
import com.jeelowcode.tool.framework.common.pojo.CommonResult; import com.jeelowcode.tool.framework.common.pojo.CommonResult;
import com.jeelowcode.tool.framework.common.pojo.PageResult; import com.jeelowcode.tool.framework.common.pojo.PageResult;
@@ -19,9 +16,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Objects; import java.util.Objects;
import static com.jeelowcode.tool.framework.common.pojo.CommonResult.success; import static com.jeelowcode.tool.framework.common.pojo.CommonResult.success;
@@ -65,7 +60,6 @@ public class BpmProcessInstanceController extends BaseController {
} }
@PostMapping("/createV2") @PostMapping("/createV2")
@Operation(tags = "流程管理", summary = "新建流程实例(自定义流程发起使用)") @Operation(tags = "流程管理", summary = "新建流程实例(自定义流程发起使用)")
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")