|
@@ -518,24 +518,22 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
|
|
Definition definition = defService.getById(task.getDefinitionId());
|
|
|
//获取下一节点列表
|
|
|
List<Node> nextNodeList = nodeService.getNextNodeList(task.getDefinitionId(), task.getNodeCode(), null, SkipType.PASS.getKey(), variables);
|
|
|
+ List<FlowNode> nextFlowNodes = BeanUtil.copyToList(nextNodeList, FlowNode.class);
|
|
|
if (CollUtil.isNotEmpty(nextNodeList)) {
|
|
|
//构建以下节点数据
|
|
|
- List<Task> buildTaskList = StreamUtils.toList(nextNodeList, node -> taskService.addTask(node, instance, definition, null));
|
|
|
+ List<Task> buildNextTaskList = StreamUtils.toList(nextNodeList, node -> taskService.addTask(node, instance, definition, null));
|
|
|
//办理人变量替换
|
|
|
- ExpressionUtil.evalVariable(buildTaskList, MapUtil.mergeAll(instance.getVariableMap(), variables));
|
|
|
- for (Node nextNode : nextNodeList) {
|
|
|
- buildTaskList.stream().filter(t -> t.getNodeCode().equals(nextNode.getNodeCode())).findFirst().ifPresent(t -> {
|
|
|
- nextNode.setPermissionFlag(StringUtils.join(t.getPermissionList(), StringUtils.SEPARATOR));
|
|
|
+ ExpressionUtil.evalVariable(buildNextTaskList, MapUtil.mergeAll(instance.getVariableMap(), variables));
|
|
|
+ for (FlowNode flowNode : nextFlowNodes) {
|
|
|
+ buildNextTaskList.stream().filter(t -> t.getNodeCode().equals(flowNode.getNodeCode())).findFirst().ifPresent(t -> {
|
|
|
+ List<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageId(flowNode.getPermissionFlag());
|
|
|
+ if (CollUtil.isNotEmpty(users)) {
|
|
|
+ flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
- List<FlowNode> flowNodes = BeanUtil.copyToList(nextNodeList, FlowNode.class);
|
|
|
- for (FlowNode flowNode : flowNodes) {
|
|
|
- if (StringUtils.isNotBlank(flowNode.getPermissionFlag())) {
|
|
|
- flwTaskAssigneeService.fetchUsersByStorageId(flowNode.getPermissionFlag());
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
- return BeanUtil.copyToList(nextNodeList, FlowNode.class);
|
|
|
+ return nextFlowNodes;
|
|
|
}
|
|
|
|
|
|
/**
|