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, 33 insertions(+), 3 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 8b28d1f..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
@@ -1,20 +1,32 @@
 package com.ruoyi.order.controller;
 
+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.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.order.service.ShoppingCartService;
 import com.ruoyi.order.vo.*;
+import com.ruoyi.other.api.domain.GoodsShop;
+import com.ruoyi.other.api.domain.Shop;
+import com.ruoyi.other.api.feignClient.GoodsShopClient;
+import com.ruoyi.other.api.feignClient.ShopClient;
+import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds;
+import com.ruoyi.system.api.model.LoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import model.ShoppingCart;
+import com.ruoyi.order.model.ShoppingCart;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/shopping-cart")
@@ -26,6 +38,13 @@
 	
 	@Resource
 	private TokenService tokenService;
+
+	@Resource
+	private GoodsShopClient goodsShopClient;
+	@Resource
+	private ShopClient shopClient;
+	@Resource
+	private AppUserClient appUserClient;
 	
 	
 	
@@ -89,9 +108,20 @@
 	@ResponseBody
 	@PostMapping("/shoppingCartPayment")
 	@ApiOperation(value = "购物车订单支付", tags = {"商城-购物车-小程序"})
-	public R<Void> shoppingCartPayment(@RequestBody ShoppingCartPayment shoppingCartPayment){
+	public R<String> shoppingCartPayment(@RequestBody ShoppingCartPayment shoppingCartPayment){
 		return shoppingCartService.shoppingCartPayment(shoppingCartPayment);
 	}
+
+
+
+
+
+	@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