|
|
@@ -870,7 +870,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers, String hotelId) {
|
|
|
+ public String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers, String hotelId, Boolean bookingLiving) {
|
|
|
BusBookingRooms bkRoom = bookingRoomsService.getById(bookingRoomId);
|
|
|
if(bkRoom == null) throw new JeecgBootException("关联房间不存在");
|
|
|
BusRoomBookingOrders bookingOrders = getById(bkRoom.getBookingOrdersId());
|
|
|
@@ -938,31 +938,33 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
//</editor-fold>
|
|
|
|
|
|
//<editor-fold desc="todo:账单相关">
|
|
|
-// BigDecimal money = new BigDecimal(0);
|
|
|
-// BusLivingLayoutDayPrice price = livingLayoutDayPriceService.getOne(Wrappers.<BusLivingLayoutDayPrice>query()
|
|
|
-// .eq("living_order_id", livingOrder.getId()).eq("day_time",DateUtils.formatDate(new Date())+" 00:00:00"));
|
|
|
-// if(price != null) {
|
|
|
-// money = price.getPrice();
|
|
|
-// } else {
|
|
|
-// CesRoomLayout layout = layoutService.getById(room.getLayoutId());
|
|
|
-// if(layout == null) throw new JeecgBootException("房价不存在");
|
|
|
-// money = layout.getMarketPrice();
|
|
|
-// }
|
|
|
-//
|
|
|
-// BusOrderFee dayOrderFee = new BusOrderFee();
|
|
|
-// dayOrderFee.setDayTime(new Date());
|
|
|
-// dayOrderFee.setCreateTime(new Date());
|
|
|
-// dayOrderFee.setMoney(money);
|
|
|
-// dayOrderFee.setFeeType(1);
|
|
|
-// dayOrderFee.setSubjectType(FeeSubjectType.MEI_RI_FANG_FEI.getKey());
|
|
|
-// CesRooms orderRoom = room;
|
|
|
-// dayOrderFee.setRoomId(orderRoom.getId());
|
|
|
-// String roomName = orderRoom.getPrefix() != null?orderRoom.getPrefix():"";
|
|
|
-// roomName += roomName + orderRoom.getName();
|
|
|
-// dayOrderFee.setRemark("【"+roomName + "】 "+ DateUtils.formatDate(dayOrderFee.getDayTime()) + " 当日房费");
|
|
|
-// dayOrderFee.setLivingOrderId(livingOrder.getId());
|
|
|
-// dayOrderFee.setHotelId(hotelId);
|
|
|
-// feeService.save(dayOrderFee);
|
|
|
+ if(bookingLiving != null && bookingLiving) {
|
|
|
+ BigDecimal money = new BigDecimal(0);
|
|
|
+ BusLivingLayoutDayPrice price = livingLayoutDayPriceService.getOne(Wrappers.<BusLivingLayoutDayPrice>query()
|
|
|
+ .eq("living_order_id", livingOrder.getId()).eq("day_time",DateUtils.formatDate(new Date())+" 00:00:00"));
|
|
|
+ if(price != null) {
|
|
|
+ money = price.getPrice();
|
|
|
+ } else {
|
|
|
+ CesRoomLayout layout = layoutService.getById(room.getLayoutId());
|
|
|
+ if(layout == null) throw new JeecgBootException("房价不存在");
|
|
|
+ money = layout.getMarketPrice();
|
|
|
+ }
|
|
|
+
|
|
|
+ BusOrderFee dayOrderFee = new BusOrderFee();
|
|
|
+ dayOrderFee.setDayTime(new Date());
|
|
|
+ dayOrderFee.setCreateTime(new Date());
|
|
|
+ dayOrderFee.setMoney(money);
|
|
|
+ dayOrderFee.setFeeType(1);
|
|
|
+ dayOrderFee.setSubjectType(FeeSubjectType.MEI_RI_FANG_FEI.getKey());
|
|
|
+ CesRooms orderRoom = room;
|
|
|
+ dayOrderFee.setRoomId(orderRoom.getId());
|
|
|
+ String roomName = orderRoom.getPrefix() != null?orderRoom.getPrefix():"";
|
|
|
+ roomName += roomName + orderRoom.getName();
|
|
|
+ dayOrderFee.setRemark("【"+roomName + "】 "+ DateUtils.formatDate(dayOrderFee.getDayTime()) + " 当日房费");
|
|
|
+ dayOrderFee.setLivingOrderId(livingOrder.getId());
|
|
|
+ dayOrderFee.setHotelId(hotelId);
|
|
|
+ feeService.save(dayOrderFee);
|
|
|
+ }
|
|
|
//</editor-fold>
|
|
|
return livingOrder.getId();
|
|
|
}
|
|
|
@@ -1446,7 +1448,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
livingCustomer.setId(null);
|
|
|
livingCustomer.setLivingOrderId(null);
|
|
|
customers.add(livingCustomer);
|
|
|
- String livingOrderId = bookingToLive(bookingRooms.getId(), customers,hotelId);
|
|
|
+ String livingOrderId = bookingToLive(bookingRooms.getId(), customers,hotelId,null);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
@@ -1969,7 +1971,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
List<BusLivingCustomer> customers = livingData.getRoomIds().stream().filter(s->s.getRoomId().equals(bkRoom.getRoomId())).findFirst().get().getLivingCustomers();
|
|
|
if(customers == null || customers.size() == 0) throw new JeecgBootException("请添加客户信息");
|
|
|
- String livingOrderId = bookingToLive(bkRoom.getId(), customers,hotelId);
|
|
|
+ String livingOrderId = bookingToLive(bkRoom.getId(), customers,hotelId,null);
|
|
|
// 费用关联到主房
|
|
|
if(livingData.getOrderFees()!=null && livingData.getOrderFees().size() > 0 ) {
|
|
|
List<BusOrderFee> findRoomFees = livingData.getOrderFees().stream().filter(t->t.getRoomId().equals(bkRoom.getRoomId())).collect(Collectors.toList());
|