|
|
@@ -856,7 +856,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers) {
|
|
|
+ public String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers, String hotelId) {
|
|
|
BusBookingRooms bkRoom = bookingRoomsService.getById(bookingRoomId);
|
|
|
if(bkRoom == null) throw new JeecgBootException("关联房间不存在");
|
|
|
BusRoomBookingOrders bookingOrders = getById(bkRoom.getBookingOrdersId());
|
|
|
@@ -875,8 +875,11 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
livingOrder = copyBookingToAcceptOrder(batch, bookingOrders);
|
|
|
livingOrder.setBatchId(bkRoom.getBookingBatchId());
|
|
|
} else throw new JeecgBootException("订单类型错误");
|
|
|
+
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
|
livingOrder.setLivingOrderNo("D"+sdf.format(System.currentTimeMillis()));
|
|
|
+ livingOrder.setHotelId(hotelId);
|
|
|
+
|
|
|
livingOrder.setArrivalTime(new Date());// todo 这个地方的入住开始时间应该怎么算
|
|
|
if(customers.size() > 0) livingOrder.setContactId(customers.get(0).getCustomerId());
|
|
|
roomsLivingOrderService.save(livingOrder);
|
|
|
@@ -928,13 +931,13 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String customerLiving(BookingOrderSaveDto livingData, Boolean isTeam) {
|
|
|
+ public String customerLiving(BookingOrderSaveDto livingData, Boolean isTeam, String hotelId) {
|
|
|
String bookingOrderNo = bookingOrderSave(livingData,isTeam);
|
|
|
if(bookingOrderNo != null && !bookingOrderNo.isEmpty()){
|
|
|
BookingOrderEditVo bookingOrderVo = getBookingInfoById(null,bookingOrderNo);
|
|
|
// 散客取roomIds
|
|
|
if(bookingOrderVo.getOrderInfo().getBookingOrdersType().equals(BookingOrdersType.NORMAL.getKey())) {
|
|
|
- Map<String,String> roomOrderMap = bookingRoomToLiving(livingData, bookingOrderVo.getRoomIds(), bookingOrderVo);
|
|
|
+ Map<String,String> roomOrderMap = bookingRoomToLiving(livingData, bookingOrderVo.getRoomIds(), bookingOrderVo,hotelId);
|
|
|
livingData.getLivingRoomDayPrices().forEach(g->{
|
|
|
String livingOrderId = roomOrderMap.get(g.getRoomId());
|
|
|
if(livingOrderId != null && !livingOrderId.isEmpty()) {
|
|
|
@@ -945,7 +948,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
livingLayoutDayPriceService.saveBatch(livingData.getLivingRoomDayPrices());
|
|
|
} else if(bookingOrderVo.getOrderInfo().getBookingOrdersType().equals(BookingOrdersType.TEAM.getKey())) {
|
|
|
bookingOrderVo.getBatchRooms().forEach(b->{
|
|
|
- bookingRoomToLiving(livingData, b.getRoomIds(), bookingOrderVo);
|
|
|
+ bookingRoomToLiving(livingData, b.getRoomIds(), bookingOrderVo,hotelId);
|
|
|
});
|
|
|
} else throw new JeecgBootException("订单类型错误");
|
|
|
}
|
|
|
@@ -1048,6 +1051,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
roomName += roomName + orderRoom.getName();
|
|
|
dayOrderFee.setRemark("【"+roomName + "】 "+ DateUtils.formatDate(date) + " 当日房费");
|
|
|
dayOrderFee.setLivingOrderId(s.getId());
|
|
|
+ dayOrderFee.setHotelId(hotelId);
|
|
|
feeService.save(dayOrderFee);
|
|
|
});
|
|
|
return null;
|
|
|
@@ -1219,7 +1223,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean setLivingOrderFee(List<BusOrderFee> fees, String livingOrderId) {
|
|
|
+ public Boolean setLivingOrderFee(List<BusOrderFee> fees, String livingOrderId,String hotelId) {
|
|
|
if(fees == null || fees.size() == 0) throw new JeecgBootException("参数无效");
|
|
|
BusRoomsLivingOrder livingOrder = roomsLivingOrderService.getById(livingOrderId);
|
|
|
if(livingOrder == null) throw new JeecgBootException("订单不存在");
|
|
|
@@ -1231,6 +1235,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
roomFee.setFeeType(1); // 消费
|
|
|
roomFee.setCreateTime(new Date());
|
|
|
roomFee.setDayTime(new Date());
|
|
|
+ roomFee.setHotelId(hotelId);
|
|
|
feeService.save(roomFee);
|
|
|
});
|
|
|
|
|
|
@@ -1239,7 +1244,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean unionOrder(String roomId,String targetRoomId, String bookingOrderId) {
|
|
|
+ public Boolean unionOrder(String roomId,String targetRoomId, String bookingOrderId, String hotelId) {
|
|
|
CesRooms room = roomsService.getById(roomId);
|
|
|
if(room == null) throw new JeecgBootException("房间不存在");
|
|
|
CesRoomLayout layout = layoutService.getById(room.getLayoutId());
|
|
|
@@ -1269,7 +1274,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
livingCustomer.setId(null);
|
|
|
livingCustomer.setLivingOrderId(null);
|
|
|
customers.add(livingCustomer);
|
|
|
- String livingOrderId = bookingToLive(bookingRooms.getId(), customers);
|
|
|
+ String livingOrderId = bookingToLive(bookingRooms.getId(), customers,hotelId);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
@@ -1353,6 +1358,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
preferFeeItem.setMoney(preferFeeItem.getMoney().multiply(BigDecimal.valueOf(-1)));// 消费为负数 就是优惠
|
|
|
preferFeeItem.setLivingOrderId(mainRoomOrder.getId());
|
|
|
preferFeeItem.setPreferentialStatus(2);
|
|
|
+ preferFeeItem.setHotelId(hotelId);
|
|
|
feeService.save(preferFeeItem);
|
|
|
}
|
|
|
List<BusRoomPayType> payTypes = payTypeService.list();
|
|
|
@@ -1405,6 +1411,9 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
});
|
|
|
|
|
|
List<BusOrderFee> jiezhangFees = settleFees.stream().filter(s->s.getIsPreferential() == null || s.getIsPreferential().equals(false)).collect(Collectors.toList());
|
|
|
+ jiezhangFees.forEach(a->{
|
|
|
+ a.setHotelId(hotelId);
|
|
|
+ });
|
|
|
if(jiezhangFees.size() > 0) {
|
|
|
feeService.saveBatch(jiezhangFees);
|
|
|
} else throw new JeecgBootException("参数没有结账收费项目");
|
|
|
@@ -1417,7 +1426,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
return feeService.list(Wrappers.<BusOrderFee>query()
|
|
|
.eq("living_order_id",livingOrderId));
|
|
|
}
|
|
|
- private Map<String,String> bookingRoomToLiving(BookingOrderSaveDto livingData, List<ExtendBusBookingRoomsVo> roomIds, BookingOrderEditVo bookingOrderVo) {
|
|
|
+ private Map<String,String> bookingRoomToLiving(BookingOrderSaveDto livingData, List<ExtendBusBookingRoomsVo> roomIds, BookingOrderEditVo bookingOrderVo,String hotelId) {
|
|
|
Map<String,String> results = new HashMap<>();
|
|
|
|
|
|
roomIds.forEach(bkRoom-> {
|
|
|
@@ -1426,7 +1435,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);
|
|
|
+ String livingOrderId = bookingToLive(bkRoom.getId(), customers,hotelId);
|
|
|
// 费用关联到主房
|
|
|
if(livingData.getOrderFees()!=null && livingData.getOrderFees().size() > 0 ) {
|
|
|
List<BusOrderFee> findRoomFees = livingData.getOrderFees().stream().filter(t->t.getRoomId().equals(bkRoom.getRoomId())).collect(Collectors.toList());
|
|
|
@@ -1435,6 +1444,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
s.setLivingOrderId(livingOrderId);
|
|
|
s.setCreateTime(new Date());
|
|
|
s.setFeeType(2);// 收款
|
|
|
+ s.setHotelId(hotelId);
|
|
|
if(FeeSubjectType.val(s.getSubjectType()) == null) {
|
|
|
throw new JeecgBootException("收款项目不存在,请核对后操作");
|
|
|
}
|
|
|
@@ -1452,6 +1462,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
roomFee.setMoney(dayRoomFee); // 取当日房费的优惠价 其他时间要查询房价方案、每日房价,房型门市价按照规则去取
|
|
|
roomFee.setCreateTime(new Date());
|
|
|
roomFee.setDayTime(new Date());
|
|
|
+ roomFee.setHotelId(hotelId);
|
|
|
roomFee.setSubjectType(FeeSubjectType.MEI_RI_FANG_FEI.getKey());
|
|
|
feeService.save(roomFee);
|
|
|
results.put(bkRoom.getRoomId(),livingOrderId);
|