From 50e563945835f21248c6eba4ffda177bb5945444 Mon Sep 17 00:00:00 2001 From: yinq Date: Thu, 5 Sep 2024 14:07:16 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E5=99=AA=E5=A3=B0=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/T_W_TemperturedataController.java | 37 +++ .../TempertureData/NoiseRealTimeMonitor.html | 225 ++++++++++++++++++ 2 files changed, 262 insertions(+) create mode 100644 ruoyi-admin/src/main/resources/templates/system/TempertureData/NoiseRealTimeMonitor.html 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