xuhy
2025-09-11 5edd84c3d79263a32afdd9564ad0373fc253389f
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -380,10 +380,10 @@
     */
    @ResponseBody
    @PostMapping("/api/taxi/pushOrderTaxi")
    @ApiOperation(value = "继续等待推单操作", tags = {"用户端-出租车", "用户端-专车"}, notes = "")
    @ApiOperation(value = "继续等待推单操作", tags = {"用户端-出租车", "用户端-专车","用户端-跨城"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3-跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil pushOrderTaxi(Integer id, Integer orderType){
@@ -393,6 +393,8 @@
                    return orderPrivateCarService.pushOrderPrivateCar(id);
                case 2:
                    return orderTaxiService.pushOrderTaxi(id);
//                case 3:
//                    return orderCrossCityService.pushOrderCrossCity(id);
            }
            return ResultUtil.success();
        }catch (Exception e){
@@ -988,9 +990,11 @@
                    list = orderTaxiService.queryCoupon(orderId, uid, pageNum, size);
                    break;
                case 3:
                    System.err.println("跨城");
                    list = orderCrossCityService.queryCoupon(orderId, uid, pageNum, size);
                    break;
            }
            System.err.println("跨城"+CouponWarpper.getCouponWarppers(list));
            return ResultUtil.success(CouponWarpper.getCouponWarppers(list));
        }catch (Exception e){
            e.printStackTrace();
@@ -1257,7 +1261,7 @@
    @PostMapping("/base/wxPayOrderTaxi")
    public void wxPayOrderTaxi(HttpServletRequest request, HttpServletResponse response){
        try {
            System.out.println("完成订单微信支付回调");
            System.err.println("完成订单微信支付回调");
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            System.out.println("wx支付信息:"+map);
@@ -1281,11 +1285,13 @@
                        case 1:
                            break;
                        case 2:
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 2);
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 1);
                            break;
                        case 3:
                            orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1);
                            break;
                        case 4:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1);
                            break;
                        case 5:
                            break;
@@ -1354,16 +1360,14 @@
    @PostMapping("/base/wxPayOrderLogisticsSpread")
    public void wxPayOrderLogisticsSpread(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = icbcPayUtil.payCallback(request);
            System.err.println("完成订单微信支付回调");
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            System.out.println("wx支付信息:"+map);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("order_id");
                String s = icbcPayUtil.queryTransaction("", order_id);
                if(s.equals("0")){
                    icbcPayUtil.answer(response);//回调应答
                }
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){
                    String[] split = out_trade_no.split(",");
                if(ToolUtil.isNotEmpty(out_trade_no) ){
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                    orderLogisticsService.payOrderLogisticsSpreadCallback(id, order_id, 1);
@@ -1414,22 +1418,34 @@
                                           HttpServletRequest request, HttpServletResponse response){
        try {
            String url = "https://api.map.baidu.com/directionlite/v1/driving?origin="
                    +startLat+","+startLon+"&destination="+nextLatitude+","+nextLongitude+"&ak=WQhfsluNzEeUHUxoH4jc4JiCQOXw4Mnx&ret_coordtype=bd09ll&coord_type=bd09ll";
                    +startLat+","+startLon+"&destination="+nextLatitude+","+nextLongitude+"&ak=WQhfsluNzEeUHUxoH4jc4JiCQOXw4Mnx&ret_coordtype=gcj02";
            String get = HttpUtil.get(url);
            JSONObject jsonObject = JSON.parseObject(get);
            JSONArray jsonArray = jsonObject.getJSONObject("result").getJSONArray("routes").getJSONObject(0).getJSONArray("steps");
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject1 = jsonArray.getJSONObject(i);
                JSONObject start_location = jsonObject1.getJSONObject("start_location");
                double[] doubles = GpsCoordinateUtils.calBD09toGCJ02(start_location.getDouble("lat"), start_location.getDouble("lng"));
                start_location.put("lat", doubles[0]);
                start_location.put("lng", doubles[1]);
                JSONObject end_location = jsonObject1.getJSONObject("end_location");
                double[] doubles1 = GpsCoordinateUtils.calBD09toGCJ02(end_location.getDouble("lat"), end_location.getDouble("lng"));
                end_location.put("lat", doubles1[0]);
                end_location.put("lng", doubles1[1]);
            }
//            for (int i = 0; i < jsonArray.size(); i++) {
//                JSONObject jsonObject1 = jsonArray.getJSONObject(i);
//                JSONObject start_location = jsonObject1.getJSONObject("start_location");
//                double[] doubles = GpsCoordinateUtils.calBD09toGCJ02(start_location.getDouble("lat"), start_location.getDouble("lng"));
//                start_location.put("lat", doubles[0]);
//                start_location.put("lng", doubles[1]);
//                JSONObject end_location = jsonObject1.getJSONObject("end_location");
//                double[] doubles1 = GpsCoordinateUtils.calBD09toGCJ02(end_location.getDouble("lat"), end_location.getDouble("lng"));
//                end_location.put("lat", doubles1[0]);
//                end_location.put("lng", doubles1[1]);
//            }
//            for (int i = 0; i < jsonArray.size(); i++) {
//                JSONObject jsonObject1 = jsonArray.getJSONObject(i);
//                String path = jsonObject1.getString("path");
//                String[] split = path.split(";");
//                StringBuilder temp = new StringBuilder();
//                for (String s : split) {
//                    String[] split1 = s.split(",");
//                    double[] doubles = GpsCoordinateUtils.calBD09toGCJ02(Double.valueOf(split1[0]), Double.valueOf(split1[1]));
//                    temp.append(doubles[0]).append(",").append(doubles[1]).append(";");
//                }
//                jsonObject1.put("path", temp.toString());
//            }
            System.out.println(jsonArray);
            return ResultUtil.success(jsonArray);
        }catch (Exception e){