From b22df417e0bc423c788b013feaad686531d69eed Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 08 一月 2025 09:51:37 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

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 387c300..05f7de5 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
@@ -16,6 +16,7 @@
 import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.order.feignClient.OrderClient;
 import com.ruoyi.order.feignClient.RemoteOrderGoodsClient;
 import com.ruoyi.order.vo.Price;
 import com.ruoyi.other.api.domain.*;
@@ -82,6 +83,8 @@
     private GoodsBargainPriceService goodsBargainPriceService;
     @Resource
     private GoodsBargainPriceDetailService goodsBargainPriceDetailService;
+    @Resource
+    private OrderClient orderClient;
 
 
 
@@ -103,8 +106,10 @@
         }
         List<GoodsVO> list = this.baseMapper.goodsList(pageInfo, search.getGoodsCategoryId(), search.getName(), vipId);
         for (GoodsVO goods : list) {
-            Price price = getPrice(vipId, goods.getGoodsId(), 1, null, provinceCode, cityCode, districtCode);
+            Price price = getPrice(vipId, goods.getGoodsId(), null, 1, provinceCode, cityCode, districtCode);
             if(null != price){
+                goods.setCashPayment(price.getCashPayment() ? 1 : 0);
+                goods.setPointPayment(price.getPointPayment() ? 1 : 0);
                 goods.setSellingPrice(price.getCash());
                 goods.setIntegral(price.getPoint());
             }
@@ -139,6 +144,8 @@
         goodsVO.setGoodsName(goods.getName());
         Price price = getPrice(vipId, goods.getId(), 1, null, provinceCode, cityCode, districtCode);
         if(null != price){
+            goodsVO.setPointPayment(price.getPointPayment() ? 1 : 0);
+            goodsVO.setCashPayment(price.getCashPayment() ? 1 : 0);
             goodsVO.setSellingPrice(price.getCash());
             goodsVO.setIntegral(price.getPoint());
         }
@@ -163,6 +170,8 @@
                     .in(Shop::getDelFlag, 0));
             goodsVO.setShopList(shopList);
         }
+        Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 1).getData();
+        goodsVO.setSaleNum(integer);
         return goodsVO;
     }
 
@@ -184,8 +193,10 @@
         }
         List<Goods> goods = goodsMapper.selectListByShopId(pageInfo, shopId, vipId);
         for (Goods good : goods) {
-            Price price = getPrice(vipId, good.getId(), 1, shopId, provinceCode, cityCode, districtCode);
+            Price price = getPrice(vipId, good.getId(), shopId, 1, provinceCode, cityCode, districtCode);
             if(null != price){
+                good.setCashPayment(price.getCashPayment() ? 1 : 0);
+                good.setPointPayment(price.getPointPayment() ? 1 : 0);
                 good.setSellingPrice(price.getCash());
                 good.setIntegral(price.getPoint());
             }

--
Gitblit v1.7.1