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

[fix]
1.禁用状态的团购不允许展示

limeng 2 сар өмнө
parent
commit
094d736d71

+ 0 - 3
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/TourismOrderController.java

@@ -24,13 +24,11 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.validation.groups.Default;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
-import org.redisson.api.RBucket;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
@@ -196,7 +194,6 @@ public class TourismOrderController {
         tourOrder.setOrderStatus(0);
         tourOrderService.saveNew(tourOrder);
 //        bucket.set("预约成功!");
-        tourProjectGroupPurchase = tourProjectGroupPurchaseService.getById(tourProjectGroupPurchase.getId());
         return ResponseResult.success(tourProjectGroupPurchase);
     }
 

+ 2 - 1
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/WebsiteProjectGroupPurchaseController.java

@@ -13,6 +13,7 @@ import com.tourism.webadmin.app.website.vo.TourGroupPurchaseUserVo;
 import com.tourism.webadmin.back.model.TourProjectGroupPurchase;
 import com.tourism.webadmin.back.model.TourProjectGroupPurchaseDetail;
 import com.tourism.webadmin.back.model.TourUser;
+import com.tourism.webadmin.back.model.constant.Enable;
 import com.tourism.webadmin.back.service.TourOrderService;
 import com.tourism.webadmin.back.service.TourProjectGroupPurchaseDetailService;
 import com.tourism.webadmin.back.service.TourProjectGroupPurchaseService;
@@ -77,7 +78,7 @@ public class WebsiteProjectGroupPurchaseController {
             dto.setTravelStartTimeEnd(format.format(endDate));
         }
         dto.setEndTimeStart(format.format(new Date()));
-
+        dto.setState(Enable.ENABLE_YES);
         TourProjectGroupPurchase tourProjectGroupPurchaseFilter = MyModelUtil.copyTo(dto, TourProjectGroupPurchase.class);
         MyOrderParam myOrderParam = new MyOrderParam();
         // 如果项目id不为空,说明是项目详情中进行查询的,那么按照出发时间正序排序,如果不为空,则是列表页查询的,按照设定的排序规则进行排序

+ 2 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/service/impl/TourismProjectToWebServiceImpl.java

@@ -19,6 +19,7 @@ import com.tourism.webadmin.app.website.vo.DateRange;
 import com.tourism.webadmin.app.website.vo.TourismProjectDatePriceVo;
 import com.tourism.webadmin.app.website.vo.WebSiteProjectDatePriceVo;
 import com.tourism.webadmin.back.model.*;
+import com.tourism.webadmin.back.model.constant.Enable;
 import com.tourism.webadmin.back.service.*;
 import com.tourism.webadmin.back.vo.TourismProjectVo;
 import jakarta.servlet.http.HttpServletRequest;
@@ -168,6 +169,7 @@ public class TourismProjectToWebServiceImpl implements TourismProjectToWebServic
         // 查询项目有没有可用的团购信息
         TourProjectGroupPurchaseDtoToWebDto dto = new TourProjectGroupPurchaseDtoToWebDto();
         dto.setProjectId(tourismProject.getId());
+        dto.setState(Enable.ENABLE_YES);
         List<String> dates = tourProjectGroupPurchaseService.queryUniqueGroupPurchaseDates(dto);
         // 如果有日期列表,则说明有团购,值是1
         if(dates != null && dates.size() > 0) {