Commit 3a433e8226ca72643118efa47a00593f495a2125
1 parent
b98421df
仿钉钉流程设计- 连续多级部门负责人review 修改
Showing
1 changed file
with
8 additions
and
12 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateDeptLeaderMultiStrategy.java
| ... | ... | @@ -31,23 +31,19 @@ public class BpmTaskCandidateDeptLeaderMultiStrategy extends BpmTaskCandidateAbs |
| 31 | 31 | |
| 32 | 32 | @Override |
| 33 | 33 | public void validateParam(String param) { |
| 34 | - // TODO @jason:是不是可以 | 分隔 deptId 数组,和 level;这样后续可以加更多的参数。 | |
| 35 | - // 参数格式: , 分割。前面的部门编号,可以为多个。最后一个为部门层级 | |
| 36 | - List<Long> params = StrUtils.splitToLong(param, ","); | |
| 37 | - List<List<Long>> splitList = CollUtil.split(params, params.size() - 1); | |
| 38 | - Assert.isTrue(splitList.size() == 2, "参数格式不匹配"); | |
| 39 | - deptApi.validateDeptList(splitList.get(0)); | |
| 40 | - Assert.isTrue(splitList.get(1).get(0) > 0, "部门层级必须大于 0"); | |
| 34 | + // 参数格式: | 分隔 。左边为部门(多个部门用 , 分隔)。 右边为部门层级 | |
| 35 | + String[] params = param.split("\\|"); | |
| 36 | + Assert.isTrue(params.length == 2, "参数格式不匹配"); | |
| 37 | + deptApi.validateDeptList(StrUtils.splitToLong(params[0], ",")); | |
| 38 | + Assert.isTrue(Integer.parseInt(params[1]) > 0, "部门层级必须大于 0"); | |
| 41 | 39 | } |
| 42 | 40 | |
| 43 | 41 | @Override |
| 44 | 42 | public Set<Long> calculateUsers(DelegateExecution execution, String param) { |
| 45 | - // TODO @jason:是不是可以 | 分隔 deptId 数组,和 level;这样后续可以加更多的参数。 | |
| 43 | + // 参数格式: | 分隔 。左边为部门(多个部门用 , 分隔)。 右边为部门层级 | |
| 46 | 44 | // 参数格式: ,分割。前面的部门Id. 可以为多个。 最后一个为部门层级 |
| 47 | - List<Long> params = StrUtils.splitToLong(param, ","); | |
| 48 | - List<List<Long>> splitList = CollUtil.split(params, params.size() - 1); | |
| 49 | - Long level = splitList.get(1).get(0); | |
| 50 | - return getMultiLevelDeptLeaderIds(splitList.get(0), level.intValue()); | |
| 45 | + String[] params = param.split("\\|"); | |
| 46 | + return getMultiLevelDeptLeaderIds(StrUtils.splitToLong(params[0], ","), Integer.valueOf(params[1])); | |
| 51 | 47 | } |
| 52 | 48 | |
| 53 | 49 | } | ... | ... |