From 96750e073321368fc6becf948d70aadee14f8030 Mon Sep 17 00:00:00 2001
From: wang-hao-jie <1550036656@qq.com>
Date: 星期五, 10 十二月 2021 15:57:48 +0800
Subject: [PATCH] 违章记录

---
 /dev/null                                                                                             |   41 -------------
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java    |    5 +
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java     |    4 +
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java               |    4 +
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPc2ScheduleImpl.java |   70 +++++++++++++++++++++++
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java            |    2 
 6 files changed, 85 insertions(+), 41 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java
index dc782ad..0bbfb16 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java
@@ -105,7 +105,11 @@
         QueryWrapper<Fingerprint> wrapper = new QueryWrapper<>();
         wrapper.eq("code",code);
         wrapper.eq("area_id",c.getAreaId());
+        wrapper.eq("customer_id",customerId);
         Fingerprint one = iFingerprintService.getOne(wrapper);
+        if(one==null){
+            return ResultUtil.error("鎸囩汗涓庡晢鎴蜂笉鍖归厤");
+        }
 
         CustomerReceive customerReceive = iCustomerReceiveService.getById(one.getCustomerReceiveId());
         return new ResultUtil<Object>().setData(customerReceive);
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java
index 003b828..a2dc8fb 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java
@@ -41,4 +41,8 @@
             @Result(column="num1", property="num", jdbcType = JdbcType.INTEGER),
             @Result(column="num2", property="level", jdbcType = JdbcType.INTEGER)})
     List<OrderTask> list3(String date);
+
+    @Select("select sum(time) as time2,send_date from t_order_task where date_sub(curdate(), interval 1 month) <= date(send_date) and area_section_id=#{arg0} GROUP BY send_date")
+    @Results({@Result(column="time2", property="time", jdbcType = JdbcType.INTEGER)})
+    List<OrderTask> sumTime(String id);
 }
\ No newline at end of file
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/CarScheduleImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/CarScheduleImpl.java
deleted file mode 100644
index 9c75e08..0000000
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/CarScheduleImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package cn.exrick.xboot.your.schedulings;
-import cn.exrick.xboot.your.entity.Area;
-import cn.exrick.xboot.your.entity.Customer;
-import cn.exrick.xboot.your.service.IAreaSectionService;
-import cn.exrick.xboot.your.service.IAreaService;
-import cn.exrick.xboot.your.service.ICustomerService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.io.IOException;
-import java.util.List;
-
-//澶у睆閰嶉�佸垎鏋�
-@Component
-public class CarScheduleImpl {
-
-    @Autowired
-    private IAreaService iAreaService;
-
-    @Autowired
-    private IAreaSectionService iAreaSectionService;
-
-    @Autowired
-    private ICustomerService iCustomerService;
-
-    @Scheduled(cron="0 0 * * * ?")//姣忓皬鏃舵墽琛屼竴娆�
-    public void execute(){
-        List<Area> list = iAreaService.list();
-        for(Area area:list){
-            QueryWrapper<Customer> wrapper = new QueryWrapper<>();
-            wrapper.eq("area_id",area.getId());
-            int count = iCustomerService.count(wrapper);
-            area.setCustomerSum(count);
-            iAreaService.saveOrUpdate(area);
-        }
-
-
-    }
-}
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPc2ScheduleImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPc2ScheduleImpl.java
new file mode 100644
index 0000000..48f6124
--- /dev/null
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPc2ScheduleImpl.java
@@ -0,0 +1,70 @@
+package cn.exrick.xboot.your.schedulings;
+import cn.exrick.xboot.your.entity.Area;
+import cn.exrick.xboot.your.entity.AreaSection;
+import cn.exrick.xboot.your.entity.Customer;
+import cn.exrick.xboot.your.entity.OrderTask;
+import cn.exrick.xboot.your.service.IAreaSectionService;
+import cn.exrick.xboot.your.service.IAreaService;
+import cn.exrick.xboot.your.service.ICustomerService;
+import cn.exrick.xboot.your.service.IOrderTaskService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+//澶у睆閰嶉�佸垎鏋�
+@Component
+public class StatisticPc2ScheduleImpl {
+
+    @Autowired
+    private IAreaService iAreaService;
+
+    @Autowired
+    private IAreaSectionService iAreaSectionService;
+
+    @Autowired
+    private ICustomerService iCustomerService;
+
+    @Autowired
+    private IOrderTaskService iOrderTaskService;
+
+    @Scheduled(cron="0 0 * * * ?")//姣忓皬鏃舵墽琛屼竴娆�
+    public void execute(){
+        List<Area> list = iAreaService.list();
+        for(Area area:list){
+            QueryWrapper<Customer> wrapper = new QueryWrapper<>();
+            wrapper.eq("area_id",area.getId());
+            int count = iCustomerService.count(wrapper);
+            area.setCustomerSum(count);
+            iAreaService.saveOrUpdate(area);
+        }
+
+        List<AreaSection> list2 = iAreaSectionService.list();
+        for(AreaSection areaSection:list2){
+            String id = areaSection.getId();
+            QueryWrapper<Customer> wrapper = new QueryWrapper<>();
+            wrapper.eq("area_section_id",id);
+            int count = iCustomerService.count(wrapper);
+            areaSection.setCustomerNum(count);
+
+            List<OrderTask> orderTasks = iOrderTaskService.sumTime(id);
+            int sum = 0;
+            List<Integer> listTime = new ArrayList<>();
+            for(OrderTask orderTask:orderTasks){
+                sum+=orderTask.getTime();
+                listTime.add(orderTask.getTime());
+            }
+
+
+
+
+        }
+
+
+
+    }
+}
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java
index 1cf9c9b..4c74c61 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java
@@ -23,4 +23,6 @@
     int countLike();
 
     List<OrderTask> list3(String date);
+
+    List<OrderTask> sumTime(String id);
 }
\ No newline at end of file
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java
index 75ede4f..494ddd4 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java
@@ -58,4 +58,9 @@
     public List<OrderTask> list3(String date) {
         return orderTaskMapper.list3(date);
     }
+
+    @Override
+    public List<OrderTask> sumTime(String id) {
+        return orderTaskMapper.sumTime(id);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1