diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java index 96d9aaa..31062e8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/AbsorbDeviceMesController.java @@ -125,6 +125,28 @@ public class AbsorbDeviceMesController { deviceinfos.setRunTime("0"); deviceinfos.setCount(0); deviceinfos.setLossTime("0"); + }else{ + if(deviceinfos.getDevicePower() == null){ + deviceinfos.setDevicePower("0"); + } + if(deviceinfos.getDeviceEnergy() == null){ + deviceinfos.setDeviceEnergy("0"); + } + if(deviceinfos.getDeviceTakt() == null){ + deviceinfos.setDeviceTakt("0"); + } + if(deviceinfos.getDeviceStatus() == null){ + deviceinfos.setDeviceStatus("异常"); + } + if(deviceinfos.getOpenTime() == null){ + deviceinfos.setOpenTime("0"); + } + if(deviceinfos.getRunTime() == null){ + deviceinfos.setRunTime("0"); + } + if(deviceinfos.getLossTime() == null){ + deviceinfos.setLossTime("0"); + } } return deviceinfos; } @@ -182,9 +204,11 @@ public class AbsorbDeviceMesController { @PostMapping("/DeviceAlarmCount") public String getDeviceAlarmCount() { - // System.out.println("时间:"+ new Date()); String DeviceAlarmCount = ""; DeviceAlarmCount = KBAdsorbDeviceinfoService.getAdsorbDeviceAlarmCount(); + if(DeviceAlarmCount == null){ + DeviceAlarmCount = "0"; + } return DeviceAlarmCount; }