|
@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -173,11 +174,8 @@ public class DayMonthYearReportController {
|
|
|
iPage = reportService.getPipeDevicePressReportByDeviceIds(new Page<>(1, 1000000), queryDto);
|
|
|
}
|
|
|
List<ReportVo> list = iPage.getRecords();
|
|
|
- if (CollectionUtil.isEmpty(list)){
|
|
|
- throw BusinessException.builder(WaterErrorEnum.OBJECT_ERROR);
|
|
|
- }
|
|
|
- List<List<String>> reportTitle = ReportExcelUtil.toExcelTitleList(list.get(0).getReportTitle(), queryDto.getSceneType(),0);
|
|
|
- EasyExcelUtil.excelWriteWithHeader(response, SceneEnum.getMsg(queryDto.getSceneType()) +"报表", reportTitle, ReportExcelUtil.toReportExcelDto(list,queryDto.getSceneType()));
|
|
|
+ List<List<String>> reportTitle = ReportExcelUtil.toExcelTitleList(list.get(0).getReportTitle(), queryDto.getSceneType(),0);
|
|
|
+ EasyExcelUtil.excelWriteWithHeader(response, SceneEnum.getMsg(queryDto.getSceneType()) +"报表", reportTitle, ReportExcelUtil.toReportExcelDto(list, queryDto.getSceneType()));
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/export/historyDataExcel", method = RequestMethod.GET)
|
|
@@ -194,9 +192,6 @@ public class DayMonthYearReportController {
|
|
|
iPage = reportService.getPipeHistoryDataDevicePressReportByDeviceIds(new Page<>(1, 1000000), queryDto);
|
|
|
}
|
|
|
List<ReportVo> list = iPage.getRecords();
|
|
|
- if (CollectionUtil.isEmpty(list)) {
|
|
|
- throw BusinessException.builder(WaterErrorEnum.OBJECT_ERROR);
|
|
|
- }
|
|
|
List<List<String>> reportTitle = ReportExcelUtil.toHistoryDataExcelTitleList(list.get(0).getReportTitle(), queryDto.getSceneType(),1);
|
|
|
EasyExcelUtil.excelWriteWithHeader(response, SceneEnum.getMsg(queryDto.getSceneType()) +"报表", reportTitle, ReportExcelUtil.toHisoryDataReportExcelDto(list, queryDto.getSceneType()));
|
|
|
}
|