opt:优化报警前十

This commit is contained in:
2024-11-22 21:19:22 +08:00
parent bc947daac7
commit 41b19dc097

View File

@@ -914,10 +914,13 @@ public class CockpitServiceImpl implements CockpitService {
JSONArray result = cockpitMapper.getGHSInteriorList();
if (ObjectUtil.isNotEmpty(result)) {
JSONObject ghsDetailInfo = new JSONObject();
JSONArray ghsDetails = new JSONArray();
JSONArray guHuaShi = (JSONArray) redisUtils.get("guhuashi");
if(ObjectUtil.isNotEmpty(guHuaShi)) {
array.add(guHuaShi);
//todo 待补充信号逻辑
for (Object object : guHuaShi) {
JSONObject jsonObject = (JSONObject) object;
array.add(jsonObject);
}
}
// for (Object object : result) {
// //设备状态 按照lms点位管理来 1-无货2-有货3-进料4固化5出料6故障
@@ -939,6 +942,10 @@ public class CockpitServiceImpl implements CockpitService {
log.error("读取设备缓存信息: {}", e.getMessage(), e);
return null;
});
task1.exceptionally((e) -> {
log.error("读取设备缓存信息: {}", e.getMessage(), e);
return null;
});
//查询保湿间信息
CompletableFuture<List<Map<String, Object>>> task2 = CompletableFuture.supplyAsync(() -> {
JSONArray baoShiJian = (JSONArray) redisUtils.get("baoshijian");
@@ -949,11 +956,11 @@ public class CockpitServiceImpl implements CockpitService {
if (StringUtils.isBlank(jsonObject.getString("device_status"))) {
jsonObject.put("device_status", "1");
}
array.add(jsonObject);
}
} else {
array.add(new JSONArray());
array.add(new JSONObject());
}
array.add(baoShiJian);
return null;
}, pool);
task2.exceptionally((e) -> {
@@ -971,11 +978,11 @@ public class CockpitServiceImpl implements CockpitService {
//0故障1正常
jsonObject.put("device_status", "1");
}
array.add(jsonObject);
}
} else {
array.add(new JSONArray());
array.add(new JSONObject());
}
array.add(site);
return null;
}, pool);
task3.exceptionally((e) -> {
@@ -998,11 +1005,12 @@ public class CockpitServiceImpl implements CockpitService {
if (StringUtils.isBlank(jsonObject.getString("vehicle_type"))) {
jsonObject.put("vehicle_type", "0");
}
array.add(jsonObject);
}
} else {
agv = new JSONArray();
array.add(new JSONObject());
}
array.add(agv);
//array.add(agv);
return null;
}, pool);
task4.exceptionally((e) -> {
@@ -1028,11 +1036,11 @@ public class CockpitServiceImpl implements CockpitService {
if (StringUtils.isBlank(jsonObject.getString("vehicle_type"))) {
jsonObject.put("vehicle_type", "0");
}
array.add(jsonObject);
}
} else {
rgv = new JSONArray();
array.add(new JSONObject());
}
array.add(rgv);
return null;
}, pool);
task5.exceptionally((e) -> {