add: agv状态
This commit is contained in:
@@ -470,6 +470,26 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
map.put("IoKilnTrussTask", null);
|
||||
return null;
|
||||
});
|
||||
// 19、AGV数据
|
||||
CompletableFuture<JSONObject> AGVStatusTask = CompletableFuture.supplyAsync(() -> {
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray res = new JSONArray();
|
||||
JSONObject devicesStatus = PointUpdateUtil.getDevicesStatus(res);
|
||||
// JSONObject devicesStatus = null;
|
||||
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject object = data.getJSONObject(i);
|
||||
result.put(object.getString("device_code"), object);
|
||||
}
|
||||
return result;
|
||||
}, pool);
|
||||
AGVStatusTask.thenAccept(result -> {
|
||||
map.put("AGVStatusList", result);
|
||||
}).exceptionally((e) -> {
|
||||
log.error("AGV数据: {}", e.getMessage(), e);
|
||||
map.put("AGVStatusList", e);
|
||||
return null;
|
||||
});
|
||||
CompletableFuture<Void> allQuery = CompletableFuture.allOf(
|
||||
mixDayProductionTask,
|
||||
pressDayProductionTask,
|
||||
@@ -486,7 +506,8 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
manipulatorInfoTask,
|
||||
kilneye4InfoTask,
|
||||
KilnPassage2InfoTask,
|
||||
ioKilnTrussTask);
|
||||
ioKilnTrussTask,
|
||||
AGVStatusTask);
|
||||
CompletableFuture<ConcurrentHashMap<String, Object>> future
|
||||
= allQuery.thenApply((result) -> map).exceptionally((e) -> {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
Reference in New Issue
Block a user