wangming 3 săptămâni în urmă
părinte
comite
3e952b5fed

+ 4 - 4
yami-shop-api/src/main/java/com/yami/shop/api/controller/ProdCommController.java

@@ -65,18 +65,18 @@ public class ProdCommController {
 
     @GetMapping("/commList")
     @ApiOperation(value = "商品详情-查看商品评价(0好评 1中评 2差评 3有图)")
-    public ResponseEntity<IPage<ProdComm>> commList(PageParam<ProdComm> page, Long skuId,Long shopId, Integer commStatus,Long channelId) {
+    public ResponseEntity<IPage<ProdComm>> commList(PageParam<ProdComm> page, Long prodId,Long shopId, Integer commStatus,Long channelId) {
         shopId = shopId == null ? 1 : shopId;
         channelId = channelId == null ? 1 : channelId;
-        return ResponseEntity.ok(prodCommService.commList(page,skuId,shopId,commStatus,channelId));
+        return ResponseEntity.ok(prodCommService.commList(page,prodId,shopId,commStatus,channelId));
     }
 
     @GetMapping("/commentCount")
     @ApiOperation(value = "商品详情-评价数量-好评率")
-    public ResponseEntity<Map<String, Object>> commentCount(Long skuId,Long shopId,Long channelId) {
+    public ResponseEntity<Map<String, Object>> commentCount(Long prodId,Long shopId,Long channelId) {
         shopId = shopId == null ? 1 : shopId;
         channelId = channelId == null ? 1 : channelId;
-        return ResponseEntity.ok(prodCommService.commentCount(skuId,shopId,channelId));
+        return ResponseEntity.ok(prodCommService.commentCount(prodId,shopId,channelId));
     }
 
     @GetMapping("/myCommList")

+ 2 - 2
yami-shop-api/src/main/java/com/yami/shop/api/controller/SkuController.java

@@ -51,10 +51,10 @@ public class SkuController {
 
     @GetMapping("/buyTogetherOften")
     @ApiOperation(value = "商品详情-经常一起买")
-    public ResponseEntity<IPage<SkuBuyTogetherOftenVo>> buyTogetherOften(PageParam<SkuBuyTogetherOftenVo> page, Long skuId,Long shopId,Long channelId) {
+    public ResponseEntity<IPage<SkuBuyTogetherOftenVo>> buyTogetherOften(PageParam<SkuBuyTogetherOftenVo> page, Long prodId,Long shopId,Long channelId) {
         shopId = shopId == null ? 1 : shopId;
         channelId = channelId == null ? 1 : channelId;
-        return ResponseEntity.ok(skuService.buyTogetherOften(page,skuId,shopId,channelId));
+        return ResponseEntity.ok(skuService.buyTogetherOften(page,prodId,shopId,channelId));
     }
 
 }

+ 4 - 4
yami-shop-service/src/main/java/com/yami/shop/dao/ProdCommMapper.java

@@ -30,15 +30,15 @@ public interface ProdCommMapper extends BaseMapper<ProdComm> {
 
     IPage<ProdComm> getProdCommPage(Page page, @Param("prodComm") ProdComm prodComm, @Param("shopId") Long shopId);
 
-    IPage<ProdComm> commList(@Param("page") PageParam<ProdComm> page, @Param("skuId") Long skuId,
+    IPage<ProdComm> commList(@Param("page") PageParam<ProdComm> page, @Param("prodId") Long prodId,
                              @Param("shopId") Long shopId,@Param("commStatus") Integer commStatus,
                              @Param("channelId") Long channelId);
 
-    Integer commentCount(@Param("skuId") Long skuId, @Param("shopId") Long shopId, @Param("evaluate") Integer evaluate,@Param("channelId") Long channelId);
+    Integer commentCount(@Param("prodId") Long prodId, @Param("shopId") Long shopId, @Param("evaluate") Integer evaluate,@Param("channelId") Long channelId);
 
-    Integer picCount(@Param("skuId") Long skuId, @Param("shopId") Long shopId,@Param("channelId") Long channelId);
+    Integer picCount(@Param("prodId") Long prodId, @Param("shopId") Long shopId,@Param("channelId") Long channelId);
 
-    String goodRate(@Param("skuId") Long skuId, @Param("shopId") Long shopId,@Param("channelId") Long channelId);
+    String goodRate(@Param("prodId") Long prodId, @Param("shopId") Long shopId,@Param("channelId") Long channelId);
 
     IPage<ProdComm> myCommList(@Param("page") PageParam<ProdComm> page, @Param("userId") String userId);
 

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/dao/SkuMapper.java

@@ -53,6 +53,6 @@ public interface SkuMapper extends BaseMapper<Sku> {
     Sku selectByHbSkuId(@Param("hbSkuId") String hbSkuId);
 
     IPage<SkuBuyTogetherOftenVo> buyTogetherOften(@Param("page") PageParam<SkuBuyTogetherOftenVo> page,
-                                                  @Param("skuId") Long skuId, @Param("shopId") Long shopId,
+                                                  @Param("prodId") Long prodId, @Param("shopId") Long shopId,
                                                   @Param("channelId") Long channelId);
 }

+ 2 - 2
yami-shop-service/src/main/java/com/yami/shop/service/ProdCommService.java

@@ -32,9 +32,9 @@ public interface ProdCommService extends IService<ProdComm> {
 
     void comm(Order order, ProdCommParam prodCommParam);
 
-    IPage<ProdComm> commList(PageParam<ProdComm> page,Long skuId,Long shopId,Integer commStatus,Long channelId);
+    IPage<ProdComm> commList(PageParam<ProdComm> page,Long prodId,Long shopId,Integer commStatus,Long channelId);
 
-    Map<String, Object> commentCount(Long skuId, Long shopId,Long channelId);
+    Map<String, Object> commentCount(Long prodId, Long shopId,Long channelId);
 
     IPage<ProdComm> myCommList(PageParam<ProdComm> page, String userId);
 

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/service/SkuService.java

@@ -65,5 +65,5 @@ public interface SkuService extends IService<Sku> {
 
     void removeSkuCacheBySkuId(Long skuId, Long prodId);
 
-    IPage<SkuBuyTogetherOftenVo> buyTogetherOften(PageParam<SkuBuyTogetherOftenVo> page, Long skuId,Long shopId,Long channelId);
+    IPage<SkuBuyTogetherOftenVo> buyTogetherOften(PageParam<SkuBuyTogetherOftenVo> page, Long prodId,Long shopId,Long channelId);
 }

+ 9 - 9
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdCommServiceImpl.java

@@ -130,8 +130,8 @@ public class ProdCommServiceImpl extends ServiceImpl<ProdCommMapper, ProdComm> i
     }
 
     @Override
-    public IPage<ProdComm> commList(PageParam<ProdComm> page, Long skuId,Long shopId,Integer commStatus,Long channelId) {
-        IPage<ProdComm> commList = prodCommMapper.commList(page, skuId,shopId,commStatus,channelId);
+    public IPage<ProdComm> commList(PageParam<ProdComm> page, Long prodId,Long shopId,Integer commStatus,Long channelId) {
+        IPage<ProdComm> commList = prodCommMapper.commList(page, prodId,shopId,commStatus,channelId);
         List<ProdComm> records = commList.getRecords();
         if (!records.isEmpty()){
             records.forEach(c->
@@ -142,14 +142,14 @@ public class ProdCommServiceImpl extends ServiceImpl<ProdCommMapper, ProdComm> i
     }
 
     @Override
-    public Map<String, Object> commentCount(Long skuId, Long shopId,Long channelId) {
+    public Map<String, Object> commentCount(Long prodId, Long shopId,Long channelId) {
         Map<String, Object> map = new LinkedTreeMap<>();
-        map.put("all", prodCommMapper.commentCount(skuId, shopId,null,channelId));
-        map.put("goodCount", prodCommMapper.commentCount(skuId, shopId,0,channelId));
-        map.put("middleCount", prodCommMapper.commentCount(skuId, shopId,1,channelId));
-        map.put("badCount", prodCommMapper.commentCount(skuId, shopId,2,channelId));
-        map.put("picCount", prodCommMapper.picCount(skuId, shopId,channelId));
-        map.put("goodRate", prodCommMapper.goodRate(skuId, shopId,channelId));
+        map.put("all", prodCommMapper.commentCount(prodId, shopId,null,channelId));
+        map.put("goodCount", prodCommMapper.commentCount(prodId, shopId,0,channelId));
+        map.put("middleCount", prodCommMapper.commentCount(prodId, shopId,1,channelId));
+        map.put("badCount", prodCommMapper.commentCount(prodId, shopId,2,channelId));
+        map.put("picCount", prodCommMapper.picCount(prodId, shopId,channelId));
+        map.put("goodRate", prodCommMapper.goodRate(prodId, shopId,channelId));
         return map;
     }
 

+ 2 - 2
yami-shop-service/src/main/java/com/yami/shop/service/impl/SkuServiceImpl.java

@@ -68,7 +68,7 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
     }
 
     @Override
-    public IPage<SkuBuyTogetherOftenVo> buyTogetherOften(PageParam<SkuBuyTogetherOftenVo> page, Long skuId,Long shopId,Long channelId) {
-        return skuMapper.buyTogetherOften(page, skuId,shopId,channelId);
+    public IPage<SkuBuyTogetherOftenVo> buyTogetherOften(PageParam<SkuBuyTogetherOftenVo> page, Long prodId,Long shopId,Long channelId) {
+        return skuMapper.buyTogetherOften(page, prodId,shopId,channelId);
     }
 }

+ 4 - 4
yami-shop-service/src/main/resources/mapper/ProdCommMapper.xml

@@ -163,7 +163,7 @@
         LEFT JOIN tz_user b on a.user_id=b.user_id
         WHERE a.order_number in (SELECT a.order_number FROM tz_order_item a
         LEFT JOIN tz_order b on a.order_number=b.order_number
-        WHERE a.sku_id = #{skuId} and a.shop_id = #{shopId} and b.channel_id=#{channelId}) and a.`status`=1
+        WHERE a.prod_id = #{prodId} and a.shop_id = #{shopId} and b.channel_id=#{channelId}) and a.`status`=1
         <choose>
             <when test="commStatus == 3">
                 and !ISNULL(a.pics)
@@ -180,7 +180,7 @@
         FROM tz_prod_comm
         WHERE order_number in (SELECT a.order_number FROM tz_order_item a
         LEFT JOIN tz_order b on a.order_number=b.order_number
-        WHERE a.sku_id = #{skuId} and a.shop_id = #{shopId} and b.channel_id=#{channelId})
+        WHERE a.prod_id = #{prodId} and a.shop_id = #{shopId} and b.channel_id=#{channelId})
         and `status` = 1
         <if test="evaluate!=null">
             and evaluate = #{evaluate}
@@ -193,7 +193,7 @@
         WHERE order_number in (SELECT a.order_number
                                FROM tz_order_item a
                                         LEFT JOIN tz_order b on a.order_number = b.order_number
-                               WHERE a.sku_id = #{skuId}
+                               WHERE a.prod_id = #{prodId}
                                  and a.shop_id = #{shopId}
                                  and b.channel_id = #{channelId})
           and `status` = 1
@@ -207,7 +207,7 @@
         WHERE pc.order_number in (SELECT a.order_number
                                   FROM tz_order_item a
                                            LEFT JOIN tz_order b on a.order_number = b.order_number
-                                  WHERE a.sku_id = #{skuId}
+                                  WHERE a.prod_id = #{prodId}
                                     and a.shop_id = #{shopId}
                                     and b.channel_id = #{channelId})
     </select>

+ 2 - 2
yami-shop-service/src/main/resources/mapper/SkuMapper.xml

@@ -188,8 +188,8 @@
                  LEFT JOIN tz_shop_sku d on a.sku_id = d.sku_id and d.is_delete = 0
         WHERE a.order_number in (SELECT a.order_number FROM tz_order_item a
                                  LEFT JOIN tz_order b on a.order_number=b.order_number
-                                 WHERE a.sku_id = #{skuId} and a.shop_id = #{shopId} and b.channel_id=#{channelId})
-          and a.sku_id!=#{skuId}
+                                 WHERE a.prod_id = #{prodId} and a.shop_id = #{shopId} and b.channel_id=#{channelId})
+          and a.prod_id!=#{prodId}
           and a.shop_id=#{shopId}
           and b.`status`=1
           and b.is_delete=0