|
|
@ -131,16 +131,6 @@ public class RecordSensorDataController {
|
|
|
|
recordStatisticalTemperature.setEndRecordTime(formatter.format(new Date()));
|
|
|
|
recordStatisticalTemperature.setEndRecordTime(formatter.format(new Date()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*List<BaseSensorInfoDto> baseSensorInfoDtos =
|
|
|
|
|
|
|
|
baseSensorInfoService.selectBaseSensorInfoList(
|
|
|
|
|
|
|
|
new BaseSensorInfo(recordStatisticalTemperature.getSensorId()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (baseSensorInfoDtos.size() > 0) {
|
|
|
|
|
|
|
|
recordStatisticalTemperature.setMonitorunitId(
|
|
|
|
|
|
|
|
baseSensorInfoDtos.get(baseSensorInfoDtos.size() - 1).getMonitorunitId());
|
|
|
|
|
|
|
|
recordStatisticalTemperature.setSensorId(null);
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String[] split = recordStatisticalTemperature.getSensorId().split(",");
|
|
|
|
String[] split = recordStatisticalTemperature.getSensorId().split(",");
|
|
|
|
List<RecordStatisticalTemperature> recordStatisticalTemperatureList = new ArrayList<>();
|
|
|
|
List<RecordStatisticalTemperature> recordStatisticalTemperatureList = new ArrayList<>();
|
|
|
|
for (String s : split) {
|
|
|
|
for (String s : split) {
|
|
|
@ -180,9 +170,18 @@ public class RecordSensorDataController {
|
|
|
|
series.add(seriesInfo);
|
|
|
|
series.add(seriesInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal minValue = null;
|
|
|
|
|
|
|
|
BigDecimal maxValue = null;
|
|
|
|
|
|
|
|
if(recordStatisticalTemperatureList.size() > 0){
|
|
|
|
|
|
|
|
RecordStatisticalTemperature recordStatisticalTemperature1 = recordStatisticalTemperatureList.stream().max(Comparator.comparing(RecordStatisticalTemperature::getSensorValue)).get();
|
|
|
|
|
|
|
|
RecordStatisticalTemperature recordStatisticalTemperature2 = recordStatisticalTemperatureList.stream().min(Comparator.comparing(RecordStatisticalTemperature::getSensorValue)).get();
|
|
|
|
|
|
|
|
minValue = recordStatisticalTemperature2.getSensorValue();
|
|
|
|
|
|
|
|
maxValue = recordStatisticalTemperature1.getSensorValue();
|
|
|
|
|
|
|
|
}
|
|
|
|
List<String> collect = xAxis.stream().distinct().collect(Collectors.toList());
|
|
|
|
List<String> collect = xAxis.stream().distinct().collect(Collectors.toList());
|
|
|
|
Collections.sort(collect);
|
|
|
|
Collections.sort(collect);
|
|
|
|
String s = JSONArray.toJSONString(new Root(legend, collect, series));
|
|
|
|
String s = JSONArray.toJSONString(new Root(minValue,maxValue,legend, collect, series));
|
|
|
|
|
|
|
|
|
|
|
|
return s;
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -201,12 +200,18 @@ class Root {
|
|
|
|
|
|
|
|
|
|
|
|
public Root() {}
|
|
|
|
public Root() {}
|
|
|
|
|
|
|
|
|
|
|
|
public Root(List<String> legend, List<String> xAxis, List<Series> series) {
|
|
|
|
public Root(BigDecimal minValue, BigDecimal maxValue, List<String> legend, List<String> xAxis, List<Series> series) {
|
|
|
|
|
|
|
|
this.minValue = minValue;
|
|
|
|
|
|
|
|
this.maxValue = maxValue;
|
|
|
|
this.legend = legend;
|
|
|
|
this.legend = legend;
|
|
|
|
this.xAxis = xAxis;
|
|
|
|
this.xAxis = xAxis;
|
|
|
|
this.series = series;
|
|
|
|
this.series = series;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private BigDecimal minValue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private BigDecimal maxValue;
|
|
|
|
|
|
|
|
|
|
|
|
private List<String> legend;
|
|
|
|
private List<String> legend;
|
|
|
|
|
|
|
|
|
|
|
|
private List<String> xAxis;
|
|
|
|
private List<String> xAxis;
|
|
|
|