日期校验问题
This commit is contained in:
@@ -103,6 +103,9 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
Date startTime, endTime;
|
||||
DateTime offsetMonth = cn.hutool.core.date.DateUtil.offsetMonth(new Date(), 3);
|
||||
if (criteria.getCreatedAt() != null && criteria.getCreatedAt().size() == 2) {
|
||||
if (criteria.getCreatedAt().get(0) < System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 90L) {
|
||||
throw new BadRequestException("查询时间范围不能超过三个月");
|
||||
}
|
||||
Long startLong = criteria.getCreatedAt().get(0);
|
||||
Long endLong = criteria.getCreatedAt().get(1);
|
||||
|
||||
@@ -110,9 +113,9 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
endTime = new Date(endLong);
|
||||
|
||||
// 如果开始时间小于三个月前,不查询
|
||||
if (startTime.before(offsetMonth)) {
|
||||
throw new BadRequestException("查询时间范围不能超过三个月");
|
||||
}
|
||||
// if (startTime.before(offsetMonth)) {
|
||||
// throw new BadRequestException("查询时间范围不能超过三个月");
|
||||
// }
|
||||
} else {
|
||||
startTime = offsetMonth;
|
||||
endTime = new Date();
|
||||
|
||||
Reference in New Issue
Block a user