Эх сурвалжийг харах

[fix]
增加拼团的字段

chenchen 2 сар өмнө
parent
commit
ab8ced693f

+ 7 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourProjectGroupPurchaseController.java

@@ -90,6 +90,7 @@ public class TourProjectGroupPurchaseController {
         if(tourismDatePriceNowDate == null){
             return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, "该项目没有设置对应的日期原价,请先补充对应的日期价格。");
         }
+        tourProjectGroupPurchaseDto.setOriginPrice(tourismDatePriceNowDate.getAdultPrice());
         TourProjectGroupPurchase tourProjectGroupPurchase = MyModelUtil.copyTo(tourProjectGroupPurchaseDto, TourProjectGroupPurchase.class);
         // 验证关联Id的数据合法性
         CallResult callResult = tourProjectGroupPurchaseService.verifyRelatedData(tourProjectGroupPurchase, null);
@@ -127,6 +128,11 @@ public class TourProjectGroupPurchaseController {
         if (errorMessage != null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
         }
+        //根据项目id和日期,查询该项目在当天有没有日历价格
+        TourismDatePrice tourismDatePrice = new TourismDatePrice();
+        tourismDatePrice.setProjectId(String.valueOf(tourProjectGroupPurchaseDto.getProjectId()));
+        tourismDatePrice.setDepartureDate(tourProjectGroupPurchaseDto.getTravelStartTime());
+        TourismDatePrice tourismDatePriceNowDate = tourismDatePriceService.getOne(tourismDatePrice);
         TourProjectGroupPurchase tourProjectGroupPurchase = MyModelUtil.copyTo(tourProjectGroupPurchaseDto, TourProjectGroupPurchase.class);
         TourProjectGroupPurchase originalTourProjectGroupPurchase = tourProjectGroupPurchaseService.getById(tourProjectGroupPurchase.getId());
         if (originalTourProjectGroupPurchase == null) {
@@ -134,6 +140,7 @@ public class TourProjectGroupPurchaseController {
             errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
         }
+        tourProjectGroupPurchaseDto.setOriginPrice(tourismDatePriceNowDate.getAdultPrice());
         // 验证关联Id的数据合法性
         CallResult callResult = tourProjectGroupPurchaseService.verifyRelatedData(tourProjectGroupPurchase, originalTourProjectGroupPurchase);
         if (!callResult.isSuccess()) {

+ 7 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourProjectGroupPurchaseDto.java

@@ -90,6 +90,13 @@ public class TourProjectGroupPurchaseDto {
     private BigDecimal childrenPrice;
 
     /**
+     * 成人原价。
+     * NOTE: 可支持等于操作符的列表数据过滤。
+     */
+    @Schema(description = "成人原价。可支持等于操作符的列表数据过滤。")
+    private BigDecimal originPrice;
+
+    /**
      * 显示顺序。
      */
     @Schema(description = "显示顺序。")