Commit 61c9a04f9feb35463bba88fa1ee54499bffc84c4
1 parent
7886aaf2
【功能修复】 修复表单内用户字段可以多选时的问题
Showing
1 changed file
with
4 additions
and
8 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/strategy/user/BpmTaskCandidateUserFieldOnFormStrategy.java
| ... | ... | @@ -2,26 +2,22 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.u |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.convert.Convert; |
| 4 | 4 | import cn.hutool.core.lang.Assert; |
| 5 | -import cn.hutool.core.map.MapUtil; | |
| 6 | 5 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy; |
| 7 | 6 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum; |
| 8 | 7 | import org.flowable.bpmn.model.BpmnModel; |
| 9 | 8 | import org.flowable.engine.delegate.DelegateExecution; |
| 10 | 9 | import org.springframework.stereotype.Component; |
| 11 | 10 | |
| 12 | -import java.util.HashSet; | |
| 13 | 11 | import java.util.Map; |
| 14 | 12 | import java.util.Set; |
| 15 | 13 | |
| 16 | -import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; | |
| 17 | - | |
| 18 | 14 | /** |
| 19 | 15 | * 表单内用户字段 {@link BpmTaskCandidateUserStrategy} 实现类 |
| 20 | 16 | * |
| 21 | 17 | * @author jason |
| 22 | 18 | */ |
| 23 | 19 | @Component |
| 24 | -public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidateStrategy { | |
| 20 | +public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidateStrategy { | |
| 25 | 21 | |
| 26 | 22 | @Override |
| 27 | 23 | public BpmTaskCandidateStrategyEnum getStrategy() { |
| ... | ... | @@ -35,7 +31,7 @@ public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidate |
| 35 | 31 | |
| 36 | 32 | @Override |
| 37 | 33 | public Set<Long> calculateUsersByTask(DelegateExecution execution, String param) { |
| 38 | - Object result = execution.getVariable(param); | |
| 34 | + Object result = execution.getVariable(param); | |
| 39 | 35 | return Convert.toSet(Long.class, result); |
| 40 | 36 | } |
| 41 | 37 | |
| ... | ... | @@ -43,8 +39,8 @@ public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidate |
| 43 | 39 | public Set<Long> calculateUsersByActivity(BpmnModel bpmnModel, String activityId, |
| 44 | 40 | String param, Long startUserId, String processDefinitionId, |
| 45 | 41 | Map<String, Object> processVariables) { |
| 46 | - Long result = MapUtil.getLong(processVariables, param); | |
| 47 | - return result != null ? asSet(result) : new HashSet<>(); | |
| 42 | + Object result = processVariables == null ? null : processVariables.get(param); | |
| 43 | + return Convert.toSet(Long.class, result); | |
| 48 | 44 | } |
| 49 | 45 | |
| 50 | 46 | } | ... | ... |