Przeglądaj źródła

fix 私域车队展示

zoujiajian 3 lat temu
rodzic
commit
1d1fb30006

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDonSku.java

@@ -63,6 +63,11 @@ public class GoodsDonSku extends BaseEntity {
      */
     private Boolean status;
 
+    /**
+     * 私域隐藏 true只在私域展示
+     */
+    private Boolean isHide;
+
 
     /**
      * 车位数

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/request/ReqGoodsSkuInsert.java

@@ -68,6 +68,11 @@ public class ReqGoodsSkuInsert {
          */
         private Boolean status;
 
+        /**
+         * 私域隐藏 true只在私域展示
+         */
+        private Boolean isHide;
+
         /**
          * 是否开启实物车票时长权益
          */

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonFrontSkuView.java

@@ -44,6 +44,9 @@ public class GoodsDonFrontSkuView {
 	@JsonIgnore
 	private Boolean status;
 
+	@JsonIgnore
+	private Boolean isHide;
+
 	/**
 	 * 价格
 	 */

+ 19 - 8
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -76,7 +76,7 @@ public class GoodsDonController {
      * 推广未登录,虚拟商品列表
      */
     @GetMapping("/get/popularize")
-    public Result<SearchResult<GoodsDonPopularizeView>> getPopularizeVipGoods() {
+    public Result<SearchResult<GoodsDonPopularizeView>> getPopularizeVipGoods(Boolean isHide) {
         SearchResult<GoodsDonPopularizeView> search = beanSearcher.search(GoodsDonPopularizeView.class, MapUtils.flatBuilder(request.getParameterMap())
                 .field(GoodsDonPopularizeView::getStatus, true)
                 .field(GoodsDonPopularizeView::getDeleted, true)
@@ -88,7 +88,12 @@ public class GoodsDonController {
         LinkedList<GoodsDonPopularizeView> collect = new LinkedList<>();
         search.getDataList().forEach(data -> {
             data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
-            data.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder().field(GoodsDonSku::getGoodsId, data.getId()).field(GoodsDonSku::getStatus, true).orderBy(GoodsDonSku::getPrice).asc().build()));
+            data.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder()
+                    .field(GoodsDonSku::getGoodsId, data.getId())
+                    .field(GoodsDonSku::getStatus, true)
+                    .field(GoodsDonFrontSkuView::getIsHide, isHide)
+                    .orderBy(GoodsDonSku::getPrice).asc()
+                    .build()));
             Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
                     .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
             data.setSold(sold + data.getVirtualSold());
@@ -98,8 +103,8 @@ public class GoodsDonController {
                             .build());
 
             Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
-                GoodsDonSku goodsDonSku = skuList.get(0);
-                if (goodsDonSku != null) {
+                if (skuList.size() > 0) {
+                    GoodsDonSku goodsDonSku = skuList.get(0);
                     data.setPrice(goodsDonSku.getPrice());
                     data.setMonths(goodsDonSku.getMonths());
                 }
@@ -155,7 +160,7 @@ public class GoodsDonController {
      * 官网首页 平台列表
      */
     @GetMapping("/get/list")
-    public Result<SearchResult<GoodsFrontListView>> getGoodsList() {
+    public Result<SearchResult<GoodsFrontListView>> getGoodsList(Boolean isHide) {
         SearchResult<GoodsFrontListView> search = beanSearcher.search(GoodsFrontListView.class, MapUtils.flatBuilder(request.getParameterMap())
                 .field(GoodsFrontListView::getStatus, true)
                 .field(GoodsFrontListView::getDeleted, true)
@@ -167,14 +172,20 @@ public class GoodsDonController {
         LinkedList<GoodsFrontListView> collect = new LinkedList<>();
         search.getDataList().forEach(data -> {
             data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
-            data.setSkuList(beanSearcher.searchAll(GoodsDonFrontSkuView.class, MapUtils.builder().field(GoodsDonFrontSkuView::getGoodsId, data.getId()).field(GoodsDonFrontSkuView::getStatus, true).orderBy(GoodsDonFrontSkuView::getPrice).asc().build()));
+            data.setSkuList(beanSearcher.searchAll(GoodsDonFrontSkuView.class, MapUtils.builder()
+                    .field(GoodsDonFrontSkuView::getGoodsId, data.getId())
+                    .field(GoodsDonFrontSkuView::getStatus, true)
+                    .field(GoodsDonFrontSkuView::getIsHide, isHide)
+                    .orderBy(GoodsDonFrontSkuView::getPrice)
+                    .asc()
+                    .build()));
             Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
                     .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
             data.setSold(sold + data.getVirtualSold());
 
             Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
-                GoodsDonFrontSkuView donFrontSkuView = skuList.get(0);
-                if (donFrontSkuView != null) {
+                if (skuList.size() > 0) {
+                    GoodsDonFrontSkuView donFrontSkuView = skuList.get(0);
                     data.setPrice(donFrontSkuView.getPrice());
                     data.setMonths(donFrontSkuView.getMonths());
                 }