From e809f5955584e600d8612540ea814977c49774c2 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期三, 27 八月 2025 23:51:54 +0800
Subject: [PATCH] 修改bug

---
 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java
index 2337210..4ba0d90 100644
--- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java
+++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java
@@ -22,6 +22,8 @@
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 /**
  * 首页统计
@@ -77,7 +79,9 @@
     
     @Autowired
     private ShiroExtUtil shiroExtUtil;
-    
+    @Autowired
+    private ITOrderPrivateCarService iTOrderPrivateCarService;
+
     @RequestMapping("/openNetCarInfo")
     public Object openNetCarInfo(Integer id, Model model) {
         model.addAttribute("id", id);
@@ -139,14 +143,22 @@
         }
         int i = tUserService.selectCount(ne);
         map1.put("passengerInfo", i);  //新增用户
-        
-        Wrapper<TDriver> ne1 = new EntityWrapper<TDriver>().ne("state", 1).eq("authState", 2).ne("flag", 3);
+        redisTemplate.opsForValue().set("dache:DRIVER14", "123456", 30, TimeUnit.SECONDS);
+
+        Wrapper<TDriver> warpper = new EntityWrapper<TDriver>().eq("authState", 2).eq("state", 2).ne("flag", 3);
         if (companyId != null) {
-            ne1.eq("companyId", companyId).or().eq("franchiseeId", companyId);
+            warpper.eq("companyId", companyId);
         }
-        int count = tDriverService.selectCount(new EntityWrapper<TDriver>().ne("state", 1).eq("authState", 2).ne("flag", 3));
+        List<TDriver> tDrivers = tDriverService.selectList(warpper);
+        int count = 0;
+        for (TDriver tDriver : tDrivers) {
+            Boolean hasKey = redisTemplate.hasKey("dache:DRIVER" + tDriver.getId());
+            if(hasKey){
+                count++ ;
+            }
+        }
         map1.put("netcardriver", count);  //在线司机
-        
+
         Wrapper<TOrderTaxi> travelTime1 = new EntityWrapper<TOrderTaxi>().between("insertTime", calendar1.getTime(), calendar2.getTime());
         if (companyId != null) {
             travelTime1.eq("companyId", companyId);
@@ -411,12 +423,31 @@
         }
         map.put("driver", list);
 
+
+
         Map<String, Object> map2 = new HashMap<>();
-        Wrapper<TOrderTaxi> eq = new EntityWrapper<TOrderTaxi>().eq("state", 1).eq("isDelete", 1);
+        Wrapper<TOrderPrivateCar> eq = new EntityWrapper<TOrderPrivateCar>().eq("state", 1).eq("isDelete", 1);
         if(companyId != null){
             eq.eq("companyId", companyId);
         }
-        List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(eq);
+        List<TOrderPrivateCar> tOrderPrivateCars = iTOrderPrivateCarService.selectList(eq);
+        list = new ArrayList<>();
+        for(TOrderPrivateCar t : tOrderPrivateCars){
+            Map<String, Object> map1 = new HashMap<>();
+            map1.put("start", t.getStartAddress());
+            map1.put("end", t.getEndAddress());
+            map1.put("travelTime", t.getTravelTime());
+            map1.put("carModel", "");
+            map1.put("num", 1);
+            list.add(map1);
+        }
+        map2.put("zhuanche", list);
+
+        Wrapper<TOrderTaxi> eq1 = new EntityWrapper<TOrderTaxi>().eq("state", 1).eq("isDelete", 1);
+        if(companyId != null){
+            eq1.eq("companyId", companyId);
+        }
+        List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(eq1);
         list = new ArrayList<>();
         for(TOrderTaxi t : tOrderTaxis){
             Map<String, Object> map1 = new HashMap<>();
@@ -437,8 +468,18 @@
     @ResponseBody
     @PostMapping("/getAllOrder")
     public Object getAllOrder(){
-        List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(new EntityWrapper<TOrderTaxi>().eq("isDelete", 1));
+        List<TOrderPrivateCar> orderPrivateCars = itOrderPrivateCarService.selectList(new EntityWrapper<TOrderPrivateCar>().eq("isDelete", 1).in("state", Arrays.asList(8, 9)));
         List list = new ArrayList<>();
+        for(TOrderPrivateCar t : orderPrivateCars){
+            Map<String, Object> map = new HashMap<>();
+            if(Objects.isNull(t.getStartLon()) || Objects.isNull(t.getStartLat())){
+                continue;
+            }
+            map.put("lon", t.getStartLon());
+            map.put("lat", t.getStartLat());
+            list.add(map);
+        }
+        List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(new EntityWrapper<TOrderTaxi>().eq("isDelete", 1).in("state", Arrays.asList(8, 9)));
         for(TOrderTaxi t : tOrderTaxis){
             Map<String, Object> map = new HashMap<>();
             if(Objects.isNull(t.getStartLon()) || Objects.isNull(t.getStartLat())){

--
Gitblit v1.7.1