From ebeb3e4f16972caa50f9b78cb334b0beba1acf2d Mon Sep 17 00:00:00 2001
From: zhibing.pu <393733352@qq.com>
Date: 星期二, 27 八月 2024 17:16:48 +0800
Subject: [PATCH] 修改bug

---
 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
index 483d27d..254ba65 100644
--- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
+++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -18,6 +18,7 @@
 import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo;
 import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil;
 import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil;
+import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo;
 import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils;
 import com.stylefeng.guns.modular.system.util.quartz.QuartzUtil;
 import com.stylefeng.guns.modular.system.util.quartz.jobs.OrderTimeOutJob;
@@ -192,9 +193,10 @@
             orderLogistics.setTripId(UUIDUtil.getRandomCode());
         }
         String value = redisUtil.getValue("DRIVER" + driver.getId());
+        String tripId = redisUtil.getValue("trip" + orderLogistics.getUserId());
         if(ToolUtil.isNotEmpty(value)) {
             String[] split = value.split(",");
-            DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]));
+            DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId);
             //超时时间
             long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000);
             orderLogistics.setEstimateArriveTime(new Date(timeOut));
@@ -346,13 +348,18 @@
      * @param state
      * @param lon
      * @param lat
-     * @param address
      * @return
      * @throws Exception
      */
     @Override
-    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language, Integer uid) throws Exception {
+    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String pickUpCode, Integer language, Integer uid) throws Exception {
         OrderLogistics orderLogistics = this.selectById(orderId);
+        String tripId = redisUtil.getValue("trip" + orderLogistics.getUserId());
+        ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon, tripId);
+        if(null == reverseGeocode){
+            return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides");
+        }
+        String address = reverseGeocode.getAddress();
         if(!uid.equals(orderLogistics.getDriverId())){
             return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
         }
@@ -652,7 +659,7 @@
                 Element email2_user = document.getElementById("email2_user");
                 email2_user.text("Bonjour " + userInfo.getFirstName() + " " + userInfo.getLastName());
                 Element email2_content = document.getElementById("email2_content");
-                email2_content.text("Le code de ramassage de votre colis est " + random + ", veuillez effectuer la verification dans les 5minutes.");
+                email2_content.text("Le code de ramassage de votre colis est " + random + ", veuillez effectuer la verification dans les 5 minutes.");
             }
             EmailUtil.send(userInfo.getEmail(), language == 1 ? "取件码邮件" : language == 2 ? "Pickup code" : "Code de ramassage",  document.html());
             //开始生成pdf收据和html收据
@@ -773,6 +780,7 @@
         map.put("discountMoney", orderLogistics.getDiscountMoney());//折扣抵扣金额
         map.put("discount", orderLogistics.getDiscount());//折扣
         map.put("priceDifference", orderLogistics.getPriceDifference());//补差价
+        map.put("isDispute", orderLogistics.getIsDispute());
         return map;
     }
     

--
Gitblit v1.7.1