From d959a545c69237d376f3bdef7f11d10013353c7a Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 19 三月 2025 15:55:05 +0800
Subject: [PATCH] bug修改 订单数据查询优化 数据上传行政区划代码更换为订单所属行政区划代码

---
 DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java |   45 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java
index 83a7e61..6c9d2db 100644
--- a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java
+++ b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java
@@ -103,12 +103,17 @@
      * 订单发起接口
      * @param orderId
      */
-    public void orderCreate(Integer orderId) throws Exception {
+    public void orderCreate(Integer orderId)  {
         OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
         Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
         JSONObject jsonObject = new JSONObject();
         if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
-            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            Map<String, String> geocode = null;
+            try {
+                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
             if (geocode!=null){
                 System.err.println("数据上传--经纬度转行政区划代码");
                 jsonObject.put("Address", geocode.get("provinceCode"));//发起第行政区划代码
@@ -153,14 +158,19 @@
      * 订单成功接口
      * @param orderId
      */
-    public void orderMatch(Integer orderId) throws Exception {
+    public void orderMatch(Integer orderId)  {
         OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
         Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
         Car car = carService.selectById(orderPrivateCar.getCarId());
         String value = redisUtil.getValue("DRIVER" + orderPrivateCar.getDriverId());
         JSONObject jsonObject = new JSONObject();
         if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
-            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            Map<String, String> geocode = null;
+            try {
+                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
             if (geocode!=null){
                 System.err.println("数据上传--经纬度转行政区划代码");
                 jsonObject.put("Address", geocode.get("provinceCode"));//发起第行政区划代码
@@ -375,7 +385,7 @@
      * 经营支付接口
      * @param orderId
      */
-    public void operatePay(Integer orderId) throws Exception {
+    public void operatePay(Integer orderId)  {
         OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
         Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
         Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
@@ -385,7 +395,12 @@
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单号
         if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
-            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            Map<String, String> geocode = null;
+            try {
+                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
             if (geocode!=null){
                 System.err.println("数据上传--经纬度转行政区划代码");
                 jsonObject.put("OnArea", geocode.get("provinceCode"));//发起第行政区划代码
@@ -481,7 +496,7 @@
      * 驾驶员定位信息
      * @param orderId
      */
-    public void positionDriver(Integer orderId) throws Exception {
+    public void positionDriver(Integer orderId) {
         OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
         Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
         Car car = carService.selectById(orderPrivateCar.getCarId());
@@ -524,7 +539,12 @@
         }
         jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证号
         if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
-            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            Map<String, String> geocode = null;
+            try {
+                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
             if (geocode!=null){
                 System.err.println("数据上传--经纬度转行政区划代码");
                 jsonObject.put("DriverRegionCode", geocode.get("provinceCode"));//发起第行政区划代码
@@ -567,7 +587,7 @@
      * 车辆定位信息
      * @param orderId
      */
-    public void positionVehicle(Integer orderId) throws Exception {
+    public void positionVehicle(Integer orderId) {
         OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
         Car car = carService.selectById(orderPrivateCar.getCarId());
         List<OrderPosition> orderPositions = null;
@@ -603,7 +623,12 @@
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌
         if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
-            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            Map<String, String> geocode = null;
+            try {
+                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
             if (geocode!=null){
                 System.err.println("数据上传--经纬度转行政区划代码");
                 jsonObject.put("VehicleRegionCode", geocode.get("provinceCode"));//发起第行政区划代码

--
Gitblit v1.7.1