fix: 修复立库监控创建bug

This commit is contained in:
2023-04-13 15:12:07 +08:00
parent a00be0d40a
commit aa3ffc894d

View File

@@ -93,17 +93,38 @@ public class AppRun {
int nodeSizeH = 50;
for (int i = 2; i < 23; i=i+2) { // 第几块,每两块为一块
// 获取列数col_num
System.out.println( (i>=10?"3":"30") + i);
System.out.println( (i>=10?"1":"10") + i);
JSONObject jsonObject = WQL.getWO("ss").addParamMap(MapOf.of("flag", "1"
, "block_num", (i>=10?"3":"30") + i)).process().uniqueResult(0);
, "block_num", (i>=10?"1":"10") + i)).process().uniqueResult(0);
int num = Integer.parseInt(jsonObject.getString("num"));
for (int j = 1; j <= num; j++) {
for (int j = 1; j <= num; j++) {// 层数
// 获取21....块的数据
JSONArray array = attrTab.query("block_num IN ('" + (i>=10?"3":"30") + i + "','" +
((i-1)>=10?"3":"30") + (i - 1) + "') AND " +
"layer_num = 3 AND col_num = " + j, "block_num DESC, row_num DESC").getResultJSONArray(0);
JSONArray array = attrTab.query("block_num IN ('" + (i>=10?"1":"10") + i + "','" +
((i-1)>=10?"1":"10") + (i - 1) + "') AND " +
"layer_num = 1 AND col_num = " + j, "block_num DESC, row_num DESC").getResultJSONArray(0);
for (int k = 0; k < array.size(); k++) { // 1,2...块的每列数据
JSONObject object = array.getJSONObject(k);
if (k-1 >= 0) { // 如果块与块不同,空一个距离
JSONObject object2 = array.getJSONObject(k-1);
if (!object2.getString("block_num").equals(object.getString("block_num"))) {
JSONObject node2 = new JSONObject();
node2.put("id", IdUtil.getSnowflake(1,1).nextIdStr());
node2.put("type", type);
node2.put("x", x);
node2.put("y", y);
JSONObject properties2 = new JSONObject();
JSONObject nodeSize2 = new JSONObject();
nodeSize2.put("width", nodeSizeW);
nodeSize2.put("height", nodeSizeH);
properties2.put("nodeSize", nodeSize2);
properties2.put("flag", "1");
properties2.put("transform", 90);
node2.put("properties", properties2);
node2.put("zIndex", "2023");
x = x + step + nodeSizeW;
nodes.add(node2);
}
}
if (object.getString("is_delete").equals("1")) {
x = x + step + nodeSizeW;
continue;
@@ -124,27 +145,7 @@ public class AppRun {
node.put("zIndex", "2023");
x = x + step + nodeSizeW;
nodes.add(node);
if (k+1 < array.size()) { // 如果块与块不同,空一个距离
JSONObject object2 = array.getJSONObject(k+1);
if (!object2.getString("block_num").equals(object.getString("block_num"))) {
JSONObject node2 = new JSONObject();
node2.put("id", IdUtil.getSnowflake(1,1).nextIdStr());
node2.put("type", type);
node2.put("x", x);
node2.put("y", y);
JSONObject properties2 = new JSONObject();
JSONObject nodeSize2 = new JSONObject();
nodeSize2.put("width", nodeSizeW);
nodeSize2.put("height", nodeSizeH);
properties2.put("nodeSize", nodeSize2);
properties2.put("flag", "1");
properties2.put("transform", 90);
node2.put("properties", properties2);
node2.put("zIndex", "2023");
x = x + step + nodeSizeW;
nodes.add(node2);
}
}
}
// 下一列
x = 50;
@@ -174,7 +175,7 @@ public class AppRun {
}
save.put("nodes", nodes);
save.put("edges", edges);
JSONObject jsonObject = stageTab.query("stage_code = 'AS_3'").uniqueResult(0);
JSONObject jsonObject = stageTab.query("stage_code = 'AS'").uniqueResult(0);
jsonObject.put("stage_data", save);
stageTab.update(jsonObject);
return "Backend service started successfully";