From 6a90f2d1feaf583c211d5f9fe95dff7f7c748ed3 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 06 九月 2024 17:42:20 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0

---
 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ReassignServiceImpl.java |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ReassignServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ReassignServiceImpl.java
index acc5b13..afe78cc 100644
--- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ReassignServiceImpl.java
+++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ReassignServiceImpl.java
@@ -159,7 +159,7 @@
         reassign.setInsertTime(new Date());
         reassign.setState(2);
         this.insert(reassign);
-
+        String tripId = "";
         //修改改派通知状态
         switch (reassign.getOrderType()){
             case 1:
@@ -168,6 +168,7 @@
                 orderPrivateCar.setState(11);
                 orderPrivateCar.setReassignNotice(2);
                 orderPrivateCarService.updateById(orderPrivateCar);
+                tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId());
                 break;
             case 2:
                 OrderTaxi orderTaxi = orderTaxiService.selectById(reassign.getOrderId());
@@ -175,6 +176,7 @@
                 orderTaxi.setState(11);
                 orderTaxi.setReassignNotice(2);
                 orderTaxiService.updateById(orderTaxi);
+                tripId = redisUtil.getValue("trip" + orderTaxi.getUserId());
                 break;
             case 4:
                 OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId());
@@ -182,6 +184,7 @@
                 orderLogistics.setState(11);
                 orderLogistics.setReassignNotice(2);
                 orderLogisticsService.updateById(orderLogistics);
+                tripId = redisUtil.getValue("trip" + orderLogistics.getUserId());
                 break;
             case 5:
                 OrderLogistics orderLogistics1 = orderLogisticsService.selectById(reassign.getOrderId());
@@ -189,20 +192,22 @@
                 orderLogistics1.setState(11);
                 orderLogistics1.setReassignNotice(2);
                 orderLogisticsService.updateById(orderLogistics1);
+                tripId = redisUtil.getValue("trip" + orderLogistics1.getUserId());
                 break;
         }
         systemNoticeService.addSystemNotice(2, language == 1 ? "您的改派申请已成功提交,我们会尽快为你处理!" : language == 2 ?
                 "Your request for reassignment was submitted, we shall handle it for you as soon as possible." :
                 "Votre demande de réaffectation a été soumise. Nous la traiterons pour vous dans les plus brefs délais.", uid);
-
+    
+        
         //开始自动完成改派
         switch (reassign.getOrderType()){
             case 1:
                 OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(reassign.getOrderId());
-                Company company = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司
+                Company company = companyCityService.query1(orderPrivateCar.getUserId(), String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司
                 PushOrder pushOrder = pushOrderService.querys(1, 1, company.getId()).get(0);
                 //获取空闲司机
-                List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
+                List<Driver> list = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
                 System.err.println("【" + orderPrivateCar.getId() + "】空闲司机:" + JSON.toJSONString(list));
                 if(list.size() > 0){
                     String text = "";
@@ -240,7 +245,7 @@
                         public void run() {
                             Process process = null;
                             try {
-                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
+                                process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
                             } catch (IOException e) {
                                 throw new RuntimeException(e);
                             }
@@ -265,7 +270,7 @@
                         String value = redisUtil.getValue("DRIVER" + driver1.getId());
                         if(ToolUtil.isNotEmpty(value)) {
                             String[] split = value.split(",");
-                            DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]));
+                            DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId);
                             //超时时间
                             long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000);
                             orderPrivateCar.setEstimateArriveTime(new Date(timeOut));
@@ -451,10 +456,10 @@
                 break;
             case 4:
                 OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId());
-                Company company1 = companyCityService.query1(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司
+                Company company1 = companyCityService.query1(orderLogistics.getUserId(), String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司
                 PushOrder pushOrder1 = pushOrderService.querys(1, 1, company1.getId()).get(0);
                 //获取空闲司机
-                List<Driver> list1 = driverService.queryIdleDriver(orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder1.getPushDistance(), null);//所有附近空闲司机
+                List<Driver> list1 = driverService.queryIdleDriver(orderLogistics.getUserId(), orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder1.getPushDistance(), null);//所有附近空闲司机
                 System.err.println("【" + orderLogistics.getId() + "】空闲司机:" + JSON.toJSONString(list1));
                 if(list1.size() > 0){
                     Driver driver1 = list1.get(0);
@@ -491,7 +496,7 @@
                         public void run() {
                             Process process = null;
                             try {
-                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
+                                process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
                             } catch (IOException e) {
                                 throw new RuntimeException(e);
                             }
@@ -515,7 +520,7 @@
                     String value = redisUtil.getValue("DRIVER" + driver1.getId());
                     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));

--
Gitblit v1.7.1