update 调整获取下一节点,增加用户分页查询参数

This commit is contained in:
gssong
2025-03-04 21:51:16 +08:00
parent 2340556091
commit 15eb08c065
4 changed files with 28 additions and 15 deletions

View File

@ -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;
}
/**