From 7561637eacd5cae562bfdc030896ca38d07933ed Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 08 十月 2024 14:24:53 +0800
Subject: [PATCH] bug修改

---
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java |    3 ++-
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java      |    2 +-
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java      |    4 ++--
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java      |    6 +++---
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
index 7eb2fdc..f51d11a 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
@@ -16,6 +16,7 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.PathVariable;
 
 import java.util.List;
 
@@ -76,7 +77,7 @@
             }
 
             @Override
-            public R<Long> getCar() {
+            public R<Long> getCar(@PathVariable("id")String id) {
                 return R.fail("获取用户最近使用车辆充电的车辆id:" + throwable.getMessage());
             }
     
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
index 1d3aac3..0dc3302 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
@@ -69,8 +69,8 @@
      * 获取用户最近使用车辆充电的车辆id
      * @return
      */
-    @GetMapping(value = "/t-charging-order/getCar")
-    public R<Long> getCar();
+    @GetMapping(value = "/t-charging-order/getCar/{id}")
+    public R<Long> getCar(@PathVariable("id")String id);
     
     
     /**
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
index e5e83f0..a0d19f9 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
@@ -113,7 +113,7 @@
         List<TAppUserCar> cars = appUserCarService.list(new QueryWrapper<TAppUserCar>()
                 .eq("app_user_id",tokenService.getLoginUserApplet().getUserId())
                 .orderByDesc("create_time"));
-        Long data1 = chargingOrderClient.getCar().getData();
+        Long data1 = chargingOrderClient.getCar(tokenService.getLoginUserApplet().getUserId().toString()).getData();
         Integer data2 = otherClient.getAddCarIntegral().getData();
         data.setIntegral(data2);
         if (!cars.isEmpty()){
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
index e021a0f..5d956d1 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -342,10 +342,10 @@
      * @param
      * @return
      */
-    @GetMapping(value = "/getCar")
-    public R<Long> getCar() {
+    @GetMapping(value = "/getCar/{id}")
+    public R<Long> getCar(@PathVariable("id")String id) {
         List<TChargingOrder> list = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>()
-                .eq(TChargingOrder::getAppUserId, tokenService.getLoginUserApplet().getUserId())
+                .eq(TChargingOrder::getAppUserId, id)
                 .isNotNull(TChargingOrder::getAppUserCarId));
         if (!list.isEmpty()){
             // 最近使用的车辆id

--
Gitblit v1.7.1