订单查询增加userId参数筛选
This commit is contained in:
@@ -108,6 +108,10 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
predicate = criteriaBuilder.and(predicate, criteriaBuilder.notEqual(root.get("orderType"), "return"));
|
||||
}
|
||||
|
||||
if (criteria.getUserId() != null && criteria.getUserId() != 0) {
|
||||
predicate = criteriaBuilder.and(predicate, criteriaBuilder.equal(root.get("userId"), criteria.getUserId()));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(criteria.getProductName())) {
|
||||
Date startTime, endTime;
|
||||
DateTime offsetMonth = cn.hutool.core.date.DateUtil.offsetMonth(new Date(), 3);
|
||||
@@ -120,11 +124,6 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
|
||||
startTime = new Date(startLong);
|
||||
endTime = new Date(endLong);
|
||||
|
||||
// 如果开始时间小于三个月前,不查询
|
||||
// if (startTime.before(offsetMonth)) {
|
||||
// throw new BadRequestException("查询时间范围不能超过三个月");
|
||||
// }
|
||||
} else {
|
||||
startTime = offsetMonth;
|
||||
endTime = new Date();
|
||||
|
||||
Reference in New Issue
Block a user