Browse Source

1.商品详情评论模块接口业务返回信息新增满意度等级信息 2.商品详情评论模块接口业务返回信息新增多规格集合信息

multiwx
dy-hu 1 month ago
parent
commit
4abc2250f5
  1. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereProductSkuDAO.java
  2. 13
      cereshop-app/src/main/java/com/shop/cereshop/app/page/comment/WordComment.java
  3. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/CereProductSkuService.java
  4. 5
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereProductSkuServiceImpl.java
  5. 5
      cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CereShopCommentServiceImpl.java
  6. 4
      cereshop-app/src/main/resources/mybatis/mapper/product/CereProductSkuDAO.xml
  7. 2
      cereshop-app/src/main/resources/mybatis/mapper/shop/CereShopCommentDAO.xml

2
cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereProductSkuDAO.java

@ -43,6 +43,8 @@ public interface CereProductSkuDAO extends BaseMapper<CereProductSku> {
String findValueBySkuId(@Param("skuId") Long skuId);
List<String> findSkuValuesBySkuId(@Param("skuId") Long skuId);
Integer findStockNumberBySkuId(@Param("skuId") Long skuId);
List<CartSku> findStockNumberBySkus(@Param("skuIdList") List<Long> skuIdList);

13
cereshop-app/src/main/java/com/shop/cereshop/app/page/comment/WordComment.java

@ -87,4 +87,17 @@ public class WordComment {
*/
@ApiModelProperty(value = "追评天数")
private Integer day;
/**
* 商品满意度(宝贝描述) 1-一星 2-二星 3-三星 4-四星 5-五星
*/
private Integer star;
/**
* 规格id
*/
@ApiModelProperty(value = "规格id")
private Long skuId;
private List<String> skus;
}

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/CereProductSkuService.java

@ -29,6 +29,8 @@ public interface CereProductSkuService {
String findValueBySkuId(Long skuId);
List<String> findSkuValuesBySkuId(Long skuId);
Integer findStockNumberBySkuId(Long skuId);
Integer findStockNumber(Long skuId);

5
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereProductSkuServiceImpl.java

@ -60,6 +60,11 @@ public class CereProductSkuServiceImpl implements CereProductSkuService {
}
@Override
public List<String> findSkuValuesBySkuId(Long skuId) {
return cereProductSkuDAO.findSkuValuesBySkuId(skuId);
}
@Override
public Integer findStockNumberBySkuId(Long skuId) {
return cereProductSkuDAO.findStockNumberBySkuId(skuId);
}

5
cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CereShopCommentServiceImpl.java

@ -19,6 +19,7 @@ import com.shop.cereshop.app.param.comment.CommentParam;
import com.shop.cereshop.app.param.comment.CommentWorParam;
import com.shop.cereshop.app.param.comment.LikeParam;
import com.shop.cereshop.app.service.buyer.CereBuyerCommentLikeService;
import com.shop.cereshop.app.service.product.CereProductSkuService;
import com.shop.cereshop.app.service.shop.CereShopCommentService;
import com.shop.cereshop.commons.constant.IntegerEnum;
import com.shop.cereshop.commons.domain.buyer.CereBuyerUser;
@ -45,6 +46,9 @@ public class CereShopCommentServiceImpl implements CereShopCommentService {
@Autowired
private CereBuyerCommentLikeService cereBuyerCommentLikeService;
@Autowired
private CereProductSkuService cereProductSkuService;
@Override
public List<BuyerComment> findByProductId(Long productId) {
return cereShopCommentDAO.findByProductId(productId);
@ -123,6 +127,7 @@ public class CereShopCommentServiceImpl implements CereShopCommentService {
List<WordComment> list=cereShopCommentDAO.getProductAll(param);
if(!EmptyUtils.isEmpty(list)){
for (WordComment wordComment:list) {
wordComment.setSkus(cereProductSkuService.findSkuValuesBySkuId(wordComment.getSkuId()));
//计算追评时间和评价时间之间天数
if (!EmptyUtils.isEmpty(wordComment.getAddTime())) {
wordComment.setDay(TimeUtils.differentDaysByMillisecond(wordComment.getCreateTime(), wordComment.getAddTime()));

4
cereshop-app/src/main/resources/mybatis/mapper/product/CereProductSkuDAO.xml

@ -337,6 +337,10 @@
SELECT GROUP_CONCAT(value_code) from cere_sku_name where sku_id=#{skuId}
</select>
<select id="findSkuValuesBySkuId" parameterType="java.lang.Object" resultType="java.lang.String">
SELECT sku_value from cere_sku_name where sku_id=#{skuId}
</select>
<select id="findStockNumberBySkuId" parameterType="java.lang.Object" resultType="java.lang.Integer">
SELECT IF(b.if_oversold=1,999999,a.stock_number) from cere_product_sku a
LEFT JOIN cere_shop_product b ON a.product_id=b.product_id

2
cereshop-app/src/main/resources/mybatis/mapper/shop/CereShopCommentDAO.xml

@ -218,7 +218,7 @@
</select>
<select id="getProductAll" parameterType="com.shop.cereshop.app.param.comment.CommentWorParam" resultType="com.shop.cereshop.app.page.comment.WordComment">
SELECT a.comment_id,a.image,a.`comment`,a.add_image,a.add_comment,
SELECT a.comment_id,a.star,a.sku_id, a.image,a.`comment`,a.add_image,a.add_comment,
IF(c.wechat_name IS NULL,c.`name`,c.wechat_name) `name`,c.head_image,
a.create_time,a.add_time FROM cere_shop_comment a
LEFT JOIN cere_comment_word b ON a.comment_id=b.comment_id

Loading…
Cancel
Save