fix(bpm):修复自选审批人时存在多个并行节点时审批人覆盖问题

多个并行节点中只有最后一个节点的审批人会被保存,其他都为空
This commit is contained in:
YunaiV 2025-05-12 20:48:33 +08:00
parent edb302521f
commit ee5cb23730
1 changed files with 5 additions and 4 deletions

View File

@ -597,6 +597,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
* @param nextAssignees 下一个节点审批人集合参数 * @param nextAssignees 下一个节点审批人集合参数
* @param processInstance 流程实例 * @param processInstance 流程实例
*/ */
@SuppressWarnings("unchecked")
private Map<String, Object> validateAndSetNextAssignees(String taskDefinitionKey, Map<String, Object> variables, BpmnModel bpmnModel, private Map<String, Object> validateAndSetNextAssignees(String taskDefinitionKey, Map<String, Object> variables, BpmnModel bpmnModel,
Map<String, List<Long>> nextAssignees, ProcessInstance processInstance) { Map<String, List<Long>> nextAssignees, ProcessInstance processInstance) {
// simple 设计器第一个节点默认为发起人节点不校验是否存在审批人 // simple 设计器第一个节点默认为发起人节点不校验是否存在审批人
@ -646,10 +647,10 @@ public class BpmTaskServiceImpl implements BpmTaskService {
approveUserSelectAssignees = new HashMap<>(); approveUserSelectAssignees = new HashMap<>();
} }
approveUserSelectAssignees.put(nextFlowNode.getId(), assignees); approveUserSelectAssignees.put(nextFlowNode.getId(), assignees);
@SuppressWarnings("unchecked") Map<String,List<Long>> existingApproveUserSelectAssignees = (Map<String,List<Long>>) variables.get(
Map<String,List<Long>> existing = (Map<String,List<Long>>) variables.get(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES); BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES);
if(CollUtil.isNotEmpty(existing)) { if (CollUtil.isNotEmpty(existingApproveUserSelectAssignees)) {
approveUserSelectAssignees.putAll(existing); approveUserSelectAssignees.putAll(existingApproveUserSelectAssignees);
} }
variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES, approveUserSelectAssignees); variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES, approveUserSelectAssignees);
} }