|
|
|
@ -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<BaseSensorInfoDto> baseSensorInfoDtos = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(id.split(",")[0]));
|
|
|
|
|
|
|
|
|
|
if(baseSensorInfoDtos.size()>0){
|
|
|
|
|
List<BaseSensorInfoDto> 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<BaseSensorInfoDto> baseSensorInfoDtos =
|
|
|
|
|
/*List<BaseSensorInfoDto> 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<RecordStatisticalTemperature> recordStatisticalTemperatures =
|
|
|
|
|
iRecordSensorDataService.selectRecordStatisticalTemperatureList(
|
|
|
|
|
recordStatisticalTemperature);
|
|
|
|
|
String[] split = recordStatisticalTemperature.getSensorId().split(",");
|
|
|
|
|
List<RecordStatisticalTemperature> recordStatisticalTemperatureList = new ArrayList<>();
|
|
|
|
|
for (String s : split) {
|
|
|
|
|
recordStatisticalTemperature.setSensorId(s);
|
|
|
|
|
List<RecordStatisticalTemperature> recordStatisticalTemperatures =
|
|
|
|
|
iRecordSensorDataService.selectRecordStatisticalTemperatureList(
|
|
|
|
|
recordStatisticalTemperature);
|
|
|
|
|
|
|
|
|
|
recordStatisticalTemperatureList.addAll(recordStatisticalTemperatures);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (recordStatisticalTemperatures.size() > 0) {
|
|
|
|
|
if (recordStatisticalTemperatureList.size() > 0) {
|
|
|
|
|
Map<String, List<RecordStatisticalTemperature>> collect =
|
|
|
|
|
recordStatisticalTemperatures.stream()
|
|
|
|
|
recordStatisticalTemperatureList.stream()
|
|
|
|
|
.collect(Collectors.groupingBy(RecordStatisticalTemperature::getSensorName));
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, List<RecordStatisticalTemperature>> stringListEntry :
|
|
|
|
|