Sfoglia il codice sorgente

添加根据批次id查询批次预定信息详情

qh 2 anni fa
parent
commit
a85b8f2ea0

+ 13 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusRoomBookingOrdersController.java

@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
 import org.jeecg.modules.business.service.impl.BusRoomBookingOrdersServiceImpl;
+import org.jeecg.modules.business.vo.BatchOrderEditVo;
 import org.jeecg.modules.business.vo.BookingOrderEditVo;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -208,4 +209,16 @@ public class BusRoomBookingOrdersController extends JeecgController<BusRoomBooki
         return super.importExcel(request, response, BusRoomBookingOrders.class);
     }
 
+
+	 /**
+	  * 酒店预定订单-通过批次id查询批次订单信息
+	  * @param batchId
+	  * @return
+	  */
+	 @ApiOperation(value="酒店预定订单-通过批次id查询批次订单信息", notes="酒店预定订单-通过批次id查询批次订单信息")
+    @RequestMapping(value = "batch-order-detail",method = RequestMethod.GET)
+	 public  Result<BatchOrderEditVo> getBatchOrder(String batchId) {
+    	return  Result.ok(service.batchOrderDetail(batchId));
+	 }
+
 }

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/dto/BatchOrderSavaDto.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.business.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecg.modules.business.entity.BusBookingBatch;
+import org.jeecg.modules.business.entity.BusBookingLayoutDayPrice;
+import org.jeecg.modules.business.entity.BusRoomBookingOrders;
+
+import java.util.List;
+
+@Data
+public class BatchOrderSavaDto {
+    @ApiModelProperty(value = "批次订单信息")
+    private BusBookingBatch batchInfo;
+    @ApiModelProperty(value = "散客预定 走这个,关联的房间id")
+    private List<BookingLayoutRoomsDto> roomIds;
+    @ApiModelProperty(value = "房型每天价格 ,1 散客预定 每天房价传入这个必传")
+    private List<BusBookingLayoutDayPrice> layoutDayPrices;
+}

+ 3 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusRoomBookingOrdersService.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.business.service;
 import org.jeecg.modules.business.dto.BookingOrderSaveDto;
 import org.jeecg.modules.business.entity.BusRoomBookingOrders;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.business.vo.BatchOrderEditVo;
 import org.jeecg.modules.business.vo.BookingOrderEditVo;
 
 /**
@@ -22,4 +23,6 @@ public interface IBusRoomBookingOrdersService extends IService<BusRoomBookingOrd
     Boolean removeOrder(String id);
 
     Boolean setOrderStatus(BusRoomBookingOrders entity);
+
+    BatchOrderEditVo batchOrderDetail(String batchId);
 }

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

@@ -15,6 +15,7 @@ import org.jeecg.modules.business.mapper.BusRoomBookingOrdersMapper;
 import org.jeecg.modules.business.service.IBusBookingLayoutDayPriceService;
 import org.jeecg.modules.business.service.IBusCustomerService;
 import org.jeecg.modules.business.service.IBusRoomBookingOrdersService;
+import org.jeecg.modules.business.vo.BatchOrderEditVo;
 import org.jeecg.modules.business.vo.BookingBatchRoomsVo;
 import org.jeecg.modules.business.vo.BookingOrderEditVo;
 import org.jeecg.modules.business.vo.ExtendBusBookingRoomsVo;
@@ -540,6 +541,23 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
         return true;
     }
 
+    @Override
+    public BatchOrderEditVo batchOrderDetail(String batchId) {
+        BusBookingBatch batch = bookingBatchService.getById(batchId);
+        if(batch == null) throw new JeecgBootException("订单批次不存在");
+        BookingOrderEditVo orderVo =  getBookingInfoById(batch.getBookingOrdersId(),null);
+        BatchOrderEditVo result = new BatchOrderEditVo();
+        List<BookingBatchRoomsVo> orderBatchVos = orderVo.getBatchRooms();
+        if(orderBatchVos==null||orderBatchVos.size() == 0
+        || orderBatchVos.stream().filter(s->s.getId().equals(batchId)).count()== 0
+        ) throw new JeecgBootException("批次关联订单异常,请联系管理员");
+        BookingBatchRoomsVo findBatchVo = orderBatchVos.stream().filter(s->s.getId().equals(batchId)).findAny().get();
+        result.setOrderInfo(findBatchVo);
+        result.setRoomIds(findBatchVo.getRoomIds());
+        result.setLayoutDayPrices(findBatchVo.getLayoutDayPrices());
+        return result;
+    }
+
 
     private BusBookingBatch copyBatchToBase(BookingBatchRoomsDto data) {
         BusBookingBatch batch = new BookingBatchRoomsDto();

+ 18 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/BatchOrderEditVo.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecg.modules.business.entity.BusBookingBatch;
+import org.jeecg.modules.business.entity.BusBookingLayoutDayPrice;
+import org.jeecg.modules.business.entity.BusRoomBookingOrders;
+
+import java.util.List;
+
+@Data
+public class BatchOrderEditVo {
+    private BusBookingBatch orderInfo;
+    @ApiModelProperty(value = "散客预定 走这个,关联的房间id")
+    private List<ExtendBusBookingRoomsVo> roomIds;
+    @ApiModelProperty(value = "房型每天价格 ,1 散客预定 每天房价传入这个必传")
+    private List<BusBookingLayoutDayPrice> layoutDayPrices;
+}