From 483104bba19384568b4f4c5e91704156f5861f9c Mon Sep 17 00:00:00 2001 From: wenjy Date: Sun, 11 Dec 2022 22:45:56 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E8=AE=BE=E5=A4=87=E6=95=85?= =?UTF-8?q?=E9=9A=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scada/AbsorbDeviceMesController.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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; }