|
@@ -198,10 +198,10 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
long mainCount = item.getRoomIds().stream().filter(t->t.getIsMain()!=null&&t.getIsMain()).count();
|
|
long mainCount = item.getRoomIds().stream().filter(t->t.getIsMain()!=null&&t.getIsMain()).count();
|
|
|
|
|
|
|
|
item.getRoomIds().forEach(c->{
|
|
item.getRoomIds().forEach(c->{
|
|
|
- CesRooms room = roomsService.getById(c.getRoomId());
|
|
|
|
|
- if(room == null) throw new JeecgBootException("房间不存在");
|
|
|
|
|
- room.setBookingOrderId(bookingId);
|
|
|
|
|
- roomsService.updateById(room);
|
|
|
|
|
|
|
+// CesRooms room = roomsService.getById(c.getRoomId());
|
|
|
|
|
+// if(room == null) throw new JeecgBootException("房间不存在");
|
|
|
|
|
+// room.setBookingOrderId(bookingId);
|
|
|
|
|
+// roomsService.updateById(room);
|
|
|
|
|
|
|
|
BusBookingRooms bookingRoomsItem = new BusBookingRooms();
|
|
BusBookingRooms bookingRoomsItem = new BusBookingRooms();
|
|
|
bookingRoomsItem.setBookingOrdersId(bookingId);
|
|
bookingRoomsItem.setBookingOrdersId(bookingId);
|
|
@@ -1083,7 +1083,10 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
Optional<BusRoomsLivingOrder> opMainRoomOrder = livingOrders.stream().filter(s->s.getBookingRoomId().equals(mainRoom.getId())).findFirst();
|
|
Optional<BusRoomsLivingOrder> opMainRoomOrder = livingOrders.stream().filter(s->s.getBookingRoomId().equals(mainRoom.getId())).findFirst();
|
|
|
if(!opMainRoomOrder.isPresent()) throw new JeecgBootException("没有找到主房订单");
|
|
if(!opMainRoomOrder.isPresent()) throw new JeecgBootException("没有找到主房订单");
|
|
|
BusRoomsLivingOrder mainRoomOrder = opMainRoomOrder.get();
|
|
BusRoomsLivingOrder mainRoomOrder = opMainRoomOrder.get();
|
|
|
- livingOrders.forEach(s->s.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey()));
|
|
|
|
|
|
|
+ livingOrders.forEach(s->{
|
|
|
|
|
+ s.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey());
|
|
|
|
|
+ s.setIsUnionSettled(s.getId().equals(mainRoomOrder.getId())?0:1);
|
|
|
|
|
+ });
|
|
|
roomsLivingOrderService.updateBatchById(livingOrders);
|
|
roomsLivingOrderService.updateBatchById(livingOrders);
|
|
|
if(livingOrders.size() > 0) {
|
|
if(livingOrders.size() > 0) {
|
|
|
List<BusOrderFee> feeItems = getLivingOrderFee(bookingOrderId).stream().filter(
|
|
List<BusOrderFee> feeItems = getLivingOrderFee(bookingOrderId).stream().filter(
|
|
@@ -1244,6 +1247,30 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
public IPage<RoomLivingQueryVo> getLivingPageData(Integer status,String keyw, Page<RoomLivingQueryVo> page) {
|
|
public IPage<RoomLivingQueryVo> getLivingPageData(Integer status,String keyw, Page<RoomLivingQueryVo> page) {
|
|
|
return baseMapper.getPage(page,status,keyw);
|
|
return baseMapper.getPage(page,status,keyw);
|
|
|
}
|
|
}
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public IPage<KeLiItemVo> getLivingOrderKL(Integer status,String keyw,String hotelId, Page<KeLiItemVo> page) {
|
|
|
|
|
+ IPage<KeLiItemVo> pRes = baseMapper.getKeLiLiving(page,hotelId,keyw,status);
|
|
|
|
|
+ List<String> livingIds = pRes.getRecords().stream().map(s->s.getId()).collect(Collectors.toList());
|
|
|
|
|
+ List<BusLivingLayoutDayPrice> prices = livingIds.size() >0? livingLayoutDayPriceService.list(Wrappers.<BusLivingLayoutDayPrice>query()
|
|
|
|
|
+ .in("living_order_id",livingIds)) : new ArrayList<>();
|
|
|
|
|
+ pRes.getRecords().forEach(s->{
|
|
|
|
|
+ List<BusLivingLayoutDayPrice> orderDayPrice = prices.stream().filter(a->a.getLivingOrderId().equals(s.getId())).collect(Collectors.toList());
|
|
|
|
|
+ s.setLivingDayPrices(orderDayPrice);
|
|
|
|
|
+ });
|
|
|
|
|
+ return pRes;
|
|
|
|
|
+ }
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public IPage<KeLiItemVo> getBookingOrderKL(Integer status,String keyw,String hotelId, Page<KeLiItemVo> page) {
|
|
|
|
|
+ IPage<KeLiItemVo> pRes = baseMapper.getKeBooking(page,hotelId,keyw,status);
|
|
|
|
|
+ List<String> livingIds = pRes.getRecords().stream().map(s->s.getId()).collect(Collectors.toList());
|
|
|
|
|
+ List<BusBookingLayoutDayPrice> prices = livingIds.size() >0? dayPriceService.list(Wrappers.<BusBookingLayoutDayPrice>query()
|
|
|
|
|
+ .in("booking_order_id",livingIds)) : new ArrayList<>();
|
|
|
|
|
+ pRes.getRecords().forEach(s->{
|
|
|
|
|
+ List<BusBookingLayoutDayPrice> orderDayPrice = prices.stream().filter(a->a.getBookingOrderId().equals(s.getId()) && a.getRoomLayoutId().equals(s.getLayoutId())).collect(Collectors.toList());
|
|
|
|
|
+ s.setBookingDayPrices(orderDayPrice);
|
|
|
|
|
+ });
|
|
|
|
|
+ return pRes;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|