【功能修复】 修复表单内用户字段可以多选时的问题

This commit is contained in:
jason 2024-11-17 23:58:23 +08:00
parent 7886aaf244
commit 61c9a04f9f

View File

@ -2,19 +2,15 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.u
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil;
import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy; import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy;
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum; import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum;
import org.flowable.bpmn.model.BpmnModel; import org.flowable.bpmn.model.BpmnModel;
import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet;
/** /**
* 表单内用户字段 {@link BpmTaskCandidateUserStrategy} 实现类 * 表单内用户字段 {@link BpmTaskCandidateUserStrategy} 实现类
* *
@ -43,8 +39,8 @@ public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidate
public Set<Long> calculateUsersByActivity(BpmnModel bpmnModel, String activityId, public Set<Long> calculateUsersByActivity(BpmnModel bpmnModel, String activityId,
String param, Long startUserId, String processDefinitionId, String param, Long startUserId, String processDefinitionId,
Map<String, Object> processVariables) { Map<String, Object> processVariables) {
Long result = MapUtil.getLong(processVariables, param); Object result = processVariables == null ? null : processVariables.get(param);
return result != null ? asSet(result) : new HashSet<>(); return Convert.toSet(Long.class, result);
} }
} }