From e734816f2da83f4d0f58d9d09cef45a3a658a466 Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期一, 13 一月 2025 17:12:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 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 0371f9a..073b178 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
@@ -44,6 +44,11 @@
 			public R<Void> editGoodsNum(Integer goodsId, Integer num) {
 				return R.fail();
 			}
+
+			@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 b185031..41001e5 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
@@ -55,4 +55,12 @@
 	 */
 	@PutMapping("/goods/editGoodsNum")
     R<Void> editGoodsNum(@RequestParam("goodsId") Integer goodsId, @RequestParam("num") Integer num);
+
+
+	/**
+	 * 获取所有商品
+	 * @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 4edee52..4fd3c4b 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
@@ -234,5 +234,16 @@
         goodsService.updateById(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 7c0eae0..c7aab3f 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
@@ -259,7 +259,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