From 3625c88ec1c185c301b3ce302762c179bf455d6a Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Tue, 4 Jul 2023 18:37:32 +0800 Subject: [PATCH] =?UTF-8?q?add:=20agv=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BigScreenServiceImpl.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java index 3cbb3b3..507d8ef 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java @@ -470,6 +470,26 @@ public class BigScreenServiceImpl implements BigScreenService { map.put("IoKilnTrussTask", null); return null; }); + // 19、AGV数据 + CompletableFuture 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 allQuery = CompletableFuture.allOf( mixDayProductionTask, pressDayProductionTask, @@ -486,7 +506,8 @@ public class BigScreenServiceImpl implements BigScreenService { manipulatorInfoTask, kilneye4InfoTask, KilnPassage2InfoTask, - ioKilnTrussTask); + ioKilnTrussTask, + AGVStatusTask); CompletableFuture> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { log.error(e.getMessage(), e);