From 9c1d7ce35cc8c7dc81e0b259fb3b52211aa2f1bf Mon Sep 17 00:00:00 2001
From: zhangzeli <123456>
Date: 星期三, 09 二月 2022 13:55:11 +0800
Subject: [PATCH] bug

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java
index d314e9b..7083ce9 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java
@@ -11,7 +11,7 @@
 
 import java.io.IOException;
 import java.util.List;
-
+//瀹㈡埛绔椤垫暟鎹粺璁�
 @Component
 public class StatisticScheduleImpl {
 
@@ -36,7 +36,7 @@
     @Autowired
     private IAlarmService iAlarmService;
 
-    @Scheduled(cron="0 0 * * * ?")//姣忔櫄鍑屾櫒1鐐规墽琛�
+    @Scheduled(cron="0 0 1 * * ?")//姣忔櫄鍑屾櫒1鐐规墽琛�
     public void execute(){
         List<User> all = userService.findAll();
         for(User user:all){
@@ -57,8 +57,13 @@
                         one.setSafeDriving(0);//瀹夊叏椹鹃┒閲岀▼
                         one.setDriving(0);//椹鹃┒閲岀▼
                     }else{
-                        one.setSafeDriving(max-min);//瀹夊叏椹鹃┒閲岀▼
-                        one.setDriving(max-min);//椹鹃┒閲岀▼
+                        if(max==min){
+                            one.setSafeDriving(max);//瀹夊叏椹鹃┒閲岀▼
+                            one.setDriving(max);//椹鹃┒閲岀▼
+                        }else{
+                            one.setSafeDriving(max-min);//瀹夊叏椹鹃┒閲岀▼
+                            one.setDriving(max-min);//椹鹃┒閲岀▼
+                        }
                     }
 
                     QueryWrapper<DrivingRecord> wrapper2 = new QueryWrapper<>();
@@ -83,11 +88,14 @@
                 if(type2==1){
                     QueryWrapper<OrderTask> wrapper2 = new QueryWrapper<>();
                     wrapper2.eq("user_id",user.getId());
+                    wrapper2.ne("status",0);
                     int count = iOrderTaskService.count(wrapper2);
                     one.setSends(count);//閰嶉�佹鏁�
 
-                    wrapper2.ne("status",0);
-                    int count2 = iOrderTaskService.count(wrapper2);
+                    QueryWrapper<OrderTask> wrapper22 = new QueryWrapper<>();
+                    wrapper22.eq("user_id",user.getId());
+                    wrapper22.eq("status",1);
+                    int count2 = iOrderTaskService.count(wrapper22);
                     one.setSends2(count2);//閫佽揪娆℃暟
 
                     QueryWrapper<Area> wrapper3 = new QueryWrapper<>();

--
Gitblit v1.9.1