fix(bpm):解决多实例任务根据'审批人自选'策略多次选择时,审批人被后一次选择覆盖的问题

This commit is contained in:
吴焕超 2025-05-23 08:41:08 +08:00
parent 0f50e722e2
commit 72c8ac3817
1 changed files with 7 additions and 0 deletions

View File

@ -647,6 +647,13 @@ public class BpmTaskServiceImpl implements BpmTaskService {
if (approveUserSelectAssignees == null) {
approveUserSelectAssignees = new HashMap<>();
}
// 当多实例任务根据'审批人自选'策略多次选择时避免审批人被后一次选择覆盖
List<Long> nodeHadAssignees = approveUserSelectAssignees.get(nextFlowNode.getId());
if (nodeHadAssignees != null){
assignees = Stream.concat(nodeHadAssignees.stream(), assignees.stream())
.distinct()
.toList();
}
approveUserSelectAssignees.put(nextFlowNode.getId(), assignees);
Map<String,List<Long>> existingApproveUserSelectAssignees = (Map<String,List<Long>>) variables.get(
BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES);