|
|
@@ -102,6 +102,9 @@ public class StatisticsDataController {
|
|
|
@GetMapping("/export")
|
|
|
@SaCheckPermission("statics:export")
|
|
|
public void exportStatisticsData(Integer type, Long startTime, Long endTime, HttpServletResponse response) {
|
|
|
+ if (startTime == null || endTime == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请选择导出的时间");
|
|
|
+ }
|
|
|
List<ExcelSheetAndData> excelSheetDataList = statisticsDataService.exportStatisticsDataByType(type, startTime, endTime);
|
|
|
excelSheetDataList = excelSheetDataList.stream().sorted(Comparator.comparing(ExcelSheetAndData::getSort)).collect(Collectors.toList());
|
|
|
EasyExcelUtils.createExcelStreamMutilByEasyExcel(response, excelSheetDataList, "订单统计数据", ExcelTypeEnum.XLSX, null);
|
|
|
@@ -112,6 +115,9 @@ public class StatisticsDataController {
|
|
|
*/
|
|
|
@GetMapping("/export/monthly/data")
|
|
|
public void exportMonthlyData(Long startTime, Long endTime, HttpServletResponse response) {
|
|
|
+ if (startTime == null || endTime == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请选择导出的时间");
|
|
|
+ }
|
|
|
List<ExcelSheetAndData> excelSheetDataList = statisticsDataService.exportMonthlyData(startTime, endTime);
|
|
|
excelSheetDataList = excelSheetDataList.stream().sorted(Comparator.comparing(ExcelSheetAndData::getSort)).collect(Collectors.toList());
|
|
|
EasyExcelUtils.createExcelStreamMutilByEasyExcel(response, excelSheetDataList, String.format("%s月业务数据", DateUtil.month(DateTime.of(startTime)) + 1), ExcelTypeEnum.XLSX, null);
|