提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.bpm.framework.flowable.core.candidate.strategy; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.util.string.StrUtils; |
|
4 |
import com.iailab.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy; |
|
5 |
import com.iailab.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum; |
|
6 |
import com.iailab.module.system.api.permission.PermissionApi; |
|
7 |
import com.iailab.module.system.api.permission.RoleApi; |
|
8 |
import org.flowable.engine.delegate.DelegateExecution; |
|
9 |
import org.springframework.stereotype.Component; |
|
10 |
|
|
11 |
import javax.annotation.Resource; |
|
12 |
import java.util.Set; |
|
13 |
|
|
14 |
/** |
|
15 |
* 角色 {@link BpmTaskCandidateStrategy} 实现类 |
|
16 |
* |
|
17 |
* @author kyle |
|
18 |
*/ |
|
19 |
@Component |
|
20 |
public class BpmTaskCandidateRoleStrategy implements BpmTaskCandidateStrategy { |
|
21 |
|
|
22 |
@Resource |
|
23 |
private RoleApi roleApi; |
|
24 |
@Resource |
|
25 |
private PermissionApi permissionApi; |
|
26 |
|
|
27 |
@Override |
|
28 |
public BpmTaskCandidateStrategyEnum getStrategy() { |
|
29 |
return BpmTaskCandidateStrategyEnum.ROLE; |
|
30 |
} |
|
31 |
|
|
32 |
@Override |
|
33 |
public void validateParam(String param) { |
|
34 |
Set<Long> roleIds = StrUtils.splitToLongSet(param); |
|
35 |
roleApi.validRoleList(roleIds); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
public Set<Long> calculateUsers(DelegateExecution execution, String param) { |
|
40 |
Set<Long> roleIds = StrUtils.splitToLongSet(param); |
|
41 |
return permissionApi.getUserRoleIdListByRoleIds(roleIds).getCheckedData(); |
|
42 |
} |
|
43 |
|
|
44 |
} |