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 @@ +