From e9894f2c0bf1df98bef8ea29b0e2e327ab9a1398 Mon Sep 17 00:00:00 2001 From: wenjy Date: Wed, 11 May 2022 15:10:18 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E8=AE=BE=E5=A4=87=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E6=B8=A9=E5=BA=A6=E6=9B=B2=E7=BA=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../record/RecordSensorDataController.java | 31 +++++++++++---- .../recordSensorData/temperatureTrend.html | 38 ++++++++++++++++++- .../mapper/system/RecordSensorDataMapper.xml | 16 +++++++- 3 files changed, 75 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordSensorDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordSensorDataController.java index 156ab1a..88a60ab 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordSensorDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/RecordSensorDataController.java @@ -49,6 +49,16 @@ public class RecordSensorDataController { @GetMapping("/getTemperatureTrend") public String getTemperatureTrend(@RequestParam("id") String id, ModelMap mmap) { mmap.put("sensorId", id); + + String s = id.split(",")[0]; + + List baseSensorInfoDtos = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(id.split(",")[0])); + + if(baseSensorInfoDtos.size()>0){ + List baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(null, null, null, baseSensorInfoDtos.get(0).getMonitorunitId())); + mmap.put("type", baseSensorInfoDtos1); + } + return prefix + "/temperatureTrend"; } @@ -121,7 +131,7 @@ public class RecordSensorDataController { recordStatisticalTemperature.setEndRecordTime(formatter.format(new Date())); } - List baseSensorInfoDtos = + /*List baseSensorInfoDtos = baseSensorInfoService.selectBaseSensorInfoList( new BaseSensorInfo(recordStatisticalTemperature.getSensorId())); @@ -129,15 +139,22 @@ public class RecordSensorDataController { recordStatisticalTemperature.setMonitorunitId( baseSensorInfoDtos.get(baseSensorInfoDtos.size() - 1).getMonitorunitId()); recordStatisticalTemperature.setSensorId(null); - } + }*/ - List recordStatisticalTemperatures = - iRecordSensorDataService.selectRecordStatisticalTemperatureList( - recordStatisticalTemperature); + String[] split = recordStatisticalTemperature.getSensorId().split(","); + List recordStatisticalTemperatureList = new ArrayList<>(); + for (String s : split) { + recordStatisticalTemperature.setSensorId(s); + List recordStatisticalTemperatures = + iRecordSensorDataService.selectRecordStatisticalTemperatureList( + recordStatisticalTemperature); + + recordStatisticalTemperatureList.addAll(recordStatisticalTemperatures); + } - if (recordStatisticalTemperatures.size() > 0) { + if (recordStatisticalTemperatureList.size() > 0) { Map> collect = - recordStatisticalTemperatures.stream() + recordStatisticalTemperatureList.stream() .collect(Collectors.groupingBy(RecordStatisticalTemperature::getSensorName)); for (Map.Entry> stringListEntry : diff --git a/ruoyi-admin/src/main/resources/templates/record/recordSensorData/temperatureTrend.html b/ruoyi-admin/src/main/resources/templates/record/recordSensorData/temperatureTrend.html index 3344f03..7712279 100644 --- a/ruoyi-admin/src/main/resources/templates/record/recordSensorData/temperatureTrend.html +++ b/ruoyi-admin/src/main/resources/templates/record/recordSensorData/temperatureTrend.html @@ -2,6 +2,24 @@ + + +
@@ -31,6 +49,13 @@ +
  • + + +
  • +
  •  搜索 @@ -64,6 +89,7 @@ +