From 5e60f8ce81fa0335d2965b1373c6d189b9c87744 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 14 十一月 2024 17:44:43 +0800
Subject: [PATCH] 2.0bug修改

---
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java |   76 ++++++++++++++++++--------------------
 1 files changed, 36 insertions(+), 40 deletions(-)

diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java
index af20a78..8730343 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/PlatformController.java
@@ -200,12 +200,16 @@
         settlementDetails = settlementDetailService.selectList(settlementDetailEntityWrapper);
         List<PlatformVO> res = new ArrayList<>();
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Map<Integer, TDriver> driverMap = driverService.selectList(new EntityWrapper<TDriver>())
-                .stream()
-                .collect(Collectors.toMap(TDriver::getId, user -> user));
+
         Map<Integer, SettlementRecord> settlementRecordMap = settlementRecordService.selectList(new EntityWrapper<SettlementRecord>())
                 .stream()
                 .collect(Collectors.toMap(SettlementRecord::getId, user -> user));
+        Map<Integer, TOrderPrivateCar> orderPrivateCarMap = orderPrivateCarService.selectList(new EntityWrapper<TOrderPrivateCar>())
+                .stream()
+                .collect(Collectors.toMap(TOrderPrivateCar::getId, user -> user));
+        Map<Integer, TOrderLogistics> orderLogisticsRecordMap = orderLogisticsService.selectList(new EntityWrapper<TOrderLogistics>())
+                .stream()
+                .collect(Collectors.toMap(TOrderLogistics::getId, user -> user));
         // 已结算金额
         BigDecimal balance = new BigDecimal("0");
         // 未结算金额
@@ -221,10 +225,7 @@
                     }
                     // 查询订单信息
 //                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getIncomeId());
-                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
-                            .eq("id", income.getIncomeId())
-                            .between("insertTime", start, end));
-
+                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarMap.get(income.getIncomeId());
                     if (tOrderPrivateCar==null){
                         continue;
                     }
@@ -244,9 +245,9 @@
                     // 小件物流
                     // 查询订单信息
 //                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(income.getIncomeId());
-                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
-                            .eq("id", income.getIncomeId())
-                            .between("insertTime", start, end));
+
+                    TOrderLogistics tOrderLogistics = orderLogisticsRecordMap.get(income.getIncomeId());
+
                     if (tOrderLogistics==null){
                         continue;
                     }
@@ -268,10 +269,8 @@
             switch (settlementDetail.getOrderType()){
                 case 1:
                     // 专车订单
-//                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(settlementDetail.getOrderId());
-                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
-                            .eq("id", settlementDetail.getOrderId())
-                            .between("insertTime", start, end));
+                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarMap.get(settlementDetail.getOrderId());
+
                     if (tOrderPrivateCar==null){
                         continue;
                     }
@@ -310,10 +309,8 @@
                 case 4:
                     // 小件物流
                     // 查询订单信息
-//                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(settlementDetail.getOrderId());
-                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
-                            .eq("id", settlementDetail.getOrderId())
-                            .between("insertTime", start, end));
+                    TOrderLogistics tOrderLogistics = orderLogisticsRecordMap.get(settlementDetail.getOrderId());
+
                     if (tOrderLogistics==null){
                         continue;
                     }
@@ -1818,6 +1815,16 @@
         Map<Integer, SettlementDetail> settlementDetailMap = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>())
                 .stream()
                 .collect(Collectors.toMap(SettlementDetail::getId, user -> user));
+        Map<Integer, TOrderPrivateCar> orderPrivateCarMap = orderPrivateCarService.selectList(new EntityWrapper<TOrderPrivateCar>())
+                .stream()
+                .collect(Collectors.toMap(TOrderPrivateCar::getId, user -> user));
+        Map<Integer, TOrderLogistics> orderLogisticsRecordMap = orderLogisticsService.selectList(new EntityWrapper<TOrderLogistics>())
+                .stream()
+                .collect(Collectors.toMap(TOrderLogistics::getId, user -> user));
+        Map<Integer, OrderCancel> orderCancelRecordMap = orderCancelService.selectList(new EntityWrapper<OrderCancel>()
+                )
+                .stream()
+                .collect(Collectors.toMap(OrderCancel::getId, user -> user));
         // 已结算金额
         BigDecimal balance = new BigDecimal("0");
         // 未结算金额
@@ -1832,10 +1839,7 @@
                         continue;
                     }
                     // 查询订单信息
-//                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(income.getIncomeId());
-                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
-                            .eq("id", income.getIncomeId())
-                            .between("insertTime", start, end));
+                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarMap.get(income.getIncomeId());
 
                     if (tOrderPrivateCar==null){
                         continue;
@@ -1857,9 +1861,7 @@
                     }
                     if (tOrderPrivateCar.getState() == 10){
                         // 查询取消订单 用户支付方式
-                        OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>()
-                                .eq("orderType", 1)
-                                .eq("orderId", tOrderPrivateCar.getId()));
+                        OrderCancel orderCancel = orderCancelRecordMap.get(tOrderPrivateCar.getId());
                         if (orderCancel!=null &&orderCancel.getPayType()!=null){
                             switch (orderCancel.getPayType()){
                                 case 1:
@@ -1904,10 +1906,9 @@
                     }
                     // 小件物流
                     // 查询订单信息
-//                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(income.getIncomeId());
-                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
-                            .eq("id", income.getIncomeId())
-                            .between("insertTime", start, end));
+//
+                    TOrderLogistics tOrderLogistics = orderLogisticsRecordMap.get(income.getIncomeId());
+
                     if (tOrderLogistics==null){
                         continue;
                     }
@@ -1928,9 +1929,9 @@
                     }
                     if (tOrderLogistics.getState() == 10){
                         // 查询取消订单 用户支付方式
-                        OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>()
-                                .eq("orderType", 4)
-                                .eq("orderId", tOrderLogistics.getId()));
+
+                        OrderCancel orderCancel = orderCancelRecordMap.get(tOrderLogistics.getId());
+
                         if (orderCancel!=null &&orderCancel.getPayType()!=null){
                             switch (orderCancel.getPayType()){
                                 case 1:
@@ -1975,10 +1976,8 @@
             switch (settlementDetail.getOrderType()){
                 case 1:
                     // 专车订单
-//                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectById(settlementDetail.getOrderId());
-                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarService.selectOne(new EntityWrapper<TOrderPrivateCar>()
-                            .eq("id", settlementDetail.getOrderId())
-                            .between("insertTime", start, end));
+                    TOrderPrivateCar tOrderPrivateCar = orderPrivateCarMap.get(settlementDetail.getOrderId());
+
                     if (tOrderPrivateCar==null){
                         continue;
                     }
@@ -2024,10 +2023,7 @@
                 case 4:
                     // 小件物流
                     // 查询订单信息
-//                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectById(settlementDetail.getOrderId());
-                    TOrderLogistics tOrderLogistics = orderLogisticsService.selectOne(new EntityWrapper<TOrderLogistics>()
-                            .eq("id", settlementDetail.getOrderId())
-                            .between("insertTime", start, end));
+                    TOrderLogistics tOrderLogistics = orderLogisticsRecordMap.get(settlementDetail.getOrderId());
                     if (tOrderLogistics==null){
                         continue;
                     }

--
Gitblit v1.7.1