二次测试

master
面包骑士 2024-09-04 12:16:53 +08:00
parent a982be1946
commit 3696f53e31
2 changed files with 18 additions and 10 deletions

View File

@ -191,6 +191,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>
throw new TaskException("数据输出节点必须紧跟在数据输入/操作节点之后"); throw new TaskException("数据输出节点必须紧跟在数据输入/操作节点之后");
} }
// 执行查询语句 // 执行查询语句
log.info("任务执行查询阶段结束,查询sql为: [{}]", findSql);
Result<List<DataModel>> tableValue = remoteDataSourceService.findTableValue(new DataValueModel(4L, findSql)); Result<List<DataModel>> tableValue = remoteDataSourceService.findTableValue(new DataValueModel(4L, findSql));
if (tableValue.getCode() != 200){ if (tableValue.getCode() != 200){
throw new TaskException(tableValue.getMsg()); throw new TaskException(tableValue.getMsg());
@ -201,9 +202,13 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>
addSql = NodeUtils.nodeDispExportation(dispList, data); addSql = NodeUtils.nodeDispExportation(dispList, data);
} }
} }
log.info("任务执行结束,最终sql为: [{}]",addSql+" "+findSql);
return findSql; log.info("任务执行完成,新增sql为: [{}]", addSql);
Result<List<DataModel>> tableValue = remoteDataSourceService.findTableValue(new DataValueModel(4L, addSql));
if (tableValue.getCode() != 200){
throw new TaskException(tableValue.getMsg());
}
return "执行成功";
} }

View File

@ -269,14 +269,17 @@ public class NodeUtils {
} }
dataMap.put(data.get(i).getKey(), data.get(i).getValue().toString()); dataMap.put(data.get(i).getKey(), data.get(i).getValue().toString());
} }
dataList1.forEach(map -> { dataList1.forEach(map -> insSql.append(
insSql.append("( "); "( " +
for (NodeDisposition disposition : fieldList) { StringUtils.join(
insSql.append("'").append(map.get(disposition.getDispDesc())).append("',"); fieldList.
} stream().
insSql.append(" )"); map(field -> map.get(field.getDispDesc())).
}); map(field -> "'" + field + "'").
return insSql.toString(); toArray(),
",") +
" ),"));
return insSql.deleteCharAt(insSql.length() - 1).toString();
} }
} }