From 874b7e63c3e9d3ed60ddadc00f85b7cc8dbcf40e Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Tue, 27 Jun 2023 15:00:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=97=E6=AE=B5=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BigScreenServiceImpl.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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 170c534..2c904ba 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 @@ -265,7 +265,6 @@ public class BigScreenServiceImpl implements BigScreenService { JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; for (int i = 0; i < data.size(); i++) { JSONObject jsonObject = data.getJSONObject(i); - jsonObject.put("device_status", DeviceStatusEnum.STANDBY.getCode()); String openTime = jsonObject.getString("open_time"); jsonObject.put("open_time", openTime.substring(openTime.indexOf('-') + 1)); } @@ -384,6 +383,10 @@ 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); + object.put("color_status", ColorEnum.getColorEnumByIndex(object.getInteger("status"))); + } return data; }, pool); manipulatorInfoTask.thenAccept(result -> { @@ -820,8 +823,8 @@ public class BigScreenServiceImpl implements BigScreenService { JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; for (int i = 0; i < data.size(); i++) { JSONObject device = data.getJSONObject(i); - Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) - ? device.getInteger("devices_status") + Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status")) + ? device.getInteger("status") : 0; DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); device.put("device_status_name", deviceStatusEnumByCode.getDescription()); @@ -946,8 +949,8 @@ public class BigScreenServiceImpl implements BigScreenService { JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; for (int i = 0; i < data.size(); i++) { JSONObject device = data.getJSONObject(i); - Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) - ? device.getInteger("devices_status") + Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status")) + ? device.getInteger("status") : 0; DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); device.put("device_status_name", deviceStatusEnumByCode.getDescription()); @@ -986,8 +989,8 @@ public class BigScreenServiceImpl implements BigScreenService { JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; for (int i = 0; i < data.size(); i++) { JSONObject device = data.getJSONObject(i); - Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) - ? device.getInteger("devices_status") + Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status")) + ? device.getInteger("status") : 0; DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); device.put("device_status_name", deviceStatusEnumByCode.getDescription()); @@ -1276,8 +1279,8 @@ public class BigScreenServiceImpl implements BigScreenService { JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; for (int i = 0; i < data.size(); i++) { JSONObject device = data.getJSONObject(i); - Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) - ? device.getInteger("devices_status") + Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status")) + ? device.getInteger("status") : 0; DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); device.put("device_status_name", deviceStatusEnumByCode.getDescription());