|
@@ -64,7 +64,9 @@ public class MonitorDataReportServiceImpl implements MonitorDataReportService {
|
|
|
List<MonitorDataChartReportValueDto> monitorDataChartReportValueDtos = monitorDataChartReportAttributeDto.getMonitorDataChartReportValue();
|
|
|
Integer maxValue =0;
|
|
|
LocalDateTime localDateTime=LocalDateTime.now();
|
|
|
+ Integer growingBase = 1;
|
|
|
if(type != null && type ==3){
|
|
|
+ growingBase = 0;
|
|
|
maxValue = 24;
|
|
|
localDateTime=LocalDateTime.of(year,month,day,0,0,0);
|
|
|
}else if(type != null && type ==2){
|
|
@@ -78,16 +80,32 @@ public class MonitorDataReportServiceImpl implements MonitorDataReportService {
|
|
|
if(i == monitorDataChartReportValueDtos.size()){
|
|
|
MonitorDataChartReportValueDto monitorDataChartReportValueDto = new MonitorDataChartReportValueDto();
|
|
|
monitorDataChartReportValueDto.setData(0.0);
|
|
|
- monitorDataChartReportValueDto.setDate(localDateTime);
|
|
|
- monitorDataChartReportValueDto.setDateLabel(i+1);
|
|
|
+ if(type != null && type ==3){
|
|
|
+ monitorDataChartReportValueDto.setDate(localDateTime.plusHours(i));
|
|
|
+ }
|
|
|
+ if(type != null && type ==2){
|
|
|
+ monitorDataChartReportValueDto.setDate(localDateTime.plusDays(i));
|
|
|
+ }
|
|
|
+ if(type != null && type ==1){
|
|
|
+ monitorDataChartReportValueDto.setDate(localDateTime.plusMonths(i));
|
|
|
+ }
|
|
|
+ monitorDataChartReportValueDto.setDateLabel(i+growingBase);
|
|
|
monitorDataChartReportValueDto.setMonitorData("");
|
|
|
monitorDataChartReportValueDtos.add(i,monitorDataChartReportValueDto);
|
|
|
}else
|
|
|
- if(!monitorDataChartReportValueDtos.get(i).getDateLabel().equals(i+1)){
|
|
|
+ if(!monitorDataChartReportValueDtos.get(i).getDateLabel().equals(i+growingBase)){
|
|
|
MonitorDataChartReportValueDto monitorDataChartReportValueDto = new MonitorDataChartReportValueDto();
|
|
|
monitorDataChartReportValueDto.setData(0.0);
|
|
|
- monitorDataChartReportValueDto.setDate(localDateTime);
|
|
|
- monitorDataChartReportValueDto.setDateLabel(i+1);
|
|
|
+ if(type != null && type ==3){
|
|
|
+ monitorDataChartReportValueDto.setDate(localDateTime.plusHours(i));
|
|
|
+ }
|
|
|
+ if(type != null && type ==2){
|
|
|
+ monitorDataChartReportValueDto.setDate(localDateTime.plusDays(i));
|
|
|
+ }
|
|
|
+ if(type != null && type ==1){
|
|
|
+ monitorDataChartReportValueDto.setDate(localDateTime.plusMonths(i));
|
|
|
+ }
|
|
|
+ monitorDataChartReportValueDto.setDateLabel(i+growingBase);
|
|
|
monitorDataChartReportValueDto.setMonitorData("");
|
|
|
monitorDataChartReportValueDtos.add(i,monitorDataChartReportValueDto);
|
|
|
}
|