qh 2 éve
szülő
commit
588e5c8110

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusRoomBookingOrdersServiceImpl.java

@@ -19,6 +19,7 @@ import org.jeecg.modules.business.vo.BookingBatchRoomsVo;
 import org.jeecg.modules.business.vo.BookingOrderEditVo;
 import org.jeecg.modules.business.vo.ExtendBusBookingRoomsVo;
 import org.jeecg.modules.rooms.Enum.RoomStatusEnum;
+import org.jeecg.modules.rooms.entity.CesRooms;
 import org.jeecg.modules.rooms.service.CesRoomsServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -65,6 +66,9 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
     @Resource
     private IBusTeamService teamService;
 
+    @Resource
+    private CesRoomsServiceImpl roomsService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String bookingOrderSave(BookingOrderSaveDto item, Boolean isTeam) {
@@ -153,6 +157,10 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
             long mainCount = item.getRoomIds().stream().filter(t->t.getIsMain()!=null&&t.getIsMain()).count();
 
             item.getRoomIds().forEach(c->{
+                CesRooms room = roomsService.getById(c.getRoomId());
+                if(room == null) throw new JeecgBootException("房间不存在");
+                room.setBookingOrderId(bookingId);
+                roomsService.updateById(room);
 
                 BusBookingRooms bookingRoomsItem = new BusBookingRooms();
                 bookingRoomsItem.setBookingOrdersId(bookingId);
@@ -890,6 +898,12 @@ 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);
+            CesRooms room = roomsService.getById(bkRoom.getRoomId());
+            if(room==null) throw new JeecgBootException("房间不存在");
+            room.setLivingOrderId(livingOrderId);
+            room.setRoomStatus(RoomStatusEnum.LIVE_CLEAR.getKey());
+            roomsService.updateById(room);
+
             results.put(bkRoom.getRoomId(),livingOrderId);
         });
         return results;

+ 11 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/entity/CesRooms.java

@@ -7,6 +7,8 @@ import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -108,6 +110,15 @@ public class CesRooms extends Model<CesRooms> {
     @TableField(exist = false)
     private BigDecimal marketPrice;
 
+    @ApiModelProperty(value = "预约单ID")
+    private String bookingOrderId;
+
+    @ApiModelProperty(value = "房态")
+    private Integer roomStatus;
+
+    @ApiModelProperty(value = "入住ID")
+    private String livingOrderId;
+
 
     public static final String ID = "id";