From c9cbc0947f6fe578d1f178d73a2dd46d95bec275 Mon Sep 17 00:00:00 2001 From: wang-hao-jie <1550036656@qq.com> Date: 星期一, 07 二月 2022 08:40:22 +0800 Subject: [PATCH] 违章记录 --- 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