From 818937959bb19d3669585fa87a526bffe9ce77a4 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 24 四月 2025 09:28:41 +0800 Subject: [PATCH] 修改默认验证码 --- UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java | 84 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 72 insertions(+), 12 deletions(-) diff --git a/UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java index e6bb96d..85f6856 100644 --- a/UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java +++ b/UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java @@ -1,6 +1,12 @@ package com.stylefeng.guns.modular.api; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.stylefeng.guns.core.util.GpsCoordinateUtils; +import com.stylefeng.guns.core.util.HttpUtil; +import com.stylefeng.guns.core.util.HttpUtils; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService; import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; @@ -22,12 +28,14 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.apache.http.HttpResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.*; @@ -90,6 +98,8 @@ @Autowired private IOrderCancelService orderCancelService; + @Autowired + private PayMoneyUtil payMoneyUtil; @Value("${pushMinistryOfTransport}") private boolean pushMinistryOfTransport; @@ -1247,33 +1257,37 @@ @PostMapping("/base/wxPayOrderTaxi") public void wxPayOrderTaxi(HttpServletRequest request, HttpServletResponse response){ try { - Map<String, String> map = icbcPayUtil.payCallback(request); + System.out.println("完成订单微信支付回调"); + Map<String, String> map = payMoneyUtil.weixinpayCallback(request); + System.out.println("wx支付信息:"+map); + + if(null != map){ + String order_id = map.get("transaction_id"); 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(","); + String result = map.get("result"); + String total_fee = map.get("total_fee"); + String transaction_id = map.get("transaction_id"); + + if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){ + PrintWriter out = response.getWriter(); + out.write(result); + out.flush(); + out.close(); + String[] split = out_trade_no.split("_"); Integer id = Integer.valueOf(split[0]); Integer type = Integer.valueOf(split[1]); switch (type){ case 1: - orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 1); break; case 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: - orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1); break; } } @@ -1389,6 +1403,52 @@ e.printStackTrace(); } } + /** + * 路线规划 + * @param request + */ + @ResponseBody + @PostMapping("/base/loadLine") + public ResultUtil aliPayOrderLogisticsSpread(String startLat, String startLon, + String nextLatitude, String nextLongitude, + 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=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); +// 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){ + e.printStackTrace(); + return ResultUtil.runErr(); + } + } -- Gitblit v1.7.1