【代码优化】工作流:优化 form 分配人的逻辑

This commit is contained in:
YunaiV 2024-11-19 21:04:08 +08:00
parent b629e0a615
commit 4a23872598
3 changed files with 12 additions and 8 deletions

View File

@ -1,8 +1,9 @@
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.dept; package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.form;
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.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.candidate.strategy.dept.AbstractBpmTaskCandidateDeptLeaderStrategy;
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;
@ -17,10 +18,11 @@ import java.util.Set;
* @author jason * @author jason
*/ */
@Component @Component
public class BpmTaskCandidateDeptLeaderOnFormStrategy extends AbstractBpmTaskCandidateDeptLeaderStrategy { public class BpmTaskCandidateFormSDeptLeaderStrategy extends AbstractBpmTaskCandidateDeptLeaderStrategy {
@Override @Override
public BpmTaskCandidateStrategyEnum getStrategy() { public BpmTaskCandidateStrategyEnum getStrategy() {
return BpmTaskCandidateStrategyEnum.DEPT_LEADER_ON_FORM; return BpmTaskCandidateStrategyEnum.FORM_DEPT_LEADER;
} }
@Override @Override
@ -50,4 +52,5 @@ public class BpmTaskCandidateDeptLeaderOnFormStrategy extends AbstractBpmTaskCan
int level = Integer.parseInt(params[1]); int level = Integer.parseInt(params[1]);
return super.getMultiLevelDeptLeaderIds(Convert.toList(Long.class, result), level); return super.getMultiLevelDeptLeaderIds(Convert.toList(Long.class, result), level);
} }
} }

View File

@ -1,8 +1,9 @@
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.user; package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.form;
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.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.candidate.strategy.user.BpmTaskCandidateUserStrategy;
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;
@ -17,11 +18,11 @@ import java.util.Set;
* @author jason * @author jason
*/ */
@Component @Component
public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidateStrategy { public class BpmTaskCandidateFormUserStrategy implements BpmTaskCandidateStrategy {
@Override @Override
public BpmTaskCandidateStrategyEnum getStrategy() { public BpmTaskCandidateStrategyEnum getStrategy() {
return BpmTaskCandidateStrategyEnum.USER_FIELD_ON_FORM; return BpmTaskCandidateStrategyEnum.FORM_USER;
} }
@Override @Override

View File

@ -29,8 +29,8 @@ public enum BpmTaskCandidateStrategyEnum implements IntArrayValuable {
START_USER_DEPT_LEADER(37, "发起人部门负责人"), START_USER_DEPT_LEADER(37, "发起人部门负责人"),
START_USER_DEPT_LEADER_MULTI(38, "发起人连续多级部门的负责人"), START_USER_DEPT_LEADER_MULTI(38, "发起人连续多级部门的负责人"),
USER_GROUP(40, "用户组"), USER_GROUP(40, "用户组"),
USER_FIELD_ON_FORM(50, "表单内用户字段"), FORM_USER(50, "表单内用户字段"),
DEPT_LEADER_ON_FORM(51, "表单内部负责人"), FORM_DEPT_LEADER(51, "表单内部负责人"),
EXPRESSION(60, "流程表达式"), // 表达式 ExpressionManager EXPRESSION(60, "流程表达式"), // 表达式 ExpressionManager
ASSIGN_EMPTY(1, "审批人为空"), ASSIGN_EMPTY(1, "审批人为空"),
; ;