瀏覽代碼

订单出费

qh 2 年之前
父節點
當前提交
b2ff5fb55a

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

@@ -1216,9 +1216,13 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
     @Transactional(rollbackFor = Exception.class)
     public Boolean setLivingOrderFee(List<BusOrderFee> fees, String livingOrderId) {
         if(fees == null || fees.size() == 0) throw new JeecgBootException("参数无效");
+        BusRoomsLivingOrder livingOrder = roomsLivingOrderService.getById(livingOrderId);
+        if(livingOrder == null) throw new JeecgBootException("订单不存在");
+        BusBookingRooms bookingRoom = bookingRoomsService.getById(livingOrder.getBookingRoomId());
+        if(bookingRoom == null) throw new JeecgBootException("未找到房间关联");
         fees.forEach(roomFee->{
-            if(roomFee.getRoomId() == null ||roomFee.getRoomId().isEmpty()) throw new JeecgBootException("房间ID不正确");
             roomFee.setLivingOrderId(livingOrderId);
+            roomFee.setRoomId(bookingRoom.getRoomId());
             roomFee.setFeeType(1); // 消费
             roomFee.setCreateTime(new Date());
             roomFee.setDayTime(new Date());