Commit b084cad1 by 吕明尚

修改续单问题

parent 49480d70
...@@ -100,9 +100,10 @@ public class RoomStatusServiceImpl implements RoomStatusService { ...@@ -100,9 +100,10 @@ public class RoomStatusServiceImpl implements RoomStatusService {
if (orderType.equals(OrderTypeEnum.RENEW.getCode())) { if (orderType.equals(OrderTypeEnum.RENEW.getCode())) {
if (CollectionUtils.isNotEmpty(orderList)) { if (CollectionUtils.isNotEmpty(orderList)) {
//查询当前用户是否有使用中的订单 //查询当前用户是否有使用中的订单
orderList = orderList.stream().filter(order -> order.getConsumerId().compareTo(user.getId()) == 0 && order.getStatus().equals(OrderStatusEnum.INUSE.getCode())).collect(Collectors.toList()); List<SOrder> newOrderList = orderList.stream().filter(order -> order.getConsumerId().compareTo(user.getId()) == 0 && order.getStatus().equals(OrderStatusEnum.INUSE.getCode())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(orderList)) { if (CollectionUtils.isNotEmpty(newOrderList)) {
isAvailable = true; //判断orderList中是否有预约订单
isAvailable = !newOrderList.stream().anyMatch(order -> order.getOrderType().equals(OrderTypeEnum.RESERVER.getCode()));
} else { } else {
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SOrder::getRoomId, room.getId()); queryWrapper.eq(SOrder::getRoomId, room.getId());
......
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