|
|
@@ -998,6 +998,38 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean syncDayRoomOrder(String hotelId) {
|
|
|
+ List<CesRooms> hotelRooms = roomsService.list(Wrappers.<CesRooms>query().eq("hotel_id",hotelId).eq("invalid",false));
|
|
|
+ List<CesRooms> inLiveRooms = hotelRooms.stream().filter(s->s.getLivingOrderId() != null && !s.getLivingOrderId().isEmpty()
|
|
|
+ && (s.getRoomStatus().equals(RoomStatusEnum.LIVE_DIRTY.getKey()) || s.getRoomStatus().equals(RoomStatusEnum.LIVE_CLEAR.getKey()))).collect(Collectors.toList());
|
|
|
+ List<String> livingOrderIds = inLiveRooms.stream().map(s->s.getLivingOrderId()).collect(Collectors.toList());
|
|
|
+ List<BusRoomsLivingOrder> livingOrders = roomsLivingOrderService.list(Wrappers.<BusRoomsLivingOrder>query()
|
|
|
+ .in("id",livingOrderIds));
|
|
|
+ livingOrders.forEach(s->{
|
|
|
+ Date date = s.getDueOutTime();
|
|
|
+ Calendar calendar = new GregorianCalendar();
|
|
|
+ calendar.setTime(date);
|
|
|
+ calendar.add(Calendar.DATE,1);
|
|
|
+ s.setDueOutTime(calendar.getTime());
|
|
|
+ roomsLivingOrderService.updateById(s);// 更新订单
|
|
|
+ BusOrderFee dayOrderFee = new BusOrderFee();
|
|
|
+ dayOrderFee.setDayTime(date);
|
|
|
+ dayOrderFee.setCreateTime(new Date());
|
|
|
+ dayOrderFee.setMoney(BigDecimal.valueOf(218.00));
|
|
|
+ dayOrderFee.setFeeType(1);
|
|
|
+ dayOrderFee.setSubjectType(FeeSubjectType.MEI_RI_FANG_FEI.getKey());
|
|
|
+ CesRooms orderRoom = inLiveRooms.stream().filter(a->a.getLivingOrderId().equals(s.getId())).findFirst().get();
|
|
|
+ dayOrderFee.setRoomId(orderRoom.getId());
|
|
|
+ String roomName = orderRoom.getPrefix() != null?orderRoom.getPrefix():"";
|
|
|
+ roomName += roomName + orderRoom.getName();
|
|
|
+ dayOrderFee.setRemark("【"+roomName + "】 "+ DateUtils.formatDate(date) + " 当日房费");
|
|
|
+ dayOrderFee.setLivingOrderId(s.getId());
|
|
|
+ feeService.save(dayOrderFee);
|
|
|
+ });
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
private Map<String,String> bookingRoomToLiving(BookingOrderSaveDto livingData, List<ExtendBusBookingRoomsVo> roomIds, BookingOrderEditVo bookingOrderVo) {
|
|
|
Map<String,String> results = new HashMap<>();
|
|
|
|
|
|
@@ -1029,8 +1061,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
roomFee.setFeeType(1); // 消费
|
|
|
List<BusLivingLayoutDayPrice> roomDayPrice = livingData.getLivingRoomDayPrices().stream().filter(i->i.getRoomId().equals(bkRoom.getRoomId())).collect(Collectors.toList());
|
|
|
BigDecimal dayRoomFee = currentDayFee(roomDayPrice,null);
|
|
|
- if(dayRoomFee == null)
|
|
|
- throw new JeecgBootException("未找到当日房价");
|
|
|
+ if(dayRoomFee == null) throw new JeecgBootException("未找到当日房价");
|
|
|
roomFee.setMoney(dayRoomFee); // 取当日房费的优惠价 其他时间要查询房价方案、每日房价,房型门市价按照规则去取
|
|
|
roomFee.setCreateTime(new Date());
|
|
|
roomFee.setDayTime(new Date());
|