From e1940dda45fa066d994cc5cf0e34c7f97d9e7b2d Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期三, 02 四月 2025 09:42:45 +0800
Subject: [PATCH] 修改bug

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
index 8efb8a6..49509bf 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -670,8 +670,7 @@
         if(ToolUtil.isEmpty(userInfo.getPhone())){
             return ResultUtil.error(language == 1 ? "请先绑定手机号码" : language == 2 ? "Please bind your mobile phone number first." : "Veuillez d’abord vous inscrire en liant votre numéro de téléphone portable.");
         }
-        String[] split1 = placementLon.split(",");
-        Company company = companyCityService.query1(uid, split1[0], split1[1]);
+        Company company = companyCityService.query1(uid, placementLon, placementLat);
         if(null != userInfo && null != company){
             userInfo.setCompanyId(company.getId());
             userInfoService.updateById(userInfo);
@@ -3223,16 +3222,16 @@
         if(orderLogistics.getState() > 5 && orderLogistics.getState() != 11 && orderLogistics.getState() != 12){
             return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale.");
         }
-    
+        orderCancelService.delete(new EntityWrapper<OrderCancel>().eq("orderId", orderLogistics.getId()).eq("orderType", 4));
         if(null == orderLogistics.getDriverId()){//没有接单的情况
-            integer = orderCancelService.saveData(id, 4, language == 1 ? "无司机接单" : language == 2 ? "No driver to take orders" : "Pas de chauffeur pour prendre les commandes", language == 1 ? "无司机接单" : language == 2 ? "No driver to take orders" : "Pas de chauffeur pour prendre les commandes", null, null, 2, 1, uid);
+            integer = orderCancelService.saveData(id, 4, language == 1 ? "无司机接单" : language == 2 ? "No driver to take orders" : "Pas de chauffeur pour prendre les commandes", language == 1 ? "无司机接单" : language == 2 ? "No driver to take orders" : "Pas de chauffeur pour prendre les commandes", null, 0D, 2, 1, uid);
             orderLogistics.setState(10);
             this.updateById(orderLogistics);
         }else {
             BaseWarpper data = queryCancleAmount(id, language).getData();
             Double amount = data.getAmount();
             if(0 == amount){
-                integer = orderCancelService.saveData(id, 4, reason, remark, null, null, 2, 1, uid);
+                integer = orderCancelService.saveData(id, 4, reason, remark, null, 0D, 2, 1, uid);
                 if(5 == orderLogistics.getState()){
                     orderLogistics.setState(6);
                     orderLogistics.setGetoffLon(lon);
@@ -3499,7 +3498,10 @@
         BaseWarpper baseWarpper = new BaseWarpper();
         double amount = 0;
         CancleOrder query = cancleOrderService.query(orderLogistics.getCompanyId());
-        if(null == query || null == orderLogistics.getDriverId() || orderLogistics.getState() == 11){
+        if(null == query){
+            return ResultUtil.error("请先添加取消规则");
+        }
+        if(null == orderLogistics.getDriverId() || orderLogistics.getState() == 11){
             baseWarpper.setAmount(amount);
             return ResultUtil.success(baseWarpper);
         }

--
Gitblit v1.7.1