review: 重构组装下一个节点审批人方法
This commit is contained in:
parent
67e548d545
commit
41639d5dd7
|
@ -267,7 +267,6 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||||
FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
||||||
List<FlowNode> nextFlowNodes = BpmnModelUtils.getNextFlowNodes(flowElement, bpmnModel, processVariables);
|
List<FlowNode> nextFlowNodes = BpmnModelUtils.getNextFlowNodes(flowElement, bpmnModel, processVariables);
|
||||||
|
|
||||||
// TODO @小北:还是可以优化下哈;“4. 组装节点信息” 只拼接出 candidateUserIds;之后,再第二次循环,查询用户和部门信息,进行拼接
|
|
||||||
// 2. 收集所有节点的候选用户 ID
|
// 2. 收集所有节点的候选用户 ID
|
||||||
Set<Long> allCandidateUsers = new HashSet<>();
|
Set<Long> allCandidateUsers = new HashSet<>();
|
||||||
for (FlowNode node : nextFlowNodes) {
|
for (FlowNode node : nextFlowNodes) {
|
||||||
|
@ -287,13 +286,13 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||||
loginUserId, historicProcessInstance.getProcessDefinitionId(), processVariables);
|
loginUserId, historicProcessInstance.getProcessDefinitionId(), processVariables);
|
||||||
|
|
||||||
// 4.2 组装候选用户信息
|
// 4.2 组装候选用户信息
|
||||||
List<UserSimpleBaseVO> candidateUsers = new ArrayList<>();
|
List<UserSimpleBaseVO> candidateUsers = convertList(candidateUserIds, userId -> {
|
||||||
for (Long userId : candidateUserIds) {
|
AdminUserRespDTO user = userMap.get(userId);
|
||||||
UserSimpleBaseVO user = BpmProcessInstanceConvert.INSTANCE.buildUser(userId, userMap, deptMap);
|
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
candidateUsers.add(user);
|
return BpmProcessInstanceConvert.INSTANCE.buildUser(userId, userMap, deptMap);
|
||||||
}
|
}
|
||||||
}
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
// 4.3 构建节点信息
|
// 4.3 构建节点信息
|
||||||
return new ActivityNode()
|
return new ActivityNode()
|
||||||
|
|
Loading…
Reference in New Issue