Forráskód Böngészése

fix(bpm):修复自选审批人时存在多个并行节点时审批人覆盖问题
多个并行节点中只有最后一个节点的审批人会被保存,其他都为空

YunaiV 6 hónapja
szülő
commit
ee5cb23730

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