From 26079aa3c34f47e952a9538a93d6f8a3bab9a0fc Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 23 八月 2024 09:12:44 +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/smallLogistics/server/impl/OrderLogisticsServiceImpl.java |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 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 683f1fa..ad00677 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
@@ -284,12 +284,12 @@
                 pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
             }
         }).start();
-
+        Integer language1 = userInfoMapper.selectById(orderLogistics.getUserId()).getLanguage();
         systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得包裹订单,请及时联系客户!" :
                 language == 2 ? "You have grabbed the delivery order, please contact the client timely."
                         : "Vous avez saisi la commande du livraison. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId());
-        systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" :
-                language == 2 ? "Your order has been assigned to the driver- " + driver.getFirstName() + ", please keep your line on."
+        systemNoticeService.addSystemNotice(1, language1 == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" :
+                language1 == 2 ? "Your order has been assigned to the driver- " + driver.getFirstName() + ", please keep your line on."
                         : "Votre commande a été attribuée au chauffeur- " + driver.getFirstName() + ", S'il vous plaît, restez en ligne.", orderLogistics.getUserId());
         return ResultUtil.success();
     }
@@ -326,6 +326,7 @@
             long timeOutCancel = orderLogistics.getEstimateArriveTime().getTime() + driverTimeout;
             map.put("timeOutCancel", timeOutCancel);
         }
+        map.put("isDispute", orderLogistics.getIsDispute());
         return map;
     }
 
@@ -350,8 +351,11 @@
      * @throws Exception
      */
     @Override
-    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language) throws Exception {
+    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language, Integer uid) throws Exception {
         OrderLogistics orderLogistics = this.selectById(orderId);
+        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");
+        }
         if(orderLogistics.getState().compareTo(state) == 0){
             return ResultUtil.error(language == 1 ? "不能重复操作" : language == 2 ? "Unable to recur operate" : "Impossible de récurrence des opérer");
         }
@@ -363,21 +367,21 @@
         }
 
         List<OrderLogisticsSpread> orderLogisticsId = spreadService.selectList(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderLogistics.getId()).eq("payType",4));
-    
+        Integer language1 = userInfoMapper.selectById(orderLogistics.getUserId()).getLanguage();
     
         String tripStatus = "UNKNOWN_TRIP_STATUS";
         switch (state){
             case 3://出发前往预约点
                 orderLogistics.setState(3);
                 orderLogistics.setSetOutTime(new Date());
-                systemNoticeService.addSystemNotice(1, language == 1 ? "司机已出发,请耐心等待" : language == 2 ? "The driver is on the way, please wait." : "Le chauffeur est en route. Veuillez patienter.", orderLogistics.getUserId());
+                systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已出发,请耐心等待" : language1 == 2 ? "The driver is on the way, please wait." : "Le chauffeur est en route. Veuillez patienter.", orderLogistics.getUserId());
                 pushUtil.pushDriverPosition(orderId, 4);
                 tripStatus = "ENROUTE_TO_PICKUP";
                 break;
             case 4://到达预约点,等待客户上车
                 orderLogistics.setState(4);
                 orderLogistics.setArriveTime(new Date());
-                systemNoticeService.addSystemNotice(1, language == 1 ? "司机已到达您设置的预约地点。" : language == 2 ? "The driver has arrived at the reserved location." : "Le chauffeur est arrivé à l'endroit prévu.", orderLogistics.getUserId());
+                systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已到达您设置的预约地点。" : language1 == 2 ? "The driver has arrived at the reserved location." : "Le chauffeur est arrivé à l'endroit prévu.", orderLogistics.getUserId());
                 tripStatus = "ARRIVED_AT_PICKUP";
                 break;
             case 5://开始服务
@@ -557,12 +561,12 @@
                 pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
             }
         }).start();
-
+        Integer language1 = userInfoMapper.selectById(orderLogistics.getUserId()).getLanguage();
         systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得包裹订单,请及时联系客户!" :
                 language == 2 ? "You have grabbed the delivery order, please contact the client timely."
                         : "Vous avez saisi la commande du livraison. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId());
-        systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" :
-                language == 2 ? "Your order has been assigned to the driver- " + driver.getFirstName() + ", please keep your line on."
+        systemNoticeService.addSystemNotice(1, language1 == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" :
+                language1 == 2 ? "Your order has been assigned to the driver- " + driver.getFirstName() + ", please keep your line on."
                         : "Votre commande a été attribuée au chauffeur- " + driver.getFirstName() + ", S'il vous plaît, restez en ligne.", orderLogistics.getUserId());
 
         return ResultUtil.success();
@@ -648,7 +652,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收据
@@ -747,6 +751,7 @@
         OrderLogistics orderLogistics = this.selectById(orderId);
         if(orderLogistics.getState() == 6){//服务中的时候获取实时费用数据
             this.setMoney(orderLogistics, 0D, 0D);
+            orderLogistics.setOrderMoney(orderLogistics.getOrderMoney() + orderLogistics.getPriceDifference());
         }
     
         Map<String, Object> map = new HashMap<>();
@@ -768,6 +773,7 @@
         map.put("discountMoney", orderLogistics.getDiscountMoney());//折扣抵扣金额
         map.put("discount", orderLogistics.getDiscount());//折扣
         map.put("priceDifference", orderLogistics.getPriceDifference());//补差价
+        map.put("isDispute", orderLogistics.getIsDispute());
         return map;
     }
     
@@ -993,10 +999,13 @@
      * @throws Exception
      */
     @Override
-    public ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee) throws Exception {
+    public ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee, Integer uid) throws Exception {
         OrderLogistics orderLogistics = this.selectById(orderId);
+        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");
+        }
         if(6 != orderLogistics.getState()){
-            return ResultUtil.error("操作异常,请刷新订单");
+            return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
         }
         if(orderLogistics.getArriveTime()==null){
             orderLogistics.setArriveTime(orderLogistics.getStartServiceTime());
@@ -1060,7 +1069,9 @@
         
         
         pushUtil.removeTask(orderId, 4);//删除定时任务,结束推送数据
-        systemNoticeService.addSystemNotice(1, language == 1 ? "司机已结束本次行程,谢谢使用" : language == 2 ?
+        UserInfo userInfo = userInfoMapper.selectById(orderLogistics.getUserId());
+        Integer language1 = userInfo.getLanguage();
+        systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已结束本次行程,谢谢使用" : language1 == 2 ?
                 "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderLogistics.getUserId());
         
         //回滚司机状态为空闲

--
Gitblit v1.7.1