Commit ee5cb23730ebdf7cb0827ea5a22ea29cffe1785d

Authored by YunaiV
1 parent edb30252

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

多个并行节点中只有最后一个节点的审批人会被保存,其他都为空
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java
@@ -597,6 +597,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { @@ -597,6 +597,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
597 * @param nextAssignees 下一个节点审批人集合(参数) 597 * @param nextAssignees 下一个节点审批人集合(参数)
598 * @param processInstance 流程实例 598 * @param processInstance 流程实例
599 */ 599 */
  600 + @SuppressWarnings("unchecked")
600 private Map<String, Object> validateAndSetNextAssignees(String taskDefinitionKey, Map<String, Object> variables, BpmnModel bpmnModel, 601 private Map<String, Object> validateAndSetNextAssignees(String taskDefinitionKey, Map<String, Object> variables, BpmnModel bpmnModel,
601 Map<String, List<Long>> nextAssignees, ProcessInstance processInstance) { 602 Map<String, List<Long>> nextAssignees, ProcessInstance processInstance) {
602 // simple 设计器第一个节点默认为发起人节点,不校验是否存在审批人 603 // simple 设计器第一个节点默认为发起人节点,不校验是否存在审批人
@@ -646,10 +647,10 @@ public class BpmTaskServiceImpl implements BpmTaskService { @@ -646,10 +647,10 @@ public class BpmTaskServiceImpl implements BpmTaskService {
646 approveUserSelectAssignees = new HashMap<>(); 647 approveUserSelectAssignees = new HashMap<>();
647 } 648 }
648 approveUserSelectAssignees.put(nextFlowNode.getId(), assignees); 649 approveUserSelectAssignees.put(nextFlowNode.getId(), assignees);
649 - @SuppressWarnings("unchecked")  
650 - Map<String,List<Long>> existing = (Map<String,List<Long>>) variables.get(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES);  
651 - if(CollUtil.isNotEmpty(existing)) {  
652 - approveUserSelectAssignees.putAll(existing); 650 + Map<String,List<Long>> existingApproveUserSelectAssignees = (Map<String,List<Long>>) variables.get(
  651 + BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES);
  652 + if (CollUtil.isNotEmpty(existingApproveUserSelectAssignees)) {
  653 + approveUserSelectAssignees.putAll(existingApproveUserSelectAssignees);
653 } 654 }
654 variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES, approveUserSelectAssignees); 655 variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES, approveUserSelectAssignees);
655 } 656 }