From 1798c91f6b0782d1970a8a4fdcaf4a174e68cb61 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期二, 16 五月 2023 10:45:58 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
index 7658f40..fa6af94 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
@@ -24,6 +24,7 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.stereotype.Service;
 import org.springframework.ui.Model;
 import org.springframework.util.CollectionUtils;
@@ -37,8 +38,10 @@
 import java.net.URLConnection;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.Period;
 import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
@@ -96,8 +99,8 @@
         // 开始,结束时间
         if(StringUtils.hasLength(createTime)){
             String[] split = createTime.split(" - ");
-            Date startTime = DateUtil.getDate_str4(split[0]);
-            Date endTime = DateUtil.getDate_str4(split[1]);
+            Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00");
+            Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59");
             wrapper.between("createTime",startTime,endTime);
         }
         wrapper.orderBy(true,"approvalStatus");
@@ -506,11 +509,11 @@
         Integer driverTotal = tDriverMapper.selectCount(new EntityWrapper<TDriver>()
                 .eq("agentId", agentId));
         // 司机最近一月数量
-        LocalDate now = LocalDate.now();
-        LocalDate localDate = now.plusMonths(1);
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime localDateTime = now.minusMonths(1);
         Integer driverMonthTotal = tDriverMapper.selectCount(new EntityWrapper<TDriver>()
                 .eq("agentId", agentId)
-                .between("createTime", localDate, now));
+                .between("createTime", localDateTime, now));
         model.addAttribute("driverTotal",driverTotal);
         model.addAttribute("driverMonthTotal",driverMonthTotal);
         map.put("driverTotal",driverTotal);
@@ -523,8 +526,8 @@
         Integer driverTotal = tDriverMapper.selectCount(new EntityWrapper<TDriver>()
                 .in("agentId", ids));
         // 司机最近一月数量
-        LocalDate now = LocalDate.now();
-        LocalDate localDate = now.plusMonths(1);
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime localDate = now.minusMonths(1);
         Integer driverMonthTotal = tDriverMapper.selectCount(new EntityWrapper<TDriver>()
                 .in("agentId", ids)
                 .between("createTime", localDate, now));

--
Gitblit v1.7.1