代码更新

This commit is contained in:
2023-04-14 17:50:11 +08:00
parent 88cc6a56e7
commit e379a9a86d
18 changed files with 1501 additions and 17 deletions

View File

@@ -76,7 +76,7 @@ public class AppRun {
public String index() {
return "Backend service started successfully";
}
@GetMapping("/w") // 最后可以去掉这个方法
@GetMapping("/w") // 立库监控初始化
@SaIgnore
public String index2() {
// 采用循环+判断进行铺设图标, 可以通过舞台编辑协助完成
@@ -93,15 +93,15 @@ public class AppRun {
int nodeSizeH = 50;
for (int i = 2; i < 23; i=i+2) { // 第几块,每两块为一块
// 获取列数col_num
System.out.println( (i>=10?"1":"10") + i);
System.out.println( (i>=10?"3":"30") + i);
JSONObject jsonObject = WQL.getWO("ss").addParamMap(MapOf.of("flag", "1"
, "block_num", (i>=10?"1":"10") + i)).process().uniqueResult(0);
, "block_num", (i>=10?"3":"30") + i)).process().uniqueResult(0);
int num = Integer.parseInt(jsonObject.getString("num"));
for (int j = 1; j <= num; j++) {// 层数
// 获取21....块的数据
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);
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);
for (int k = 0; k < array.size(); k++) { // 1,2...块的每列数据
JSONObject object = array.getJSONObject(k);
@@ -178,7 +178,58 @@ public class AppRun {
}
save.put("nodes", nodes);
save.put("edges", edges);
JSONObject jsonObject = stageTab.query("stage_code = 'AS'").uniqueResult(0);
JSONObject jsonObject = stageTab.query("stage_code = 'AS_3'").uniqueResult(0);
jsonObject.put("stage_data", save);
stageTab.update(jsonObject);
return "Backend service started successfully";
}
@GetMapping("/f") // 发货区监控初始化
@SaIgnore
public String index3() {
// 采用循环+判断进行铺设图标, 可以通过舞台编辑协助完成
WQLObject stageTab = WQLObject.getWQLObject("stage");
WQLObject attrTab = WQLObject.getWQLObject("sch_base_point");
JSONObject save = new JSONObject();
JSONArray nodes = new JSONArray();
JSONArray edges = new JSONArray();
int x = 50; // 首个位置
int y = 50;
int step = 5;
String type = "html-node";
int nodeSizeW = 50;
int nodeSizeH = 50;
for (int i = 1; i <= 4; i++) {
JSONArray resultJSONArray = attrTab.query("col_num = '" + i + "' and point_type = '9' and layer_num = '1' order by row_num ASC").getResultJSONArray(0);
for (int j = 0; j < resultJSONArray.size(); j++) {
JSONObject json = resultJSONArray.getJSONObject(j);
JSONObject node = new JSONObject();
node.put("id", IdUtil.getSnowflake(1,1).nextIdStr());
node.put("type", type);
node.put("x", x);
node.put("y", y);
JSONObject properties = new JSONObject();
JSONObject nodeSize = new JSONObject();
nodeSize.put("width", nodeSizeW);
nodeSize.put("height", nodeSizeH);
properties.put("nodeSize", nodeSize);
properties.put("struct_id", json.getString("point_id")); // 灵活配置,其他为固定参数
node.put("properties", properties);
node.put("zIndex", "2023");
x = x + step + nodeSizeW;
nodes.add(node);
}
x = 50;
y = y + step + nodeSizeH;
}
save.put("nodes", nodes);
save.put("edges", edges);
JSONObject jsonObject = stageTab.query("stage_code = 'FS'").uniqueResult(0);
jsonObject.put("stage_data", save);
stageTab.update(jsonObject);
return "Backend service started successfully";