From e88b02c55145624e6b8ef8f4cbd56d22b9bdfff9 Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期一, 13 一月 2025 20:00:36 +0800
Subject: [PATCH] 12.18
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 52 insertions(+), 2 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 a3e9576..8083049 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
@@ -9,6 +9,7 @@
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.util.payment.model.UniPayCallbackResult;
import com.ruoyi.order.vo.*;
import com.ruoyi.other.api.domain.GoodsShop;
import com.ruoyi.other.api.domain.Shop;
@@ -24,6 +25,9 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -111,7 +115,53 @@
public R<String> shoppingCartPayment(@RequestBody ShoppingCartPayment shoppingCartPayment){
return shoppingCartService.shoppingCartPayment(shoppingCartPayment);
}
-
+
+ /**
+ * 订单支付回调通知
+ */
+ @ResponseBody
+ @GetMapping("/shoppingCartPaymentCallback")
+ public void shoppingCartPaymentCallback(UniPayCallbackResult uniPayCallbackResult, HttpServletResponse response){
+ R callback = shoppingCartService.shoppingCartPaymentCallback(uniPayCallbackResult);
+ if(callback.getCode() == 200){
+ response.setStatus(200);
+ PrintWriter out = null;
+ try {
+ out = response.getWriter();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ out.println("success");
+ out.flush();
+ out.close();
+ }
+ }
+
+
+ /**
+ * 快递费支付回调
+ * @param uniPayCallbackResult
+ * @param response
+ */
+ @ResponseBody
+ @GetMapping("/shoppingCartMaterialFlowPaymentCallback")
+ public void shoppingCartMaterialFlowPaymentCallback(UniPayCallbackResult uniPayCallbackResult, HttpServletResponse response){
+ R callback = shoppingCartService.shoppingCartMaterialFlowPaymentCallback(uniPayCallbackResult);
+ if(callback.getCode() == 200){
+ response.setStatus(200);
+ PrintWriter out = null;
+ try {
+ out = response.getWriter();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ out.println("success");
+ out.flush();
+ out.close();
+ }
+ }
+
+
@@ -119,7 +169,7 @@
@GetMapping("/getGoodsPrice")
public R<Price> getGoodsPrice(Long appUserId, Integer goodsId, Integer shopId){
AppUser appUser = appUserClient.getAppUserById(appUserId);
- Price price = shoppingCartService.getPrice(appUser, goodsId, shopId);
+ Price price = shoppingCartService.getPrice(appUser, goodsId, 1, shopId);
return R.ok(price);
}
--
Gitblit v1.7.1