review: 修改获取下一个执行的流程节点接口地址和方法
This commit is contained in:
parent
c16f7b8154
commit
ebd722cb41
|
@ -172,6 +172,17 @@ public class BpmProcessInstanceController {
|
||||||
return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO));
|
return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get-next-approval-nodes")
|
||||||
|
@Operation(summary = "获取下一个执行的流程节点")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public CommonResult<List<BpmApprovalDetailRespVO.ActivityNode>> getNextApprovalNodes(@Valid BpmApprovalDetailReqVO reqVO) {
|
||||||
|
if (StrUtil.isNotEmpty(reqVO.getProcessVariablesStr())) {
|
||||||
|
reqVO.setProcessVariables(JsonUtils.parseObject(reqVO.getProcessVariablesStr(), Map.class));
|
||||||
|
}
|
||||||
|
return success(processInstanceService.getNextApprovalNodes(getLoginUserId(), reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/get-bpmn-model-view")
|
@GetMapping("/get-bpmn-model-view")
|
||||||
@Operation(summary = "获取流程实例的 BPMN 模型视图", description = "在【流程详细】界面中,进行调用")
|
@Operation(summary = "获取流程实例的 BPMN 模型视图", description = "在【流程详细】界面中,进行调用")
|
||||||
@Parameter(name = "id", description = "流程实例的编号", required = true)
|
@Parameter(name = "id", description = "流程实例的编号", required = true)
|
||||||
|
@ -179,14 +190,4 @@ public class BpmProcessInstanceController {
|
||||||
return success(processInstanceService.getProcessInstanceBpmnModelView(id));
|
return success(processInstanceService.getProcessInstanceBpmnModelView(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get-next-flow-nodes")
|
|
||||||
@Operation(summary = "获取下一个执行的流程节点")
|
|
||||||
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public CommonResult<List<BpmApprovalDetailRespVO.ActivityNode>> getNextFlowNodes(@Valid BpmApprovalDetailReqVO reqVO) {
|
|
||||||
if (StrUtil.isNotEmpty(reqVO.getProcessVariablesStr())) {
|
|
||||||
reqVO.setProcessVariables(JsonUtils.parseObject(reqVO.getProcessVariablesStr(), Map.class));
|
|
||||||
}
|
|
||||||
return success(processInstanceService.getNextFlowNodes(getLoginUserId(), reqVO));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ public interface BpmProcessInstanceService {
|
||||||
* @param reqVO 请求信息
|
* @param reqVO 请求信息
|
||||||
* @return 下一个执行节点信息
|
* @return 下一个执行节点信息
|
||||||
*/
|
*/
|
||||||
List<BpmApprovalDetailRespVO.ActivityNode> getNextFlowNodes(Long loginUserId, @Valid BpmApprovalDetailReqVO reqVO);
|
List<BpmApprovalDetailRespVO.ActivityNode> getNextApprovalNodes(Long loginUserId, @Valid BpmApprovalDetailReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取流程实例的 BPMN 模型视图
|
* 获取流程实例的 BPMN 模型视图
|
||||||
|
|
|
@ -231,7 +231,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActivityNode> getNextFlowNodes(Long loginUserId, BpmApprovalDetailReqVO reqVO) {
|
public List<ActivityNode> getNextApprovalNodes(Long loginUserId, BpmApprovalDetailReqVO reqVO) {
|
||||||
// 1.1 校验任务存在
|
// 1.1 校验任务存在
|
||||||
Task task = taskService.getTask(reqVO.getTaskId());
|
Task task = taskService.getTask(reqVO.getTaskId());
|
||||||
if (task == null) {
|
if (task == null) {
|
||||||
|
@ -755,9 +755,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||||
// 设置流程变量,发起人自选审批人
|
// 设置流程变量,发起人自选审批人
|
||||||
variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES,
|
variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES,
|
||||||
startUserSelectAssignees);
|
startUserSelectAssignees);
|
||||||
// 设置流程变量,审批人自选审批人
|
// // 设置流程变量,审批人自选审批人
|
||||||
variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES,
|
// variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES,
|
||||||
startUserSelectAssignees);
|
// startUserSelectAssignees);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 创建流程
|
// 3. 创建流程
|
||||||
|
@ -801,8 +801,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||||
|
|
||||||
// 2.1 移除掉不是发起人或者审批人自选审批人节点
|
// 2.1 移除掉不是发起人或者审批人自选审批人节点
|
||||||
activityNodes.removeIf(task ->
|
activityNodes.removeIf(task ->
|
||||||
ObjectUtil.notEqual(BpmTaskCandidateStrategyEnum.START_USER_SELECT.getStrategy(), task.getCandidateStrategy())
|
ObjectUtil.notEqual(BpmTaskCandidateStrategyEnum.START_USER_SELECT.getStrategy(), task.getCandidateStrategy()));
|
||||||
&& ObjectUtil.notEqual(BpmTaskCandidateStrategyEnum.APPROVE_USER_SELECT.getStrategy(), task.getCandidateStrategy()));
|
|
||||||
// 2.2 流程发起时要先获取当前流程的预测走向节点,发起时只校验预测的节点发起人自选审批人的审批人和抄送人是否都配置了
|
// 2.2 流程发起时要先获取当前流程的预测走向节点,发起时只校验预测的节点发起人自选审批人的审批人和抄送人是否都配置了
|
||||||
activityNodes.forEach(task -> {
|
activityNodes.forEach(task -> {
|
||||||
List<Long> assignees = startUserSelectAssignees != null ? startUserSelectAssignees.get(task.getId()) : null;
|
List<Long> assignees = startUserSelectAssignees != null ? startUserSelectAssignees.get(task.getId()) : null;
|
||||||
|
|
Loading…
Reference in New Issue