From 24cdf5cf00e9da7045fbe6733147d3f4b38238a3 Mon Sep 17 00:00:00 2001 From: misworga831 Date: Mon, 6 Nov 2023 17:50:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=95=86=E5=93=81=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=90=8E=EF=BC=8C=E6=B8=85=E9=99=A4sku?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=89=E5=9B=BE=E8=AF=84=E4=BB=B7=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=9D=A1=E4=BB=B6=E7=BC=BA=E5=B0=91=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/goods/service/GoodsSkuService.java | 3 +-- .../cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java | 2 +- .../lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java | 4 ++-- .../member/serviceimpl/MemberEvaluationServiceImpl.java | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/service/GoodsSkuService.java b/framework/src/main/java/cn/lili/modules/goods/service/GoodsSkuService.java index afe5cfc8..f31091ce 100644 --- a/framework/src/main/java/cn/lili/modules/goods/service/GoodsSkuService.java +++ b/framework/src/main/java/cn/lili/modules/goods/service/GoodsSkuService.java @@ -255,9 +255,8 @@ public interface GoodsSkuService extends IService { * 更新商品sku评分 * * @param goodsId goodsId - * @param skuId skuId * @param grade 评分 * @param commentNum 评论数量 */ - void updateGoodsSkuGrade(String goodsId, String skuId, double grade,int commentNum); + void updateGoodsSkuGrade(String goodsId, double grade,int commentNum); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index 98de2371..bab90070 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -474,7 +474,7 @@ public class GoodsServiceImpl extends ServiceImpl implements // 修改商品sku评价数量 - this.goodsSkuService.updateGoodsSkuGrade(goodsId, skuId, grade, goods.getCommentNum()); + this.goodsSkuService.updateGoodsSkuGrade(goodsId, grade, goods.getCommentNum()); Map updateIndexFieldsMap = EsIndexUtil.getUpdateIndexFieldsMap(MapUtil.builder(new HashMap()).put("goodsId", goodsId).build(), MapUtil.builder(new HashMap()).put("commentNum", goods.getCommentNum()).put("highPraiseNum", highPraiseNum).put("grade", grade).build()); applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("更新商品索引信息", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.UPDATE_GOODS_INDEX_FIELD.name(), JSONUtil.toJsonStr(updateIndexFieldsMap))); diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index a03abd7a..38c8bfae 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -659,13 +659,13 @@ public class GoodsSkuServiceImpl extends ServiceImpl i } @Override - public void updateGoodsSkuGrade(String goodsId, String skuId, double grade, int commentNum) { + public void updateGoodsSkuGrade(String goodsId, double grade, int commentNum) { LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(GoodsSku::getGoodsId, goodsId); updateWrapper.set(GoodsSku::getGrade, grade); updateWrapper.set(GoodsSku::getCommentNum, commentNum); this.update(updateWrapper); - clearCache(skuId); + this.getSkuIdsByGoodsId(goodsId).forEach(this::clearCache); } /** diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java index b0127cb0..cc10d2f6 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberEvaluationServiceImpl.java @@ -194,6 +194,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl() .eq("have_image", 1) + .eq("status", SwitchEnum.OPEN.name()) .eq("goods_id", goodsId))); return evaluationNumberVO;