From dd45d210e2cbc60321fd3ed0c2ef5a0ba533faf5 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期日, 12 四月 2026 15:13:59 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/YueKeDuo

---
 DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
index 244b2fd..c7d7f2d 100644
--- a/DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
+++ b/DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -12,15 +12,18 @@
 import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
 import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
 import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
+import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
 import com.stylefeng.guns.modular.system.dao.DriverWorkMapper;
 import com.stylefeng.guns.modular.system.model.*;
 import com.stylefeng.guns.modular.system.service.*;
 import com.stylefeng.guns.modular.system.util.ChinaMobileUtil;
+import com.stylefeng.guns.modular.system.util.PayMoneyUtil;
 import com.stylefeng.guns.modular.system.util.PushUtil;
 import com.stylefeng.guns.modular.system.util.ResultUtil;
 import com.stylefeng.guns.modular.system.util.SystemException;
 import com.stylefeng.guns.modular.system.warpper.*;
 import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
+import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
 import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -33,6 +36,8 @@
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.PrintWriter;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -72,6 +77,15 @@
 
     @Autowired
     private ICarService carService;
+
+    @Autowired
+    private IOrderTaxiService orderTaxiService;
+
+    @Autowired
+    private IOrderPrivateCarService orderPrivateCarService;
+
+    @Autowired
+    private PayMoneyUtil payMoneyUtil;
 
     @Autowired
     private IOrderPrivateCarService orderPrivateCarService;
@@ -1104,4 +1118,44 @@
             return ResultUtil.success();
         }
     }
+
+    /**
+     * 预支付微信退款成功回调
+     * @param request
+     * @param response
+     */
+    @ResponseBody
+    @PostMapping("/base/prepayRefundWXPay")
+    public void prepayRefundWXPay(HttpServletRequest request, HttpServletResponse response) {
+        try {
+            Map<String, String> map = payMoneyUtil.wxRefundCallback(request);
+            if (map == null) {
+                return;
+            }
+            String refundId = map.get("refund_id");
+            String outRefundNo = map.get("out_refund_no");
+            String result = map.get("result");
+            if (ToolUtil.isEmpty(outRefundNo)) {
+                return;
+            }
+            PrintWriter out = response.getWriter();
+            out.write(result);
+            out.flush();
+            out.close();
+
+            String[] split = outRefundNo.split("_");
+            if (split.length < 4) {
+                return;
+            }
+            Integer orderType = Integer.valueOf(split[1]);
+            Integer orderId = Integer.valueOf(split[2]);
+            if (orderType == 1) {
+                orderPrivateCarService.payPrepaidRefundCallback(orderId, outRefundNo, refundId);
+            } else if (orderType == 2) {
+                orderTaxiService.payPrepaidRefundCallback(orderId, outRefundNo, refundId);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }

--
Gitblit v1.7.1