From f4d52e83eb99233c895a0fff0eef287792130752 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期二, 16 五月 2023 10:45:52 +0800
Subject: [PATCH] BUG修改
---
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 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 5deea73..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;
@@ -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