diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/report/TemAndHumReportController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/report/TemAndHumReportController.java index a97e988..482c878 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/report/TemAndHumReportController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/report/TemAndHumReportController.java @@ -74,7 +74,11 @@ public class TemAndHumReportController extends BaseController { calendar.setTime(new Date()); calendar.add(Calendar.MINUTE, -10); if(t_W_Temperturedata.getMonitorId().equals("null")){ - t_W_Temperturedata.setMonitorId(getMonitorInfo().getMonitorId()); + String monitorId = getMonitorInfo().getMonitorId(); + if (StringUtils.isNotEmpty(monitorId)){ + t_W_Temperturedata.setMonitorId(monitorId); + } + return success(); } if(t_W_Temperturedata.getStartTime().equals("")){ Map timeMap = new HashMap<>(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_W_TemperturedataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_W_TemperturedataController.java index 33282d2..6239b7e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_W_TemperturedataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/T_W_TemperturedataController.java @@ -140,8 +140,10 @@ public class T_W_TemperturedataController extends BaseController */ public String getTempFirstMonitorId(){ List t_w_temperturedata = t_W_TemperturedataService.select_Temp_TopOne(); - String monitorId = t_w_temperturedata.get(0).getMonitorId(); - return monitorId; + if (t_w_temperturedata.size() > 0){ + return t_w_temperturedata.get(0).getMonitorId(); + } + return null; } /** @@ -150,8 +152,10 @@ public class T_W_TemperturedataController extends BaseController */ public String getIllFirstMonitorId(){ List t_w_temperturedata = t_W_TemperturedataService.select_Ill_TopOne(); - String monitorId = t_w_temperturedata.get(0).getMonitorId(); - return monitorId; + if (t_w_temperturedata.size() > 0){ + return t_w_temperturedata.get(0).getMonitorId(); + } + return null; } /** diff --git a/ruoyi-admin/src/main/resources/templates/report/TemAndHum.html b/ruoyi-admin/src/main/resources/templates/report/TemAndHum.html index fe83ce6..019dc02 100644 --- a/ruoyi-admin/src/main/resources/templates/report/TemAndHum.html +++ b/ruoyi-admin/src/main/resources/templates/report/TemAndHum.html @@ -159,7 +159,7 @@ function queryDeptTree() { - var url = ctx + "system/Monitor/treeData?monitorType=17"; + var url = ctx + "system/Monitor/treeData?monitorType=16"; var options = { url: url, expandLevel: 1,