From 0e079a1e51fc3f30d73bf9c4e5fce5f3f0d6d33f Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 05 二月 2025 11:22:41 +0800
Subject: [PATCH] 补充

---
 ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java |   44 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java b/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java
index 257d891..3c504af 100644
--- a/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java
+++ b/ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java
@@ -14,6 +14,7 @@
 import com.stylefeng.guns.modular.system.util.*;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.ui.Model;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +42,8 @@
 
     @Autowired
     private ITOrderTaxiService tOrderTaxiService;
+    @Autowired
+    private ITPubTransactionDetailsService pubTransactionDetailsService;
 
     @Autowired
     private ITOrderPositionService tOrderPositionService;
@@ -103,6 +106,34 @@
     public String tOrderTaxiUpdate(@PathVariable Integer tOrderTaxiId, Model model) {
         Map<String, Object> tOrderTaxi = tOrderTaxiService.getTaxiOrderDetailById(tOrderTaxiId);
         model.addAttribute("item",tOrderTaxi);
+        // 查询司机扣款
+        List<TPubTransactionDetails> tPubTransactionDetails = pubTransactionDetailsService.selectList(new EntityWrapper<TPubTransactionDetails>()
+                .eq("userId", tOrderTaxi.get("driverId"))
+                .eq("orderId", tOrderTaxi.get("id"))
+                .eq("type", 1)
+                .eq("userType", 2));
+        if(CollectionUtils.isEmpty(tPubTransactionDetails)){
+            model.addAttribute("companyMoney","");
+            model.addAttribute("driverMoney","");
+        }else {
+            TPubTransactionDetails pubTransactionDetailCompany = tPubTransactionDetails.stream().filter(e -> e.getOrderType().equals(6)).findFirst().orElse(null);
+            if(Objects.nonNull(pubTransactionDetailCompany)){
+                model.addAttribute("companyMoney",pubTransactionDetailCompany.getMoney());
+            }else {
+                model.addAttribute("companyMoney","");
+            }
+            TPubTransactionDetails pubTransactionDetailDriver = tPubTransactionDetails.stream().filter(e -> e.getOrderType().equals(2)).findFirst().orElse(null);
+            if(Objects.nonNull(pubTransactionDetailCompany)){
+                model.addAttribute("driverMoney",pubTransactionDetailDriver.getMoney());
+            }else {
+                model.addAttribute("driverMoney","");
+            }
+        }
+        if(tOrderTaxi.get("payManner").equals("1")){
+            model.addAttribute("payMannerStr","线上收款");
+        }else {
+            model.addAttribute("payMannerStr","计费打表");
+        }
         LogObjectHolder.me().set(tOrderTaxi);
         return PREFIX + "tOrderTaxi_edit.html";
     }
@@ -354,12 +385,12 @@
             tOrderTaxi.setUserId(tUser.getId());
             tOrderTaxi.setOrderNum(this.getOrderNum());
             tOrderTaxi.setPlacementAddress(tOrderTaxi.getStartAddress());
-            tOrderTaxi.setPlacementLon(Double.valueOf(s.get(0).split(",")[0]));
-            tOrderTaxi.setPlacementLat(Double.valueOf(s.get(0).split(",")[1]));
-            tOrderTaxi.setStartLon(Double.valueOf(s.get(0).split(",")[0]));
-            tOrderTaxi.setStartLat(Double.valueOf(s.get(0).split(",")[1]));
-            tOrderTaxi.setEndLon(Double.valueOf(e.get(0).split(",")[0]));
-            tOrderTaxi.setEndLat(Double.valueOf(e.get(0).split(",")[1]));
+            tOrderTaxi.setPlacementLon(Double.valueOf(s.get(0).split(",")[1]));
+            tOrderTaxi.setPlacementLat(Double.valueOf(s.get(0).split(",")[0]));
+            tOrderTaxi.setStartLon(Double.valueOf(s.get(0).split(",")[1]));
+            tOrderTaxi.setStartLat(Double.valueOf(s.get(0).split(",")[0]));
+            tOrderTaxi.setEndLon(Double.valueOf(e.get(0).split(",")[1]));
+            tOrderTaxi.setEndLat(Double.valueOf(e.get(0).split(",")[0]));
             tOrderTaxi.setMileage(0D);
             tOrderTaxi.setOrderMoney(new BigDecimal(0));
             tOrderTaxi.setTravelMoney(new BigDecimal(0));
@@ -373,6 +404,7 @@
             tOrderTaxi.setSubstitute(0);
             tOrderTaxi.setOrderSource(5);
             tOrderTaxi.setIsDelete(1);
+            tOrderTaxi.setPayManner(3);
             tOrderTaxiService.insert(tOrderTaxi);
             if(tOrderTaxi.getState() == 1){
                 //推送司机抢单

--
Gitblit v1.7.1