opt:优化lms任务id获取校验。

This commit is contained in:
2024-10-08 20:53:03 +08:00
parent 0dc2b107bc
commit a22740bb52
2 changed files with 485 additions and 61 deletions

View File

@@ -73,44 +73,56 @@ public class CockpitServiceImpl implements CockpitService {
//库存结构
JSONObject zc_storage_info = new JSONObject();
//状态信息
CompletableFuture<List<Map<String, Object>>> task1 = CompletableFuture.supplyAsync(() -> cockpitMapper.statusInfo(), pool);
task1.thenAccept((result) -> {
CompletableFuture<JSONObject> task1 = CompletableFuture.supplyAsync(() -> {
List<Map<String, Object>> result =cockpitMapper.statusInfo();
device_status.put("status_info", result);
}).exceptionally((e) -> {
return null;
},pool);
task1.exceptionally((e) -> {
log.error("状态信息: {}", e.getMessage(), e);
device_status.put("status_info", null);
return null;
});
//固化架信息
CompletableFuture<List<Map<String, Object>>> task2 = CompletableFuture.supplyAsync(() -> cockpitMapper.storageInfo(), pool);
task2.thenAccept((result) -> {
CompletableFuture<JSONObject> task2 = CompletableFuture.supplyAsync(() -> {
List<Map<String, Object>> result = cockpitMapper.storageInfo();
device_status.put("storage_info", result);
}).exceptionally((e) -> {
return null;
},pool);
task2.exceptionally((e) -> {
log.error("固化架信息: {}", e.getMessage(), e);
device_status.put("storage_info", null);
return null;
});
//暂存库库存结构
CompletableFuture<List<Map<String, Object>>> task3 = CompletableFuture.supplyAsync(() -> cockpitMapper.getZcMaterialmsg(), pool);
task3.thenAccept((result) -> {
CompletableFuture<JSONObject> task3 = CompletableFuture.supplyAsync(() -> {
List<Map<String, Object>> result =cockpitMapper.getZcMaterialmsg();
zc_storage_info.put("material_info", result);
}).exceptionally((e) -> {
return null;
},pool);
task3.exceptionally((e) -> {
log.error("暂存库库存结构: {}", e.getMessage(), e);
zc_storage_info.put("material_info", "");
zc_storage_info.put("material_info", null);
return null;
});
//库位使用占比
CompletableFuture<String> task4 = CompletableFuture.supplyAsync(() -> cockpitMapper.percent(), pool);
task4.thenAccept((result) -> {
CompletableFuture<JSONObject> task4 = CompletableFuture.supplyAsync(() -> {
String result =cockpitMapper.percent();
zc_storage_info.put("percent", result);
}).exceptionally((e) -> {
return null;
},pool);
task4.exceptionally((e) -> {
log.error("库位使用占比: {}", e.getMessage(), e);
zc_storage_info.put("percent", "");
getHomeInfo.put("percent", null);
return null;
});
//生产任务目标达成
CompletableFuture<JSONObject> task5 = CompletableFuture.supplyAsync(() -> cockpitMapper.getProductTarget(), pool);
task5.thenAccept((result) -> {
CompletableFuture<JSONObject> task5 = CompletableFuture.supplyAsync(() -> {
JSONObject result =cockpitMapper.getProductTarget();
getHomeInfo.put("target_achievement", result);
}).exceptionally((e) -> {
return null;
},pool);
task5.exceptionally((e) -> {
log.error("获取生产任务目标达成: {}", e.getMessage(), e);
getHomeInfo.put("target_achievement", null);
return null;
@@ -178,7 +190,6 @@ public class CockpitServiceImpl implements CockpitService {
getHomeInfo.put("ghs_produce", null);
return null;
});
//涂板一周生产
CompletableFuture<List<Map<String, Object>>> task9 = CompletableFuture.supplyAsync(() ->{
List<Map<String, Object>> result =cockpitMapper.getTxQty("7", "TBX");
@@ -910,7 +921,7 @@ public class CockpitServiceImpl implements CockpitService {
//查询保湿间信息
CompletableFuture<List<Map<String, Object>>> task2 = CompletableFuture.supplyAsync(() -> {
JSONArray baoShiJian = (JSONArray) redisUtils.get("baoshijian1");
//todo 待补充信号逻辑
//todo 设备状态待补充信号逻辑
for (Object object : baoShiJian) {
JSONObject jsonObject = (JSONObject) object;
if (StringUtils.isBlank(jsonObject.getString("device_status"))) {