From 80fd77e1bcb47726e440b8a728838189cd39a56a Mon Sep 17 00:00:00 2001
From: longz <longzhaoz@qq.com>
Date: 星期二, 30 六月 2026 21:25:35 +0800
Subject: [PATCH] 跨城改派fix

---
 DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java |  143 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 135 insertions(+), 8 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 a64d68e..33080fa 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
@@ -4,29 +4,38 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.stylefeng.guns.core.util.DateUtil;
 import com.stylefeng.guns.core.util.ToolUtil;
+import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
+import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
+import com.stylefeng.guns.modular.crossCity.warpper.LineSiteWarpper;
 import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper;
 import com.stylefeng.guns.modular.crossCity.warpper.OrderWarpper;
 import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
 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;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 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;
@@ -67,6 +76,17 @@
     @Autowired
     private ICarService carService;
 
+    @Autowired
+    private IOrderTaxiService orderTaxiService;
+
+    @Autowired
+    private IOrderPrivateCarService orderPrivateCarService;
+
+    @Autowired
+    private PayMoneyUtil payMoneyUtil;
+
+    @Autowired
+    private IOrderCrossCityService orderCrossCityService;
 
 
 
@@ -435,7 +455,7 @@
      */
     @ResponseBody
     @PostMapping("/api/order/reassign")
-    @ApiOperation(value = "提交改派申请", tags = {"司机端-服务中"}, notes = "")
+    @ApiOperation(value = "提交改派申请(使用的)", tags = {"司机端-服务中"}, notes = "")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
             @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"),
@@ -450,7 +470,7 @@
             if(null == uid){
                 return ResultUtil.tokenErr();
             }
-            return reassignService.saveData(reassign, uid, null);
+            return reassignService.saveData(reassign, uid, null,reassign.getNowDriverId());
         }catch (SystemException s){
             return ResultUtil.error(s.getMsg());
         } catch (Exception e){
@@ -487,6 +507,27 @@
             return ResultUtil.runErr();
         }
     }
+
+
+    @ResponseBody
+    @RequestMapping(value = "/api/lineSite/queryDriverList", method = RequestMethod.POST)
+    @ApiOperation(value = "根据线路id获取其他线路排班数据", tags = {"司机端-跨城"}, notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "订单", name = "orderId", required = true, dataType = "String"),
+            @ApiImplicitParam(value = "查询天(2020-09-03)", name = "day", required = true, dataType = "string")
+    })
+    public ResultUtil<List<LineSiteWarpper>> queryDriverList(String orderId){
+        try {
+            List<Map<String, Object>> list = reassignService.queryDriver(orderId);
+            return ResultUtil.success(LineSiteWarpper.getLineSiteWarppers(list));
+        } catch (Exception e){
+            e.printStackTrace();
+            return ResultUtil.runErr();
+        }
+    }
+
+
+
 
 
 
@@ -652,6 +693,51 @@
     }
 
 
+    @ResponseBody
+    @PostMapping("/api/order/updateVoice")
+    @ApiOperation(value = "约克多-上传录音文件", tags = {"司机端-服务中"}, notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "fileUrl", name = "fileUrl", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+    })
+    public ResultUtil updateVoice(Integer orderId, Integer orderType, String fileUrl){
+        try{
+            if(orderType==1){
+                OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
+                orderPrivateCar.setVoice(fileUrl);
+                orderPrivateCar.setVoiceTime(new Date());
+                orderPrivateCarService.updateById(orderPrivateCar);
+                List<OrderPrivateCar> orderPrivateCars = orderPrivateCarService.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid", orderId));
+                for(OrderPrivateCar orderPrivateCar1 : orderPrivateCars){
+                    orderPrivateCar1.setVoice(fileUrl);
+                    orderPrivateCar1.setVoiceTime(new Date());
+                    orderPrivateCarService.updateById(orderPrivateCar1);
+                }
+            }
+            if(orderType==2){
+                OrderTaxi orderTaxi = orderTaxiService.selectById(orderId);
+                orderTaxi.setVoice(fileUrl);
+                orderTaxi.setVoiceTime(new Date());
+                orderTaxiService.updateById(orderTaxi);
+            }
+            if(orderType==3){
+                OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId);
+                orderCrossCity.setVoice(fileUrl);
+                orderCrossCity.setVoiceTime(new Date());
+                orderCrossCityService.updateById(orderCrossCity);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultUtil.runErr();
+        }
+        return ResultUtil.success();
+    }
+
+
+
+
 
     /**
      * 司机确认费用(车载端)
@@ -751,10 +837,11 @@
             @ApiImplicitParam(value = "改派支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = false, dataType = "int"),
             @ApiImplicitParam(value = "改派原因", name = "reason", required = true, dataType = "string"),
             @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"),
+            @ApiImplicitParam(value = "司机id", name = "driverId", required = false, dataType = "int"),
     })
-    public String reassign_(Reassign reassign, Integer uid){
+    public String reassign_(Reassign reassign, Integer uid, Integer driverId){
         try {
-            ResultUtil resultUtil = reassignService.saveData(reassign, uid, 3);
+            ResultUtil resultUtil = reassignService.saveData(reassign, uid, 3, driverId);
             return JSON.toJSONString(resultUtil);
         }catch (SystemException s){
             return JSON.toJSONString(ResultUtil.error(s.getMsg()));
@@ -1043,4 +1130,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