feat: 审批时查询下一个节点的类型是否为自选审批人是否已选择了审批人,否则由前端传递
This commit is contained in:
parent
45a72f4cd8
commit
e11529375e
|
@ -24,7 +24,7 @@ public class BpmTaskApproveReqVO {
|
|||
@Schema(description = "变量实例(动态表单)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Map<String, Object> variables;
|
||||
|
||||
@Schema(description = "节点审批人", example = "[1,2]")
|
||||
private List<Long> assignees;
|
||||
@Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}")
|
||||
private Map<String, List<Long>> startUserSelectAssignees;
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class BpmTaskCandidateStartUserSelectStrategy extends AbstractBpmTaskCand
|
|||
// 获得审批人,如果不存在,则直接返回空,避免类型转换异常
|
||||
List<Long> assignees = startUserSelectAssignees.get(execution.getCurrentActivityId());
|
||||
if (CollUtil.isEmpty(assignees)){
|
||||
return null;
|
||||
return Sets.newLinkedHashSet();
|
||||
}
|
||||
return new LinkedHashSet<>(assignees);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class BpmTaskCandidateStartUserSelectStrategy extends AbstractBpmTaskCand
|
|||
// 获得审批人,如果不存在,则直接返回空,避免类型转换异常
|
||||
List<Long> assignees = startUserSelectAssignees.get(activityId);
|
||||
if (CollUtil.isEmpty(assignees)){
|
||||
return null;
|
||||
return Sets.newLinkedHashSet();
|
||||
}
|
||||
return new LinkedHashSet<>(assignees);
|
||||
}
|
||||
|
|
|
@ -520,6 +520,10 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||
if (CollUtil.isNotEmpty(reqVO.getVariables())) {
|
||||
Map<String, Object> variables = FlowableUtils.filterTaskFormVariable(reqVO.getVariables());
|
||||
// 修改表单的值需要存储到 ProcessInstance 变量
|
||||
if (CollUtil.isNotEmpty(reqVO.getStartUserSelectAssignees())) {
|
||||
variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES,
|
||||
reqVO.getStartUserSelectAssignees());
|
||||
}
|
||||
runtimeService.setVariables(task.getProcessInstanceId(), variables);
|
||||
taskService.complete(task.getId(), variables, true);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue