Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/develop' into develop

yuanliang 1 gadu atpakaļ
vecāks
revīzija
141bb9bf4b

+ 8 - 1
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/open/UserPaymentClient.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.admin.controller.open;
 
+import cn.hutool.extra.servlet.ServletUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.huifu.adapay.core.AdapayCore;
@@ -103,7 +104,8 @@ public class UserPaymentClient {
 
     @ApiOperation(value = "用户付款", notes = "用户付款")
     @PostMapping("/executePayment/v2")
-    public R<UserPaymentOrderWrapper.PaymentReq> executePayment(@Validated @RequestBody UserPaymentOrderWrapper.PaymentOrderReqConfig config) {
+    public R<UserPaymentOrderWrapper.PaymentReq> executePayment(@Validated @RequestBody UserPaymentOrderWrapper.PaymentOrderReqConfig config,
+                                                                HttpServletRequest request) {
 
         // 用户登录状态校验
         if (StringUtils.isBlank(config.getUserId())) {
@@ -113,6 +115,11 @@ public class UserPaymentClient {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
+        reqConfig.setIp(ServletUtil.getClientIP(request));
+
         JwtUserInfo<Object> userInfo = JwtUserInfo.builder()
             .userId(config.getUserId())
             .clientType(config.getUserType().getCode())

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/UserOrderController.java

@@ -325,6 +325,9 @@ public class UserOrderController extends BaseController {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/open/UserPaymentClient.java

@@ -44,6 +44,9 @@ public class UserPaymentClient {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/vo/UserPaymentOrderVo.java

@@ -192,6 +192,9 @@ public class UserPaymentOrderVo {
     @ApiModel("订单支付参数配置")
     public static class PaymentReqConfig implements Serializable {
 
+        @ApiModelProperty("支付厂商")
+        private String paymentVendor;
+
         @ApiModelProperty("支付渠道")
         private String paymentChannel;
 

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/UserOrderController.java

@@ -287,6 +287,9 @@ public class UserOrderController extends BaseController {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/open/UserPaymentClient.java

@@ -44,6 +44,9 @@ public class UserPaymentClient {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/vo/UserPaymentOrderVo.java

@@ -192,6 +192,9 @@ public class UserPaymentOrderVo {
     @ApiModel("订单支付参数配置")
     public static class PaymentReqConfig implements Serializable {
 
+        @ApiModelProperty("支付厂商")
+        private String paymentVendor;
+
         @ApiModelProperty("支付渠道")
         private String paymentChannel;
 

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/controller/UserOrderController.java

@@ -108,6 +108,9 @@ public class UserOrderController {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/controller/open/UserPaymentClient.java

@@ -39,6 +39,9 @@ public class UserPaymentClient {
         // 用户下单请求
         UserPaymentOrderWrapper.PaymentOrderReqConfig reqConfig = UserPaymentOrderWrapper.PaymentOrderReqConfig.from(config.jsonString());
 
+        // 支付三方
+        reqConfig.setPaymentVendor(config.getPaymentVendor());
+        // 请示IP地址
         reqConfig.setIp(ServletUtil.getClientIP(request));
         // 创建用户支付数据
         UserPaymentOrderWrapper.PaymentReq paymentConfig = userPaymentCoreService.executePayment(JwtUserInfo.builder()

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/vo/UserPaymentOrderVo.java

@@ -192,6 +192,9 @@ public class UserPaymentOrderVo {
     @ApiModel("订单支付参数配置")
     public static class PaymentReqConfig implements Serializable {
 
+        @ApiModelProperty("支付厂商")
+        private String paymentVendor;
+
         @ApiModelProperty("支付渠道")
         private String paymentChannel;
 

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/UserPaymentOrderService.java

@@ -49,6 +49,12 @@ public interface UserPaymentOrderService   {
     void updateById(UserPaymentOrderWrapper.UserPaymentOrder order);
 
     /**
+     * 更新订单支付三方
+     * @param order UserPaymentOrderWrapper.UserPaymentOrder
+     */
+    void updatePaymentVendorById(UserPaymentOrderWrapper.UserPaymentOrder order);
+
+    /**
      * 创建订单
      *
      */

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentCoreServiceImpl.java

@@ -753,7 +753,7 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
                 .id(userPaymentOrder.getId())
                 .paymentVendor(reqConfig.getPaymentVendor())
                 .build();
-            userPaymentOrderService.updateById(update);
+            userPaymentOrderService.updatePaymentVendorById(update);
 
             // 重置支付三方渠道
             userPaymentOrder.setPaymentVendor(reqConfig.getPaymentVendor());

+ 17 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentOrderServiceImpl.java

@@ -213,6 +213,23 @@ public class UserPaymentOrderServiceImpl  implements UserPaymentOrderService {
     }
 
     /**
+     * 更新订单支付三方
+     *
+     * @param order UserPaymentOrderWrapper.UserPaymentOrder
+     */
+    @Override
+    public void updatePaymentVendorById(UserPaymentOrderWrapper.UserPaymentOrder order) {
+
+        if (order == null) {
+            return;
+        }
+
+        // 更新订单
+        UserOrder userOrder = order.toUserOrder();
+        userOrderService.updateById(userOrder);
+    }
+
+    /**
      * 创建订单
      *
      * @param orderReq