|
|
@@ -19,9 +19,11 @@ import org.jeecg.modules.business.service.*;
|
|
|
import org.jeecg.modules.business.util.MxTools;
|
|
|
import org.jeecg.modules.business.vo.*;
|
|
|
import org.jeecg.modules.fw.entity.FwRoomClean;
|
|
|
+import org.jeecg.modules.fw.entity.FwRoomExamine;
|
|
|
import org.jeecg.modules.fw.entity.FwRoomLock;
|
|
|
import org.jeecg.modules.fw.entity.FwRoomRepair;
|
|
|
import org.jeecg.modules.fw.service.IFwRoomCleanService;
|
|
|
+import org.jeecg.modules.fw.service.IFwRoomExamineService;
|
|
|
import org.jeecg.modules.fw.service.IFwRoomLockService;
|
|
|
import org.jeecg.modules.fw.service.IFwRoomRepairService;
|
|
|
import org.jeecg.modules.pos.service.IPosJialiaoConfigDetailService;
|
|
|
@@ -126,6 +128,9 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
@Resource
|
|
|
private IFwRoomRepairService fwRoomRepairService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IFwRoomExamineService fwRoomExamineService;
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String bookingOrderSave(BookingOrderSaveDto item, Boolean isTeam,Boolean isLiving,String hotelId) {
|
|
|
@@ -930,7 +935,14 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
if(customers.size() > 0) livingOrder.setContactId(customers.get(0).getCustomerId());
|
|
|
roomsLivingOrderService.save(livingOrder);
|
|
|
|
|
|
-
|
|
|
+ // 添加查房记录 start
|
|
|
+ FwRoomExamine examine = new FwRoomExamine();
|
|
|
+ examine.setHotelId(hotelId);
|
|
|
+ examine.setCreateTime(new Date());
|
|
|
+ examine.setLivingOrderId(livingOrder.getId());
|
|
|
+ examine.setRoomId(bkRoom.getRoomId());
|
|
|
+ fwRoomExamineService.save(examine);
|
|
|
+ // 添加查房记录 end
|
|
|
|
|
|
CesRooms room = roomsService.getById(bkRoom.getRoomId());
|
|
|
if(room==null) throw new JeecgBootException("房间不存在");
|
|
|
@@ -2346,4 +2358,36 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
+ // 换房
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean changeLivingRoom(List<BusLivingLayoutDayPrice> prices,String livingOrderId, String roomId) {
|
|
|
+ if(prices == null || prices.size() == 0) throw new JeecgBootException("请传入房价");
|
|
|
+ BusRoomsLivingOrder livingOrder = roomsLivingOrderService.getById(livingOrderId);
|
|
|
+ if(livingOrder == null) throw new JeecgBootException("入住记录不存在");
|
|
|
+ BusBookingRooms bkRoom = bookingRoomsService.getById(livingOrder.getBookingRoomId());
|
|
|
+ if(bkRoom == null) throw new JeecgBootException("入住房间记录不存在");
|
|
|
+ CesRooms origLivingRoom = roomsService.getById(bkRoom.getRoomId());
|
|
|
+ if(origLivingRoom == null) throw new JeecgBootException("原房间不存在");
|
|
|
+ CesRooms changeRoom = roomsService.getById(roomId);
|
|
|
+ if(changeRoom == null) throw new JeecgBootException("更换房间不存在");
|
|
|
+ bkRoom.setRoomId(changeRoom.getId());
|
|
|
+ bkRoom.setLayoutId(changeRoom.getLayoutId());
|
|
|
+ bookingRoomsService.updateById(bkRoom);
|
|
|
+ origLivingRoom.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
|
|
|
+ roomsService.updateById(origLivingRoom);
|
|
|
+ changeRoom.setRoomStatus(RoomStatusEnum.LIVE_CLEAR.getKey());
|
|
|
+ roomsService.updateById(changeRoom);
|
|
|
+ livingLayoutDayPriceService.remove(Wrappers.<BusLivingLayoutDayPrice>query().eq("living_order_id",livingOrderId));
|
|
|
+ prices.forEach(s->{
|
|
|
+ s.setRoomLayoutId(changeRoom.getLayoutId());
|
|
|
+ s.setRoomId(changeRoom.getId());
|
|
|
+ s.setLivingType(1);
|
|
|
+ s.setLivingOrderId(livingOrderId);
|
|
|
+ });
|
|
|
+ livingLayoutDayPriceService.saveBatch(prices);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
}
|