|
@ -1,5 +1,6 @@ |
|
|
package org.nl.wms.cockpit.service.impl; |
|
|
package org.nl.wms.cockpit.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
@ -170,7 +171,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
map.put("LastTenFailureList", null); |
|
|
map.put("LastTenFailureList", null); |
|
|
return null; |
|
|
return null; |
|
|
}); |
|
|
}); |
|
|
// 7、码垛位情况显示
|
|
|
// 7、压制码垛位情况显示
|
|
|
CompletableFuture<JSONArray> stackingPositionTask = CompletableFuture.supplyAsync(() -> { |
|
|
CompletableFuture<JSONArray> stackingPositionTask = CompletableFuture.supplyAsync(() -> { |
|
|
JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "5", "region_code", "YZ")) |
|
|
JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "5", "region_code", "YZ")) |
|
|
.process() |
|
|
.process() |
|
@ -178,7 +179,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
return res; |
|
|
return res; |
|
|
}, pool); |
|
|
}, pool); |
|
|
stackingPositionTask.thenAccept(result -> { |
|
|
stackingPositionTask.thenAccept(result -> { |
|
|
// TODO: 请求acs系统
|
|
|
// TODO: 颜色、实时数量请求acs系统
|
|
|
for (int i = 0; i < result.size(); i++) { |
|
|
for (int i = 0; i < result.size(); i++) { |
|
|
JSONObject jsonObject = result.getJSONObject(i); |
|
|
JSONObject jsonObject = result.getJSONObject(i); |
|
|
jsonObject.put("color_status", ColorEnum.RED.getIndex()); |
|
|
jsonObject.put("color_status", ColorEnum.RED.getIndex()); |
|
@ -197,6 +198,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
JSONObject jsonObject = res.getJSONObject(i); |
|
|
JSONObject jsonObject = res.getJSONObject(i); |
|
|
jsonObject.put("device_status", DeviceStatusEnum.STANDBY.getCode()); |
|
|
jsonObject.put("device_status", DeviceStatusEnum.STANDBY.getCode()); |
|
|
|
|
|
jsonObject.put("open_time", DateUtil.now()); |
|
|
} |
|
|
} |
|
|
return res; |
|
|
return res; |
|
|
}, pool); |
|
|
}, pool); |
|
@ -215,6 +217,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
JSONObject jsonObject = res.getJSONObject(i); |
|
|
JSONObject jsonObject = res.getJSONObject(i); |
|
|
jsonObject.put("device_status", DeviceStatusEnum.STANDBY.getCode()); |
|
|
jsonObject.put("device_status", DeviceStatusEnum.STANDBY.getCode()); |
|
|
|
|
|
jsonObject.put("open_time", DateUtil.now()); |
|
|
} |
|
|
} |
|
|
return res; |
|
|
return res; |
|
|
}, pool); |
|
|
}, pool); |
|
@ -225,34 +228,34 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
map.put("MixMachineList", null); |
|
|
map.put("MixMachineList", null); |
|
|
return null; |
|
|
return null; |
|
|
}); |
|
|
}); |
|
|
// 10、困料货架的信息显示 todo: 数据?
|
|
|
// 10、困料货架的信息显示
|
|
|
// CompletableFuture<JSONArray> trappedMaterialShelfTask = CompletableFuture.supplyAsync(() -> {
|
|
|
CompletableFuture<JSONArray> trappedMaterialShelfTask = CompletableFuture.supplyAsync(() -> { |
|
|
// JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "8"))
|
|
|
JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "8")) |
|
|
// .process()
|
|
|
.process() |
|
|
// .getResultJSONArray(0);
|
|
|
.getResultJSONArray(0); |
|
|
// return res;
|
|
|
return res; |
|
|
// }, pool);
|
|
|
}, pool); |
|
|
// trappedMaterialShelfTask.thenAccept(result -> {
|
|
|
trappedMaterialShelfTask.thenAccept(result -> { |
|
|
// map.put("TrappedMaterialShelfList", result);
|
|
|
map.put("TrappedMaterialShelfList", result); |
|
|
// }).exceptionally((e) -> {
|
|
|
}).exceptionally((e) -> { |
|
|
// log.error("困料货架的信息显示: {}", e.getMessage(), e);
|
|
|
log.error("困料货架 - 40 货位的信息显示: {}", e.getMessage(), e); |
|
|
// map.put("TrappedMaterialShelfList", null);
|
|
|
map.put("TrappedMaterialShelfList", null); |
|
|
// return null;
|
|
|
return null; |
|
|
// });
|
|
|
}); |
|
|
// 11、半成品货架数据显示 todo: 数据?
|
|
|
// 11、半成品货架数据显示
|
|
|
// CompletableFuture<JSONArray> semiFinishedProductShelfTask = CompletableFuture.supplyAsync(() -> {
|
|
|
CompletableFuture<JSONArray> semiFinishedProductShelfTask = CompletableFuture.supplyAsync(() -> { |
|
|
// JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "9"))
|
|
|
JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "9")) |
|
|
// .process()
|
|
|
.process() |
|
|
// .getResultJSONArray(0);
|
|
|
.getResultJSONArray(0); |
|
|
// return res;
|
|
|
return res; |
|
|
// }, pool);
|
|
|
}, pool); |
|
|
// semiFinishedProductShelfTask.thenAccept(result -> {
|
|
|
semiFinishedProductShelfTask.thenAccept(result -> { |
|
|
// map.put("SemiFinishedProductShelfList", result);
|
|
|
map.put("SemiFinishedProductShelfList", result); |
|
|
// }).exceptionally((e) -> {
|
|
|
}).exceptionally((e) -> { |
|
|
// log.error("半成品货架数据显示: {}", e.getMessage(), e);
|
|
|
log.error("半成品货架数据显示: {}", e.getMessage(), e); |
|
|
// map.put("SemiFinishedProductShelfList", null);
|
|
|
map.put("SemiFinishedProductShelfList", null); |
|
|
// return null;
|
|
|
return null; |
|
|
// });
|
|
|
}); |
|
|
// 12、混料机下料位
|
|
|
// 12、混料机下料位
|
|
|
CompletableFuture<JSONArray> mixBlankingTask = CompletableFuture.supplyAsync(() -> { |
|
|
CompletableFuture<JSONArray> mixBlankingTask = CompletableFuture.supplyAsync(() -> { |
|
|
JSONArray res = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "3")) |
|
|
JSONArray res = WQL.getWO("COCKPIT_MIX_AND_TRAP").addParamMap(MapOf.of("flag", "3")) |
|
@ -266,7 +269,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
map.put("MixBlankingList", null); |
|
|
map.put("MixBlankingList", null); |
|
|
return null; |
|
|
return null; |
|
|
}); |
|
|
}); |
|
|
// 13、困料货架数据显示
|
|
|
// 13、液压机旁边困料货架数据显示
|
|
|
CompletableFuture<JSONArray> trappedShelfTask = CompletableFuture.supplyAsync(() -> { |
|
|
CompletableFuture<JSONArray> trappedShelfTask = CompletableFuture.supplyAsync(() -> { |
|
|
JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "12")) |
|
|
JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "12")) |
|
|
.process().getResultJSONArray(0); |
|
|
.process().getResultJSONArray(0); |
|
@ -275,10 +278,29 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
trappedShelfTask.thenAccept(result -> { |
|
|
trappedShelfTask.thenAccept(result -> { |
|
|
map.put("TrappedShelfList", result); |
|
|
map.put("TrappedShelfList", result); |
|
|
}).exceptionally((e) -> { |
|
|
}).exceptionally((e) -> { |
|
|
log.error("获取困料货架数据显示 - 6货位信息: {}", e.getMessage(), e); |
|
|
log.error("液压机旁边困料货架数据显示 - 6货位信息: {}", e.getMessage(), e); |
|
|
map.put("TrappedShelfList", null); |
|
|
map.put("TrappedShelfList", null); |
|
|
return null; |
|
|
return null; |
|
|
}); |
|
|
}); |
|
|
|
|
|
// 14、分拣拆码垛对接位
|
|
|
|
|
|
CompletableFuture<JSONArray> sortAndPalletizingTask = CompletableFuture.supplyAsync(() -> { |
|
|
|
|
|
JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION").addParamMap(MapOf.of("flag", "13")) |
|
|
|
|
|
.process() |
|
|
|
|
|
.getResultJSONArray(0); |
|
|
|
|
|
// TODO: 颜色、实时数量请求acs系统
|
|
|
|
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
|
|
|
JSONObject jsonObject = res.getJSONObject(i); |
|
|
|
|
|
jsonObject.put("color_status", ColorEnum.RED.getIndex()); |
|
|
|
|
|
} |
|
|
|
|
|
return res; |
|
|
|
|
|
}, pool); |
|
|
|
|
|
sortAndPalletizingTask.thenAccept(result -> { |
|
|
|
|
|
map.put("SortAndPalletizingList", result); |
|
|
|
|
|
}).exceptionally((e) -> { |
|
|
|
|
|
log.error("分拣拆码垛: {}", e.getMessage(), e); |
|
|
|
|
|
map.put("SortAndPalletizingList", null); |
|
|
|
|
|
return null; |
|
|
|
|
|
}); |
|
|
CompletableFuture<Void> allQuery = CompletableFuture.allOf( |
|
|
CompletableFuture<Void> allQuery = CompletableFuture.allOf( |
|
|
mixDayProductionTask, |
|
|
mixDayProductionTask, |
|
|
pressDayProductionTask, |
|
|
pressDayProductionTask, |
|
@ -287,10 +309,11 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
lastMonthFailureTask, |
|
|
lastMonthFailureTask, |
|
|
stackingPositionTask, |
|
|
stackingPositionTask, |
|
|
pressMachineTask, |
|
|
pressMachineTask, |
|
|
|
|
|
trappedMaterialShelfTask, |
|
|
mixMachineTask, |
|
|
mixMachineTask, |
|
|
trappedShelfTask); |
|
|
trappedShelfTask, |
|
|
// trappedMaterialShelfTask,
|
|
|
sortAndPalletizingTask, |
|
|
// semiFinishedProductShelfTask);
|
|
|
semiFinishedProductShelfTask); |
|
|
CompletableFuture<ConcurrentHashMap<String, Object>> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { |
|
|
CompletableFuture<ConcurrentHashMap<String, Object>> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { |
|
|
log.error(e.getMessage(), e); |
|
|
log.error(e.getMessage(), e); |
|
|
return null; |
|
|
return null; |
|
@ -1031,6 +1054,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
map.put("FinishedProductShelfList", null); |
|
|
map.put("FinishedProductShelfList", null); |
|
|
return null; |
|
|
return null; |
|
|
}); |
|
|
}); |
|
|
|
|
|
// todo: 窑内数据
|
|
|
CompletableFuture<Void> allQuery = CompletableFuture.allOf( |
|
|
CompletableFuture<Void> allQuery = CompletableFuture.allOf( |
|
|
finishedProductShelfTask); |
|
|
finishedProductShelfTask); |
|
|
CompletableFuture<ConcurrentHashMap<String, Object>> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { |
|
|
CompletableFuture<ConcurrentHashMap<String, Object>> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { |
|
@ -1141,6 +1165,7 @@ public class BigScreenServiceImpl implements BigScreenService { |
|
|
JSONObject resObj = new JSONObject(); |
|
|
JSONObject resObj = new JSONObject(); |
|
|
JSONArray res = WQL.getWO("COCKPIT_SORTE_AND_PACKAGE").addParamMap(MapOf.of("flag", "5")) |
|
|
JSONArray res = WQL.getWO("COCKPIT_SORTE_AND_PACKAGE").addParamMap(MapOf.of("flag", "5")) |
|
|
.process().getResultJSONArray(0); |
|
|
.process().getResultJSONArray(0); |
|
|
|
|
|
// todo: 向acs申请获取
|
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
for (int i = 0; i < res.size(); i++) { |
|
|
JSONObject device = res.getJSONObject(i); |
|
|
JSONObject device = res.getJSONObject(i); |
|
|
device.put("device_status", DeviceStatusEnum.RUNNING.getCode()); |
|
|
device.put("device_status", DeviceStatusEnum.RUNNING.getCode()); |
|
|