|
@@ -21,7 +21,9 @@ import org.jeecg.modules.rooms.Enum.RoomStatusEnum;
|
|
|
import org.jeecg.modules.rooms.Vo.BookingRealtimeVo;
|
|
import org.jeecg.modules.rooms.Vo.BookingRealtimeVo;
|
|
|
import org.jeecg.modules.rooms.Vo.FloorBuildingRoomVo;
|
|
import org.jeecg.modules.rooms.Vo.FloorBuildingRoomVo;
|
|
|
import org.jeecg.modules.rooms.Vo.LivingRealtimeVo;
|
|
import org.jeecg.modules.rooms.Vo.LivingRealtimeVo;
|
|
|
|
|
+import org.jeecg.modules.rooms.entity.CesRoomLayout;
|
|
|
import org.jeecg.modules.rooms.entity.CesRooms;
|
|
import org.jeecg.modules.rooms.entity.CesRooms;
|
|
|
|
|
+import org.jeecg.modules.rooms.service.CesRoomLayoutServiceImpl;
|
|
|
import org.jeecg.modules.rooms.service.CesRoomsServiceImpl;
|
|
import org.jeecg.modules.rooms.service.CesRoomsServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -87,6 +89,9 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
@Resource
|
|
@Resource
|
|
|
private IBusRoomPayTypeService payTypeService;
|
|
private IBusRoomPayTypeService payTypeService;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private CesRoomLayoutServiceImpl layoutService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String bookingOrderSave(BookingOrderSaveDto item, Boolean isTeam) {
|
|
public String bookingOrderSave(BookingOrderSaveDto item, Boolean isTeam) {
|
|
@@ -1186,7 +1191,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
s.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
s.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
|
s.setLastRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
s.setLastRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
|
});
|
|
});
|
|
|
- bookingLivings.forEach(s->s.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey()));
|
|
|
|
|
|
|
+ bookingLivings.forEach(s->s.setSettleType(SettleTypeEnum.UN_SETTLE_LEAVE.getKey()));
|
|
|
roomsLivingOrderService.updateBatchById(bookingLivings);
|
|
roomsLivingOrderService.updateBatchById(bookingLivings);
|
|
|
roomsService.updateBatchById(rooms);
|
|
roomsService.updateBatchById(rooms);
|
|
|
} else if(livingOrderId != null && !livingOrderId.isEmpty()) {
|
|
} else if(livingOrderId != null && !livingOrderId.isEmpty()) {
|
|
@@ -1200,7 +1205,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
room.setLivingOrderId("");
|
|
room.setLivingOrderId("");
|
|
|
room.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
room.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
|
room.setLastRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
room.setLastRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
|
- livingOrder.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey());
|
|
|
|
|
|
|
+ livingOrder.setSettleType(SettleTypeEnum.UN_SETTLE_LEAVE.getKey());
|
|
|
roomsLivingOrderService.updateById(livingOrder);
|
|
roomsLivingOrderService.updateById(livingOrder);
|
|
|
roomsService.updateById(room);
|
|
roomsService.updateById(room);
|
|
|
} else throw new JeecgBootException("参数错误");
|
|
} else throw new JeecgBootException("参数错误");
|
|
@@ -1232,6 +1237,41 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public Boolean unionOrder(String roomId, String bookingOrderId) {
|
|
|
|
|
+ CesRooms room = roomsService.getById(roomId);
|
|
|
|
|
+ if(room == null) throw new JeecgBootException("房间不存在");
|
|
|
|
|
+ CesRoomLayout layout = layoutService.getById(room.getLayoutId());
|
|
|
|
|
+ if(layout == null) throw new JeecgBootException("房型不存在");
|
|
|
|
|
+ BusRoomBookingOrders bkOrder = getById(bookingOrderId);
|
|
|
|
|
+ if(bkOrder == null) throw new JeecgBootException("订单不存在");
|
|
|
|
|
+ BusBookingRooms bookingRooms = new BusBookingRooms();
|
|
|
|
|
+ bookingRooms.setBookingOrdersId(bookingOrderId);
|
|
|
|
|
+ bookingRooms.setBookingType(bkOrder.getBookingOrdersType());
|
|
|
|
|
+ bookingRooms.setRoomId(roomId);
|
|
|
|
|
+ bookingRooms.setRoomStatus(RoomStatusEnum.LIVE_CLEAR.getKey());
|
|
|
|
|
+ bookingRooms.setLayoutId(layout.getId());
|
|
|
|
|
+ bookingRooms.setRoomLayoutId(layout.getId());
|
|
|
|
|
+ if(room.getLivingOrderId() == null || room.getLivingOrderId().isEmpty()) throw new JeecgBootException("非正常入住的订单无法联房");
|
|
|
|
|
+ BusRoomsLivingOrder roomLivingOrder = roomsLivingOrderService.getById(room.getLivingOrderId());
|
|
|
|
|
+ if(!roomLivingOrder.getBookingOrderId().equals(bookingOrderId)) throw new JeecgBootException("订单关联错误");
|
|
|
|
|
+
|
|
|
|
|
+ BusLivingCustomer livingCustomer = livingCustomerService.getOne(Wrappers.<BusLivingCustomer>query().eq("living_order_id",roomLivingOrder.getId()).eq("customer_id",roomLivingOrder.getContactId()));
|
|
|
|
|
+ if(livingCustomer == null) {
|
|
|
|
|
+ livingCustomer = livingCustomerService.getOne(Wrappers.<BusLivingCustomer>query().eq("living_order_id",roomLivingOrder.getId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(livingCustomer == null) throw new JeecgBootException("获取客户信息失败");
|
|
|
|
|
+ bookingRoomsService.save(bookingRooms);
|
|
|
|
|
+ List<BusLivingCustomer> customers = new ArrayList<>();
|
|
|
|
|
+ livingCustomer.setId(null);
|
|
|
|
|
+ livingCustomer.setLivingOrderId(null);
|
|
|
|
|
+ customers.add(livingCustomer);
|
|
|
|
|
+ String livingOrderId = bookingToLive(bookingRooms.getId(), customers);
|
|
|
|
|
+
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String getBookingRoomHotelId(BusBookingRooms bookingRoom) {
|
|
String getBookingRoomHotelId(BusBookingRooms bookingRoom) {
|
|
|
return roomsService.getById(bookingRoom.getRoomId()).getHotelId();
|
|
return roomsService.getById(bookingRoom.getRoomId()).getHotelId();
|
|
|
}
|
|
}
|