日计划下载,月报下载
This commit is contained in:
parent
d4185060f6
commit
8053be7e3a
|
|
@ -43,8 +43,7 @@ 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) {
|
||||
// boolean isSameYear = start.getYear() == end.getYear();
|
||||
// 计算天数差(绝对值防止传反)
|
||||
long daysDiff = Math.abs(ChronoUnit.DAYS.between(start, end));
|
||||
if (daysDiff <= 31) {
|
||||
|
|
@ -52,9 +51,6 @@ public class DownloadController {
|
|||
} else {
|
||||
throw new ServiceException("当前仅支持导出间隔31天内的统计数据,请修改日期范围。");
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException("当前仅支持导出同一年内的统计数据,请修改日期范围。");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue