From 36f2f14ace300855a436f1ed9faf07049587a08f Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 04 一月 2025 09:31:26 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java |   36 +++++++++++-------------------------
 1 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java
index 6ba0a73..a3e9576 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java
@@ -2,6 +2,8 @@
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.model.AppUser;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -41,6 +43,8 @@
 	private GoodsShopClient goodsShopClient;
 	@Resource
 	private ShopClient shopClient;
+	@Resource
+	private AppUserClient appUserClient;
 	
 	
 	
@@ -109,32 +113,14 @@
 	}
 
 
-	@ResponseBody
-	@GetMapping("/getVerifiableShop")
-	@ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"})
-	public R<List<VerifiableShopVo>> getVerifiableShop(){
-		LoginUser loginUser = tokenService.getLoginUser();
-		List<ShoppingCart> shoppingCarts = shoppingCartService.list(new LambdaQueryWrapper<ShoppingCart>()
-				.eq(ShoppingCart::getAppUserId, loginUser.getUserid()));
 
-		List<Integer> goodsIds = shoppingCarts.stream().map(ShoppingCart::getGoodsId).collect(Collectors.toList());
-		GetGoodsShopByGoodsIds goodsShopByGoodsIds = new GetGoodsShopByGoodsIds();
-		goodsShopByGoodsIds.setGoodsIds(goodsIds);
-		R<List<GoodsShop>> r = goodsShopClient.getGoodsShopByGoodsIds(goodsShopByGoodsIds);
-		List<GoodsShop> goodsShops = r.getData();
-		List<VerifiableShopVo> verifiableShopVoList = new ArrayList<>();
-		if (CollectionUtil.isNotEmpty(goodsShops)){
-			for (GoodsShop goodsShop : goodsShops) {
-				R<Shop> shopR = shopClient.getShopById(goodsShop.getShopId());
-				if (R.isSuccess(shopR)){
-					VerifiableShopVo verifiableShopVo = new VerifiableShopVo();
-					verifiableShopVo.setId(shopR.getData().getId());
-					verifiableShopVo.setName(shopR.getData().getName());
-					verifiableShopVoList.add(verifiableShopVo);
-				}
-			}
-		}
-		return R.ok(verifiableShopVoList);
+
+
+	@GetMapping("/getGoodsPrice")
+	public R<Price> getGoodsPrice(Long appUserId, Integer goodsId, Integer shopId){
+		AppUser appUser = appUserClient.getAppUserById(appUserId);
+		Price price = shoppingCartService.getPrice(appUser, goodsId, shopId);
+		return R.ok(price);
 	}
 	
 	

--
Gitblit v1.7.1