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 56d4f69..02f1c3b 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 @@ -63,6 +63,9 @@ public class T_W_TemperturedataController extends BaseController case 40: url = "/noiseData"; break; + case 41: + url = "/NoiseRealTimeMonitor"; + break; default: break; } @@ -268,4 +271,38 @@ public class T_W_TemperturedataController extends BaseController { return toAjax(t_W_TemperturedataService.deleteT_W_TemperturedataByIds(ids)); } + + + /** + * 噪声实时监控 + * @param monitorId + * @return + */ + @PostMapping("/getRealNoiseData") + @ResponseBody + public String getRealNoiseData(String monitorId){ + List meterChartDataList = new ArrayList<>(); + JSONArray jsonArray = JSONArray.parseArray(monitorId); + for (int i = 0; i < jsonArray.size(); i++) { + //得到对象 + String monitorInfo = jsonArray.getString(i); + + MeterChartData meterChartData = new MeterChartData(); + T_W_Temperturedata t_w_temperturedata = new T_W_Temperturedata(); + + t_w_temperturedata.setMonitorId(monitorInfo); + T_W_Temperturedata info = t_W_TemperturedataService.selectTopOneData(t_w_temperturedata); + + if (StringUtils.isNotNull(info)){ + meterChartData.setValue(info.getNoise()); + meterChartData.setName(info.getMonitorId()); + meterChartData.setRefushTime(simpleDateFormat.format(info.getCollectTime())); + meterChartDataList.add(meterChartData); + } + + } + String result = JSONArray.toJSONString(meterChartDataList); + return result; + } + } diff --git a/ruoyi-admin/src/main/resources/templates/system/TempertureData/NoiseRealTimeMonitor.html b/ruoyi-admin/src/main/resources/templates/system/TempertureData/NoiseRealTimeMonitor.html new file mode 100644 index 0000000..04698cc --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/TempertureData/NoiseRealTimeMonitor.html @@ -0,0 +1,225 @@ + + + + + + + + + + +
+
+
+
+ 测控点信息 +
+
+ + + + +
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + +
+ +
+
+
+ + + + + + + + + + \ No newline at end of file