فهرست منبع

fix

优化

fix

fix
zoujiajian 3 سال پیش
والد
کامیت
ceb92e833c

+ 40 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonSpecFrontView.java

@@ -0,0 +1,40 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+/*
+ *项目名: netflix
+ *文件名: GoodsDonSpecFrontView
+ *创建者: JavaZou
+ *创建时间:2023/7/26 14:36
+ */
+@Getter
+@Setter
+@SearchBean(tables = "goods_don_spec")
+public class GoodsDonSpecFrontView {
+	private Long id;
+
+	private Long goodsId;
+
+	/**
+	 * 商品总规格 json
+	 */
+	private String specsJson;
+
+	/**
+	 * 规格属性值最大id
+	 */
+	private Long maxId;
+
+	/**
+	 * 商品规格数量
+	 */
+	private Integer specNumber;
+
+	/**
+	 * 属性id - 整体 映射
+	 */
+	private String specMapping;
+}

+ 108 - 7
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonViews.java

@@ -1,12 +1,12 @@
 package com.cyksj.model.views;
 
 import com.cyksj.model.entity.GoodsDon;
-import com.cyksj.model.entity.GoodsDonSku;
-import com.cyksj.model.entity.GoodsDonSpec;
 import com.ejlchina.searcher.bean.DbIgnore;
+import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -16,14 +16,115 @@ import java.util.List;
 
 @Getter
 @Setter
-public class GoodsDonViews extends GoodsDon {
+@SearchBean(tables = "goods_don")
+public class GoodsDonViews {
 
-    @DbIgnore
-    private List<GoodsDonSku> skuList;
+    private Integer id;
+
+    /**
+     * 标签
+     */
+    private String tags;
+
+    /**
+     * 商品名称
+     */
+    private String title;
+
+    /**
+     * 缩略图
+     */
+    private String logo;
+
+    /**
+     * 背景图
+     */
+    private String img;
+
+    /**
+     * 详情
+     */
+    private String detail;
+
+    /**
+     * 描述
+     */
+    private String remark;
+
+    private Integer type;
+
+    /**
+     * 分类
+     * 1、AI  2、流媒体
+     */
+    private Integer category;
+
+    /**
+     * 二级分类
+     * 虚物品 1邀请制 2非邀请制
+     */
+    private Integer secondType;
+
+    private String banner;
+
+    /**
+     * 最小规格价格
+     */
+    private BigDecimal minPrice;
+
+    /**
+     * 最小规格价格月份
+     */
+    private Integer minMonths;
+
+    /**
+     * 最小规格 天数
+     */
+    private Integer minDays;
+
+    /**
+     * 最大规格价格
+     */
+    private BigDecimal maxPrice;
+
+    /**
+     * 最大规格价格月份
+     */
+    private Integer maxMonths;
+
+    /**
+     * 最大规格 天数
+     */
+    private Integer maxDays;
+
+    /**
+     * 付款说明
+     */
+    private String payDesc;
+
+    /**
+     * 特殊类型
+     */
+    private GoodsDon.SpecialType specialType;
+
+    /**
+     * 视频
+     */
+    private String video;
+
+    /**
+     * 推荐标题
+     */
+    private String recommendTitle;
+
+    /**
+     * 推荐平台
+     */
+    private String recommendGoods;
 
     @DbIgnore
-    private GoodsDonSpec specs;
+    private List<GoodsDonFrontSkuView> skuList;
 
     @DbIgnore
-    private List<GoodsDon> recommendGoodsList;
+    private GoodsDonSpecFrontView specs;
 }

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

@@ -73,19 +73,19 @@ public class GoodsFrontListView {
 	/**
 	 * 最低规格价格
 	 */
-	@DbIgnore
+	@DbField("g.min_price")
 	private BigDecimal price;
 
 	/**
 	 * 最低规格月份
 	 */
-	@DbIgnore
+	@DbField("g.min_months")
 	private Integer months;
 
 	/**
 	 * 最低规格天数
 	 */
-	@DbIgnore
+	@DbField("g.min_days")
 	private Integer days;
 
 	/**

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

@@ -62,19 +62,19 @@ public class GoodsHomePageView {
 	/**
 	 * 最低规格价格
 	 */
-	@DbIgnore
+	@DbField("g.min_price")
 	private BigDecimal price;
 
 	/**
 	 * 最低规格月份
 	 */
-	@DbIgnore
+	@DbField("g.min_months")
 	private Integer months;
 
 	/**
 	 * 最低规格天数
 	 */
-	@DbIgnore
+	@DbField("g.min_days")
 	private Integer days;
 
 	/**

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -82,8 +82,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			}
 			if (isLoginPopularize != null && isLoginPopularize) {
 				GoodsDonViews views = beanSearcher.searchFirst(GoodsDonViews.class, MapUtils.builder().field(GoodsDonViews::getId, ticket.getGoodsId()).build());
-				views.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, views.getId()).build()));
-				views.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder().field(GoodsDonSku::getGoodsId, views.getId()).field(GoodsDonSku::getStatus, true).build()));
+				views.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, views.getId()).build()));
+				views.setSkuList(beanSearcher.searchAll(GoodsDonFrontSkuView.class, MapUtils.builder().field(GoodsDonFrontSkuView::getGoodsId, views.getId()).field(GoodsDonFrontSkuView::getStatus, true).build()));
 				ticket.setGoodsDonViews(views);
 			}
 			if (ticket.getMonths() != null && ticket.getMonths() >= 300) {

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

@@ -183,15 +183,6 @@ public class GoodsDonController {
             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 -> {
-                if (skuList.size() > 0) {
-                    GoodsDonFrontSkuView donFrontSkuView = skuList.get(0);
-                    data.setPrice(donFrontSkuView.getPrice());
-                    data.setMonths(donFrontSkuView.getMonths());
-                    data.setDays(donFrontSkuView.getDays());
-                }
-            });
             OrderCommentFrontView comments = beanSearcher.searchFirst(OrderCommentFrontView.class, MapUtils.builder()
                     .field(OrderCommentFrontView::getGoodsId, data.getId())
                     .orderBy(OrderCommentFrontView::getCommentTime).desc()
@@ -234,12 +225,6 @@ public class GoodsDonController {
             Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
                     .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
             data.setSold(sold + data.getVirtualSold());
-            GoodsDonFrontSkuView skuView = beanSearcher.searchFirst(GoodsDonFrontSkuView.class, MapUtils.builder().field(GoodsDonFrontSkuView::getGoodsId, data.getId()).field(GoodsDonFrontSkuView::getStatus, true).orderBy(GoodsDonFrontSkuView::getPrice).asc().build());
-            if (skuView != null) {
-                data.setPrice(skuView.getPrice());
-                data.setMonths(skuView.getMonths());
-                data.setDays(skuView.getDays());
-            }
             data.setNotifyMsg(getPayMsgTime(data.getId(), now, 1));
         });
         redisService.setNx(h5CacheKey, dataList, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
@@ -283,14 +268,13 @@ public class GoodsDonController {
     public Result<GoodsDonViews> getDetail(@PathVariable Long id) {
         GoodsDonViews views = beanSearcher.searchFirst(GoodsDonViews.class, MapUtils.builder().field(GoodsDonViews::getId, id).build());
 
-        views.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, views.getId()).build()));
+        views.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, views.getId()).build()));
         MapBuilder builder = MapUtils.builder().field(GoodsDonSku::getGoodsId, views.getId()).field(GoodsDonSku::getStatus, true);
 
-        GoodsDonSkuView goodsDonSkuView = beanSearcher.searchFirst(GoodsDonSkuView.class, MapUtils.builder().field(GoodsDonSkuView::getGoodsId, id).build());
-        if (goodsDonSkuView != null && goodsDonSkuView.getType() == 1) {
+        if (views.getType() == 1) {
             builder.orderBy(GoodsDonSku::getOrderBy).asc();
         }
-        views.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, builder.build()));
+        views.setSkuList(beanSearcher.searchAll(GoodsDonFrontSkuView.class, builder.build()));
         return GatewayResponse.SUCCESS.newBuilder().toResult(views);
     }