Browse Source

fix: 字段统一

master
李永德 1 year ago
parent
commit
874b7e63c3
  1. 21
      lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/BigScreenServiceImpl.java

21
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; JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
JSONObject jsonObject = data.getJSONObject(i); JSONObject jsonObject = data.getJSONObject(i);
jsonObject.put("device_status", DeviceStatusEnum.STANDBY.getCode());
String openTime = jsonObject.getString("open_time"); String openTime = jsonObject.getString("open_time");
jsonObject.put("open_time", openTime.substring(openTime.indexOf('-') + 1)); 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 = PointUpdateUtil.getDevicesStatus(res);
// JSONObject devicesStatus = null; // JSONObject devicesStatus = null;
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; 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; return data;
}, pool); }, pool);
manipulatorInfoTask.thenAccept(result -> { manipulatorInfoTask.thenAccept(result -> {
@ -820,8 +823,8 @@ public class BigScreenServiceImpl implements BigScreenService {
JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res; JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
JSONObject device = data.getJSONObject(i); JSONObject device = data.getJSONObject(i);
Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status"))
? device.getInteger("devices_status") ? device.getInteger("status")
: 0; : 0;
DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1);
device.put("device_status_name", deviceStatusEnumByCode.getDescription()); 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; JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
JSONObject device = data.getJSONObject(i); JSONObject device = data.getJSONObject(i);
Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status"))
? device.getInteger("devices_status") ? device.getInteger("status")
: 0; : 0;
DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1);
device.put("device_status_name", deviceStatusEnumByCode.getDescription()); 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; JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
JSONObject device = data.getJSONObject(i); JSONObject device = data.getJSONObject(i);
Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status"))
? device.getInteger("devices_status") ? device.getInteger("status")
: 0; : 0;
DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1);
device.put("device_status_name", deviceStatusEnumByCode.getDescription()); 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; JSONArray data = ObjectUtil.isNotEmpty(devicesStatus) ? devicesStatus.getJSONArray("data") : res;
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
JSONObject device = data.getJSONObject(i); JSONObject device = data.getJSONObject(i);
Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("devices_status")) Integer devicesStatus1 = ObjectUtil.isNotEmpty(device.getInteger("status"))
? device.getInteger("devices_status") ? device.getInteger("status")
: 0; : 0;
DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1); DeviceStatusEnum deviceStatusEnumByCode = DeviceStatusEnum.getDeviceStatusEnumByCode(devicesStatus1);
device.put("device_status_name", deviceStatusEnumByCode.getDescription()); device.put("device_status_name", deviceStatusEnumByCode.getDescription());

Loading…
Cancel
Save