Commit ebd722cb4162da1c2160661ead9589cda508d55b
1 parent
c16f7b81
review: 修改获取下一个执行的流程节点接口地址和方法
Showing
3 changed files
with
17 additions
and
17 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java
| ... | ... | @@ -172,21 +172,22 @@ public class BpmProcessInstanceController { |
| 172 | 172 | return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO)); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - @GetMapping("/get-bpmn-model-view") | |
| 176 | - @Operation(summary = "获取流程实例的 BPMN 模型视图", description = "在【流程详细】界面中,进行调用") | |
| 177 | - @Parameter(name = "id", description = "流程实例的编号", required = true) | |
| 178 | - public CommonResult<BpmProcessInstanceBpmnModelViewRespVO> getProcessInstanceBpmnModelView(@RequestParam(value = "id") String id) { | |
| 179 | - return success(processInstanceService.getProcessInstanceBpmnModelView(id)); | |
| 180 | - } | |
| 181 | - | |
| 182 | - @GetMapping("/get-next-flow-nodes") | |
| 175 | + @GetMapping("/get-next-approval-nodes") | |
| 183 | 176 | @Operation(summary = "获取下一个执行的流程节点") |
| 184 | 177 | @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") |
| 185 | 178 | @SuppressWarnings("unchecked") |
| 186 | - public CommonResult<List<BpmApprovalDetailRespVO.ActivityNode>> getNextFlowNodes(@Valid BpmApprovalDetailReqVO reqVO) { | |
| 179 | + public CommonResult<List<BpmApprovalDetailRespVO.ActivityNode>> getNextApprovalNodes(@Valid BpmApprovalDetailReqVO reqVO) { | |
| 187 | 180 | if (StrUtil.isNotEmpty(reqVO.getProcessVariablesStr())) { |
| 188 | 181 | reqVO.setProcessVariables(JsonUtils.parseObject(reqVO.getProcessVariablesStr(), Map.class)); |
| 189 | 182 | } |
| 190 | - return success(processInstanceService.getNextFlowNodes(getLoginUserId(), reqVO)); | |
| 183 | + return success(processInstanceService.getNextApprovalNodes(getLoginUserId(), reqVO)); | |
| 191 | 184 | } |
| 185 | + | |
| 186 | + @GetMapping("/get-bpmn-model-view") | |
| 187 | + @Operation(summary = "获取流程实例的 BPMN 模型视图", description = "在【流程详细】界面中,进行调用") | |
| 188 | + @Parameter(name = "id", description = "流程实例的编号", required = true) | |
| 189 | + public CommonResult<BpmProcessInstanceBpmnModelViewRespVO> getProcessInstanceBpmnModelView(@RequestParam(value = "id") String id) { | |
| 190 | + return success(processInstanceService.getProcessInstanceBpmnModelView(id)); | |
| 191 | + } | |
| 192 | + | |
| 192 | 193 | } | ... | ... |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceService.java
| ... | ... | @@ -104,7 +104,7 @@ public interface BpmProcessInstanceService { |
| 104 | 104 | * @param reqVO 请求信息 |
| 105 | 105 | * @return 下一个执行节点信息 |
| 106 | 106 | */ |
| 107 | - List<BpmApprovalDetailRespVO.ActivityNode> getNextFlowNodes(Long loginUserId, @Valid BpmApprovalDetailReqVO reqVO); | |
| 107 | + List<BpmApprovalDetailRespVO.ActivityNode> getNextApprovalNodes(Long loginUserId, @Valid BpmApprovalDetailReqVO reqVO); | |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * 获取流程实例的 BPMN 模型视图 | ... | ... |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
| ... | ... | @@ -231,7 +231,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | @Override |
| 234 | - public List<ActivityNode> getNextFlowNodes(Long loginUserId, BpmApprovalDetailReqVO reqVO) { | |
| 234 | + public List<ActivityNode> getNextApprovalNodes(Long loginUserId, BpmApprovalDetailReqVO reqVO) { | |
| 235 | 235 | // 1.1 校验任务存在 |
| 236 | 236 | Task task = taskService.getTask(reqVO.getTaskId()); |
| 237 | 237 | if (task == null) { |
| ... | ... | @@ -755,9 +755,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 755 | 755 | // 设置流程变量,发起人自选审批人 |
| 756 | 756 | variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES, |
| 757 | 757 | startUserSelectAssignees); |
| 758 | - // 设置流程变量,审批人自选审批人 | |
| 759 | - variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES, | |
| 760 | - startUserSelectAssignees); | |
| 758 | +// // 设置流程变量,审批人自选审批人 | |
| 759 | +// variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES, | |
| 760 | +// startUserSelectAssignees); | |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | // 3. 创建流程 |
| ... | ... | @@ -801,8 +801,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 801 | 801 | |
| 802 | 802 | // 2.1 移除掉不是发起人或者审批人自选审批人节点 |
| 803 | 803 | activityNodes.removeIf(task -> |
| 804 | - ObjectUtil.notEqual(BpmTaskCandidateStrategyEnum.START_USER_SELECT.getStrategy(), task.getCandidateStrategy()) | |
| 805 | - && ObjectUtil.notEqual(BpmTaskCandidateStrategyEnum.APPROVE_USER_SELECT.getStrategy(), task.getCandidateStrategy())); | |
| 804 | + ObjectUtil.notEqual(BpmTaskCandidateStrategyEnum.START_USER_SELECT.getStrategy(), task.getCandidateStrategy())); | |
| 806 | 805 | // 2.2 流程发起时要先获取当前流程的预测走向节点,发起时只校验预测的节点发起人自选审批人的审批人和抄送人是否都配置了 |
| 807 | 806 | activityNodes.forEach(task -> { |
| 808 | 807 | List<Long> assignees = startUserSelectAssignees != null ? startUserSelectAssignees.get(task.getId()) : null; | ... | ... |