优化校验
parent
da16ad74ac
commit
b450a4c2af
|
@ -150,8 +150,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>
|
|||
List<Node> nodeListAll = nodeService.selectNodeList(new NodeReq().buildTaskCode(taskCode));
|
||||
// 节点初始化
|
||||
HashMap<String, List<Node>> nodeMap = NodeUtils.nodeInit(nodeListAll);
|
||||
|
||||
List<NodeType> nodeTypeList = selectNodeTypeList();
|
||||
/* 节点组成校验 */
|
||||
NodeUtils.nodeCheckMakeUp(nodeListAll, nodeTypeList);
|
||||
/* 节点连接规范校验 */
|
||||
NodeUtils.nodeCheckNorm(nodeListAll,selectNodeTypeList());
|
||||
NodeUtils.nodeCheckNorm(nodeListAll, nodeTypeList);
|
||||
|
||||
// 开始节点处理
|
||||
Node thisNode = nodeMap.get("start").get(0);
|
||||
|
@ -176,9 +180,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>
|
|||
}else if (StringUtils.equals(thisNode.getNodeType(), "unite")){
|
||||
findSql = NodeUtils.nodeDispUnite(dispList);
|
||||
}else if (StringUtils.equals(thisNode.getNodeType(), "exportation")){
|
||||
if (StringUtils.isEmpty(findSql)){
|
||||
throw new TaskException("数据输出节点必须紧跟在数据输入/操作节点之后");
|
||||
}
|
||||
// 执行查询语句
|
||||
log.info("任务执行查询阶段结束,查询sql为: [{}]", findSql);
|
||||
Result<List<DataModel>> tableValue = remoteDataSourceService.findTableValue(new DataValueModel(4L, findSql));
|
||||
|
|
|
@ -131,6 +131,13 @@ public class NodeUtils {
|
|||
List<Node> nodes = nodeMapAll.get(nodeType.getNodeTypeCode());
|
||||
if (nodes != null) {
|
||||
nodes.forEach(node -> {
|
||||
if (StringUtils.equals(node.getNodeType(), "exportation")){
|
||||
Node nextNode = getPreNode(node, nodeListAll);
|
||||
if (!StringUtils.equals(nextNode.getNodeType(), "start") &&
|
||||
!StringUtils.equals(nextNode.getNodeType(), "unit")) {
|
||||
throw new TaskException("数据输出节点必须紧跟在数据输入/操作节点之后");
|
||||
}
|
||||
}
|
||||
// 获取该节点的下级节点
|
||||
List<Node> nextNodeList = getNextNode(node, nodeListAll);
|
||||
if (nextNodeList != null && !nextNodeList.isEmpty()){
|
||||
|
@ -145,7 +152,6 @@ public class NodeUtils {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue