From b576d6c3f90817ba2ab1bda2dabd94bf1031a961 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 13 一月 2025 17:02:08 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java                     |    2 +-
 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsClientFallbackFactory.java      |    5 +++++
 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java                 |    8 ++++++++
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java             |    3 ++-
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java |    2 +-
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java         |    4 +++-
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java                  |   11 +++++++++++
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java               |    3 ++-
 8 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java
index b2be4f0..0a360ff 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java
@@ -115,7 +115,7 @@
     @ApiModelProperty(value = "可领取对应的ids,用find_in_set查询")
     @TableField("person_ids")
     private String personIds;
-
+    
     @ApiModelProperty(value = "商品卷对应的商品名称")
     @TableField(exist = false)
     private List<String> goodNames;
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsClientFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsClientFallbackFactory.java
index 014df1f..d45bfcb 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsClientFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsClientFallbackFactory.java
@@ -39,6 +39,11 @@
 			public R editGoodsList(List<Goods> goods) {
 				return R.fail("编辑商品信息失败:" + cause.getMessage());
 			}
+			
+			@Override
+			public R<List<Goods>> getAllGoods() {
+				return R.fail("获取所有商品失败:" + cause.getMessage());
+			}
 		};
 	}
 }
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
index 0bb389f..0177fed 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
@@ -48,4 +48,12 @@
 	 */
 	@PostMapping("/goods/editGoods")
 	R editGoodsList(@RequestBody List<Goods> goods);
+	
+	
+	/**
+	 * 获取所有商品
+	 * @return
+	 */
+	@PostMapping("/goods/getAllGoods")
+	R<List<Goods>> getAllGoods();
 }
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
index 28eb386..82a2c24 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -86,7 +86,9 @@
             if (vo.getCouponType()==4){
                 List<String> goodNames = new ArrayList<>();
                 if (vo.getForGoodIds().equals("-1")){
-                        goodNames.add("全部商品");
+                    List<Goods> data1 = goodsClient.getAllGoods().getData();
+                    List<String> collect = data1.stream().map(Goods::getName).collect(Collectors.toList());
+                    goodNames.addAll(collect);
                 }else{
                     String[] split = vo.getForGoodIds().split(",");
                     R<List<Goods>> goodsById = goodsClient.getGoodsById(split);
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
index 1a20f52..049d1f5 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -220,5 +220,16 @@
         goodsService.updateBatchById(goods);
         return R.ok();
     }
+    
+    
+    /**
+     * 获取所有商品
+     * @return
+     */
+    @PostMapping("/getAllGoods")
+    public R<List<Goods>> getAllGoods(){
+        List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2));
+        return R.ok(list);
+    }
 }
 
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
index ef1e872..c544de9 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -100,7 +100,8 @@
             if (appUser ==null){
                 return R.fail("当前号码暂无注册用户");
             }
-
+            appUser.setUserType(2);
+            appUserClient.editAppUserById(appUser);
             AppUserShop appUserShop = new AppUserShop();
             appUserShop.setShopId(sysUser.getObjectId());
             appUserShop.setAppUserId(appUser.getId());
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
index f44c255..e396059 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -261,7 +261,8 @@
         Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 1).getData();
         goodsVO.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();
+                .orderByDesc(GoodsEvaluate::getGrade).eq(GoodsEvaluate::getStatus, 2).isNotNull(GoodsEvaluate::getComment)
+                .eq(GoodsEvaluate::getDelFlag, 0).last(" limit 0, 1").one();
         if (null != goodsEvaluate) {
             AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId());
             if(null != appUserById){
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 5b8e730..8d23f4c 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
@@ -134,7 +134,7 @@
         seckillActivityDetailVO.setShopList(shops);
         Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 2).getData();
         seckillActivityDetailVO.setSaleNum(integer);
-        GoodsEvaluate goodsEvaluate = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId)
+        GoodsEvaluate goodsEvaluate = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).isNotNull(GoodsEvaluate::getComment)
                 .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());

--
Gitblit v1.7.1