Commit a074d36b by 吕明尚

订单下单查询预约时间增加查询情况

parent 7b06fa9c
...@@ -1527,9 +1527,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1527,9 +1527,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw new BaseException("订单类型异常!"); throw new BaseException("订单类型异常!");
} }
List<SOrder> orderList = list(queryWrapper); List<SOrder> orderList = list(queryWrapper);
List<SOrder> sOrderList = list(sOrderLambdaQueryWrapper);
List<SOrder> orders = list(orderLambdaQueryWrapper);
if (CollectionUtils.isNotEmpty(orderList)) { if (CollectionUtils.isNotEmpty(orderList)) {
Optional<SOrder> lastOrderOp = orderList.stream().max(Comparator.comparing(SOrder::getPreEndDate)); Optional<SOrder> lastOrderOp = orderList.stream().max(Comparator.comparing(SOrder::getPreEndDate));
SOrder lastOrder = lastOrderOp.orElse(null); SOrder lastOrder = lastOrderOp.orElse(null);
...@@ -1558,8 +1555,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1558,8 +1555,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
} }
throw new BaseException("下单时间已被预定!"); throw new BaseException("下单时间已被预定!");
} }
if (CollectionUtils.isNotEmpty(sOrderList) || CollectionUtils.isNotEmpty(orders)) { if (request.getOrderType().equals(OrderTypeEnum.RESERVER.getCode())) {
throw new BaseException("下单时间已被预定!"); List<SOrder> sOrderList = list(sOrderLambdaQueryWrapper);
List<SOrder> orders = list(orderLambdaQueryWrapper);
if (CollectionUtils.isNotEmpty(sOrderList) || CollectionUtils.isNotEmpty(orders)) {
throw new BaseException("下单时间已被预定!");
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment