diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/enums/ErrorInfoEnum.java b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/enums/ErrorInfoEnum.java index 893b33f..c6c3242 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/enums/ErrorInfoEnum.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/enums/ErrorInfoEnum.java @@ -6,6 +6,7 @@ package org.nl.wms.cockpit.service.enums; * @Date: 2023/6/26 */ public enum ErrorInfoEnum { + no_error("0", ""), scram("1", "急停中"), LIGHT_CURTAIN_ALARM("2", "光幕报警"), BODY_ALARM("3", "本体报警"), 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 96a78d5..3cbb3b3 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 @@ -15,6 +15,7 @@ import org.nl.wms.cockpit.service.dto.*; import org.nl.wms.cockpit.service.enums.ColorEnum; import org.nl.wms.cockpit.service.enums.DeviceEnum; import org.nl.wms.cockpit.service.enums.DeviceStatusEnum; +import org.nl.wms.cockpit.service.enums.ErrorInfoEnum; import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.sch.task.util.TaskUtils; import org.nl.wms.util.MapOf; @@ -246,6 +247,13 @@ public class BigScreenServiceImpl implements BigScreenService { 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); + String realQty = object.getString("real_qty"); + if (ObjectUtil.isNotEmpty(realQty)) { + object.put("now_capacity", realQty); + } + } return data; }, pool); pressMachineTask.thenAccept(result -> { @@ -397,6 +405,71 @@ public class BigScreenServiceImpl implements BigScreenService { map.put("ManipulatorInfoList", null); return null; }); + // 16、窑口4个位置 + CompletableFuture kilneye4InfoTask = CompletableFuture.supplyAsync(() -> { + JSONArray res = new JSONArray(); + for (int i = 1; i <= 4; i++) { + String device = "JYHJ0" + i; + JSONObject d = new JSONObject(); + d.put("device_code", device); + res.add(d); + } + JSONObject devicesStatus = PointUpdateUtil.getDevicesStatus(res); +// JSONObject devicesStatus = null; + JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; + return data; + }, pool); + kilneye4InfoTask.thenAccept(result -> { + map.put("kilneye4InfoList", result); + }).exceptionally((e) -> { + log.error("窑4个位置: {}", e.getMessage(), e); + map.put("kilneye4InfoList", null); + return null; + }); + // 17、窑道2个位置 + CompletableFuture KilnPassage2InfoTask = CompletableFuture.supplyAsync(() -> { + JSONArray res = new JSONArray(); + JSONObject d1 = new JSONObject(); + JSONObject result = new JSONObject(); + d1.put("device_code", "LQD01"); + res.add(d1); + d1.put("device_code", "HCD01"); + res.add(d1); + 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 jsonObject = data.getJSONObject(i); + jsonObject.put("error_name", ErrorInfoEnum.getErrorInfoEnumByCode(jsonObject.getString("error")).getName()); + result.put(jsonObject.getString("device_code"), jsonObject); + } + return result; + }, pool); + KilnPassage2InfoTask.thenAccept(result -> { + map.put("KilnPassage2InfoList", result); + }).exceptionally((e) -> { + log.error("窑道2个位置: {}", e.getMessage(), e); + map.put("KilnPassage2InfoList", null); + return null; + }); + // 18、进窑桁架和出窑桁架 + CompletableFuture ioKilnTrussTask = CompletableFuture.supplyAsync(() -> { + JSONArray res = WQL.getWO("COCKPIT_PROCESS_PRODUCTION") + .addParamMap(MapOf.of("flag", "15")) + .process() + .getResultJSONArray(0); + JSONObject devicesStatus = PointUpdateUtil.getDevicesStatus(res); +// JSONObject devicesStatus = null; + JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; + return data; + }, pool); + ioKilnTrussTask.thenAccept(result -> { + map.put("IoKilnTrussTask", result); + }).exceptionally((e) -> { + log.error("进窑桁架和出窑桁架: {}", e.getMessage(), e); + map.put("IoKilnTrussTask", null); + return null; + }); CompletableFuture allQuery = CompletableFuture.allOf( mixDayProductionTask, pressDayProductionTask, @@ -410,7 +483,10 @@ public class BigScreenServiceImpl implements BigScreenService { trappedShelfTask, sortAndPalletizingTask, semiFinishedProductShelfTask, - manipulatorInfoTask); + manipulatorInfoTask, + kilneye4InfoTask, + KilnPassage2InfoTask, + ioKilnTrussTask); CompletableFuture> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { log.error(e.getMessage(), e); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql index cc280e7..cfc9d04 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/COCKPIT_PROCESS_PRODUCTION.wql @@ -345,3 +345,15 @@ ENDSELECT ENDPAGEQUERY ENDIF + + IF 输入.flag = "15" + PAGEQUERY + SELECT + d.device_code + FROM + `pdm_bi_device` d + WHERE d.region_code = 'SZ' AND d.device_model IN ('6', '8') + ORDER BY d.device_model + ENDSELECT + ENDPAGEQUERY + ENDIF