ソースを参照

实时房态添加锁房和维修记录

覃浩 2 年 前
コミット
8e6d32693d

+ 4 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/Vo/FloorBuildingRoomVo.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.rooms.Vo;
 
 import lombok.Data;
 import org.jeecg.modules.business.entity.BusRoomBookingOrders;
+import org.jeecg.modules.fw.entity.FwRoomLock;
+import org.jeecg.modules.fw.entity.FwRoomRepair;
 import org.jeecg.modules.rooms.entity.CesRoomLayout;
 import org.jeecg.modules.rooms.entity.CesRooms;
 
@@ -12,5 +14,7 @@ public class FloorBuildingRoomVo {
     private CesRoomLayout layout;
     private BookingRealtimeVo bookingData;
     private LivingRealtimeVo livingData;
+    private FwRoomRepair repairInfo;
+    private FwRoomLock lockInfo;
 
 }

+ 32 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/controller/CesRoomsController.java

@@ -31,6 +31,9 @@ import org.jeecg.modules.business.service.IBusRoomBookingOrdersService;
 import org.jeecg.modules.business.service.IBusRoomsLivingOrderService;
 import org.jeecg.modules.business.service.IBusTeamService;
 import org.jeecg.modules.fw.entity.FwRoomLock;
+import org.jeecg.modules.fw.entity.FwRoomRepair;
+import org.jeecg.modules.fw.service.IFwRoomLockService;
+import org.jeecg.modules.fw.service.IFwRoomRepairService;
 import org.jeecg.modules.pos.entity.PosOrderGoodsPayment;
 import org.jeecg.modules.rooms.DTO.*;
 import org.jeecg.modules.rooms.Enum.CouponEnums;
@@ -95,6 +98,11 @@ public class CesRoomsController {
     @Resource
     private IBusRoomBookingOrdersService busRoomBookingOrdersService;
 
+    @Resource
+    private IFwRoomRepairService fwRoomRepairService;
+
+    @Resource
+    private IFwRoomLockService fwRoomLockService;
 
     @ApiOperation(value="房间分页列表查询", notes="房间分页列表查询")
     @GetMapping(value = "/list")
@@ -135,6 +143,8 @@ public class CesRoomsController {
                     bookingOrderIds.add(c.getBookingData().getBookingOrder().getId());
                 }
             });
+            List<FwRoomLock> unLockeds = fwRoomLockService.list(Wrappers.<FwRoomLock>query().eq("hotel_id",hotelId));
+            List<FwRoomRepair> unRepairs = fwRoomRepairService.list(Wrappers.<FwRoomRepair>query().eq("hotel_id",hotelId).eq("status",1));
             List<BusTeam> teamOrders =bookingOrderIds.size() >0? teamService.list(Wrappers.<BusTeam>query().in("booking_order_id",bookingOrderIds)):new ArrayList<>();
             floors.forEach(s-> {
                 List<CesRooms> floorRooms = allRooms.stream().filter(a->a.getFloorId().equals(s.getId())).collect(Collectors.toList());
@@ -148,6 +158,28 @@ public class CesRoomsController {
                     roomVo.setLayout(opLayout.get());
                     //房间
                     roomVo.setRoomInfo(a);
+                    // 维修房
+                    if(a.getRoomStatus().equals(RoomStatusEnum.IN_SERVICE.getKey())){
+                        Optional<FwRoomRepair> optionalFwRoomRepair = unRepairs.stream().filter(u->u.getRoomId().equals(a.getId())).findFirst();
+                        if(!optionalFwRoomRepair.isPresent()){
+                            FwRoomRepair tempRepairInfo = new FwRoomRepair();
+                            tempRepairInfo.setRemark("暂无");
+                            roomVo.setRepairInfo(tempRepairInfo);
+                        } else {
+                            roomVo.setRepairInfo(optionalFwRoomRepair.get());
+                        }
+                    }
+                    // 锁房信息
+                    if(a.getRoomStatus().equals(RoomStatusEnum.ON_LOCK.getKey())){
+                        Optional<FwRoomLock> optionalFwRoomLock = unLockeds.stream().filter(u->u.getRoomId().equals(a.getId())).findFirst();
+                        if(!optionalFwRoomLock.isPresent()){
+                            FwRoomLock tempLockInfo = new FwRoomLock();
+                            tempLockInfo.setRemark("暂无");
+                            roomVo.setLockInfo(tempLockInfo);
+                        } else {
+                            roomVo.setLockInfo(optionalFwRoomLock.get());
+                        }
+                    }
                     if(opFindRoomVo.isPresent()) {
                         roomVo.setLivingData(opFindRoomVo.get().getLivingData());
                         if(opFindRoomVo.get().getBookingData().getBookingOrder() != null) {