From 9400d0a1b60377ff914273ca33336fab2ae82c56 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 13 一月 2025 11:51:15 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
index 385dfad..5b8e730 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
@@ -14,6 +14,7 @@
 import com.ruoyi.other.mapper.GoodsShopMapper;
 import com.ruoyi.other.mapper.SeckillActivityInfoMapper;
 import com.ruoyi.other.mapper.ShopMapper;
+import com.ruoyi.other.service.GoodsEvaluateService;
 import com.ruoyi.other.service.GoodsSeckillService;
 import com.ruoyi.other.service.GoodsService;
 import com.ruoyi.other.service.SeckillActivityInfoService;
@@ -57,6 +58,8 @@
     private GoodsService goodsService;
     @Resource
     private OrderClient orderClient;
+    @Resource
+    private GoodsEvaluateService goodsEvaluateService;
 
     @Override
     public List<SeckillActivityVO> listSeckillActivity(Goods goods) {
@@ -131,6 +134,17 @@
         seckillActivityDetailVO.setShopList(shops);
         Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 2).getData();
         seckillActivityDetailVO.setSaleNum(integer);
+        GoodsEvaluate goodsEvaluate = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId)
+                .orderByDesc(GoodsEvaluate::getGrade).eq(GoodsEvaluate::getStatus, 2).eq(GoodsEvaluate::getDelFlag, 0).last(" limit 0, 1").one();
+        if (null != goodsEvaluate) {
+            AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId());
+            if(null != appUserById){
+                goodsEvaluate.setUserName(appUserById.getName());
+                goodsEvaluate.setAvatar(appUserById.getAvatar());
+                goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId()));
+            }
+        }
+        seckillActivityDetailVO.setGoodsEvaluate(goodsEvaluate);
         return seckillActivityDetailVO;
     }
 

--
Gitblit v1.7.1