日计划下载,月报下载
This commit is contained in:
parent
12376f7c48
commit
9ba46feeb5
|
|
@ -43,17 +43,13 @@ public class DownloadController {
|
|||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDate start = LocalDate.parse(startDate, formatter);
|
||||
LocalDate end = LocalDate.parse(endDate, formatter);
|
||||
boolean isSameYear = start.getYear() == end.getYear();
|
||||
if (isSameYear) {
|
||||
// 计算天数差(绝对值防止传反)
|
||||
long daysDiff = Math.abs(ChronoUnit.DAYS.between(start, end));
|
||||
if (daysDiff <= 31) {
|
||||
downloadService.downloadExcelDayPlanStatistics(request, response, dto);
|
||||
} else {
|
||||
throw new ServiceException("当前仅支持导出间隔31天内的统计数据,请修改日期范围。");
|
||||
}
|
||||
// boolean isSameYear = start.getYear() == end.getYear();
|
||||
// 计算天数差(绝对值防止传反)
|
||||
long daysDiff = Math.abs(ChronoUnit.DAYS.between(start, end));
|
||||
if (daysDiff <= 31) {
|
||||
downloadService.downloadExcelDayPlanStatistics(request, response, dto);
|
||||
} else {
|
||||
throw new ServiceException("当前仅支持导出同一年内的统计数据,请修改日期范围。");
|
||||
throw new ServiceException("当前仅支持导出间隔31天内的统计数据,请修改日期范围。");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue