|
@@ -1,6 +1,7 @@
|
|
|
package com.huaxu.controller;
|
|
|
|
|
|
import com.huaxu.dto.MonitorDataChartReportDeviceDto;
|
|
|
+import com.huaxu.dto.MonitorDataChartReportValueDto;
|
|
|
import com.huaxu.dto.generalView.*;
|
|
|
import com.huaxu.entity.DeviceEntity;
|
|
|
import com.huaxu.model.AjaxMessage;
|
|
@@ -16,6 +17,8 @@ import java.time.LocalDate;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @description
|
|
@@ -73,9 +76,13 @@ public class MonitorDataReportController {
|
|
|
//报警(报警次数)
|
|
|
List<MonitorDataChartReportDeviceDto> alarm = monitorDataReportService.deviceAlarmReport(reportType,sceneIds,localDate.getYear(),localDate.getMonthValue(),localDate.getDayOfMonth());
|
|
|
|
|
|
+ Map<String,MonitorDataChartReportDeviceDto> map = consumption.stream().collect(Collectors.toMap(MonitorDataChartReportDeviceDto::getDeviceName, a -> a,(k1, k2)->k1));
|
|
|
+ for (MonitorDataChartReportDeviceDto energyDto: energy) {
|
|
|
+ MonitorDataChartReportDeviceDto reportDeviceDto = map.get(energyDto.getDeviceName());
|
|
|
+ energyDto.getAttributeData().addAll(reportDeviceDto.getAttributeData());
|
|
|
+ }
|
|
|
reportList.add(energy);
|
|
|
reportList.add(quality);
|
|
|
- reportList.add(consumption);
|
|
|
reportList.add(alarm);
|
|
|
}
|
|
|
return new AjaxMessage<>(ResultStatus.OK, reportList);
|