From ae32c3a7d77e2ed114555623c70e3fbd1d6aba59 Mon Sep 17 00:00:00 2001
From: wang-hao-jie <1550036656@qq.com>
Date: 星期四, 10 三月 2022 08:47:45 +0800
Subject: [PATCH] 违章记录

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java |  152 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 149 insertions(+), 3 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java
index ab3b00c..f171853 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java
@@ -8,7 +8,11 @@
 import cn.exrick.xboot.your.entity.*;
 import cn.exrick.xboot.your.service.*;
 import cn.exrick.xboot.your.util.HaiKangPost;
+import cn.exrick.xboot.your.vo.AlarmVo;
+import cn.exrick.xboot.your.vo.PreviewURLsVo;
+import cn.exrick.xboot.your.vo.TalkURLsVo;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -52,6 +56,15 @@
     @Autowired
     private IAreaSectionService iAreaSectionService;
 
+    @Autowired
+    private IEquipmentService iEquipmentService;
+
+    @Autowired
+    private IAlarmService iAlarmService;
+
+    @Autowired
+    private ICustomerService iCustomerService;
+
     @RequestMapping(value = "/getIndex1", method = RequestMethod.GET)
     @ApiOperation(value = "鑾峰彇棣栭〉鏁版嵁")
     public Result<Object> getIndex1() {
@@ -60,7 +73,18 @@
         for (String str : scan) {
             map.put(str.substring(12),redisTemplateHelper.get(str));
         }
+        QueryWrapper<Customer> wrapper = new QueryWrapper<>();
+        wrapper.eq("kstatus",0);
+        map.put("taKan",iCustomerService.count(wrapper));
         return new ResultUtil<Object>().setData(map);
+    }
+
+    @RequestMapping(value = "/getTaKanList", method = RequestMethod.GET)
+    @ApiOperation(value = "鑾峰彇韪忓嫎鍟嗘埛鍒楄〃")
+    public Result<Object> getTaKanList() {
+        QueryWrapper<Customer> wrapper = new QueryWrapper<>();
+        wrapper.eq("kstatus",0);
+        return new ResultUtil<Object>().setData(iCustomerService.list(wrapper));
     }
 
     @RequestMapping(value = "/getTodayTask", method = RequestMethod.GET)
@@ -69,7 +93,7 @@
         QueryWrapper<OrderTask> wrapper2 = new QueryWrapper<OrderTask>();
         String format = DateUtil.format(new Date(), "yyyy-MM-dd");
         wrapper2.eq("a.send_date",format);
-//        wrapper2.orderByAsc("a.seq");
+        //wrapper2.orderByAsc("a.seq");
         List<OrderTask> list = iOrderTaskService.list3(format);
         return new ResultUtil<Object>().setData(list);
     }
@@ -91,10 +115,17 @@
     @ApiOperation(value = "鑾峰彇杞﹁締瀹氫綅淇℃伅")
     public Result<Object> getCars() {
         List<Car> list = iCarService.list();
-        String codes[] = new String[list.size()];
+        List<String> list2 = new ArrayList<>();
 
         for(int i=0;i<list.size();i++){
-            codes[i] = list.get(i).getCode();
+            if(!StrUtil.isEmpty(list.get(i).getCode())){
+                list2.add(list.get(i).getCode());
+            }
+        }
+
+        String codes[] = new String[list2.size()];
+        for(int i=0;i<list2.size();i++){
+            codes[i] = list2.get(i);
         }
         String latestGps = haiKangPost.findLatestGps(codes);
         return new ResultUtil<Object>().setData(JSONUtil.parseObj(latestGps));
@@ -153,7 +184,122 @@
         return new ResultUtil<Object>().setData(map);
     }
 
+    @RequestMapping(value = "/getOrderStatus", method = RequestMethod.GET)
+    @ApiOperation(value = "鑾峰彇鏌愯締杞︾殑閰嶉�佹儏鍐�")
+    public Result<Object> getOrderStatus(String carNo) {
+
+        QueryWrapper<Car> wrapper = new QueryWrapper<>();
+        wrapper.eq("car_no",carNo);
+        Car car = iCarService.getOne(wrapper);
+
+        if(car==null){
+           return ResultUtil.error("杞﹁締涓嶅瓨鍦�,璇峰厛娣诲姞杞﹁締淇℃伅");
+        }
+
+        QueryWrapper<OrderTask> wrapper2 = new QueryWrapper<OrderTask>();
+        String format = DateUtil.format(new Date(), "yyyy-MM-dd");
+        wrapper2.eq("a.send_date",format);
+        wrapper2.eq("a.car_id",car.getId());
+        List<OrderTask> list = iOrderTaskService.list4(wrapper2);
+
+        return new ResultUtil<Object>().setData(list);
+    }
+
+    @RequestMapping(value = "/getVideoByCarId", method = RequestMethod.GET)
+    @ApiOperation(value = "鑾峰彇瑙嗛淇℃伅 1锛氬墠缃� 4锛氳溅鍐�")
+    public Result<Object> getVideoByCarId(String carCode,int type) {
+        QueryWrapper<Car> wrapper = new QueryWrapper<Car>();
+        wrapper.eq("code",carCode);
+        Car car = iCarService.getOne(wrapper);
+        if(car==null){
+            return ResultUtil.error("杞﹁締缂栧彿閿欒");
+        }
+
+        QueryWrapper<Equipment> wrapper1 = new QueryWrapper<>();
+        wrapper1.eq("car_id",car.getId());
+        wrapper1.eq("type",type);
+        Equipment one = iEquipmentService.getOne(wrapper1);
+        if(one==null){
+            return ResultUtil.error("璁惧鏈壘鍒�");
+        }
+
+        PreviewURLsVo previewURLsVo = new PreviewURLsVo();
+		previewURLsVo.setCameraIndexCode(one.getCode());
+        String s = haiKangPost.previewURLs(previewURLsVo);
+        return new ResultUtil<Object>().setData(JSONUtil.parseObj(s));
+    }
+
+    @RequestMapping(value = "/getYuYinByCarId", method = RequestMethod.GET)
+    @ApiOperation(value = "鑾峰彇瀵硅淇℃伅")
+    public Result<Object> getYuYinByCarId(String carCode,int type,int transmode) {
+        QueryWrapper<Car> wrapper = new QueryWrapper<Car>();
+        wrapper.eq("code",carCode);
+        Car car = iCarService.getOne(wrapper);
+        if(car==null){
+            return ResultUtil.error("杞﹁締缂栧彿閿欒");
+        }
+
+        QueryWrapper<Equipment> wrapper1 = new QueryWrapper<>();
+        wrapper1.eq("car_id",car.getId());
+        wrapper1.eq("type",type);
+        Equipment one = iEquipmentService.getOne(wrapper1);
+        if(one==null){
+            return ResultUtil.error("璁惧鏈壘鍒�");
+        }
+
+        TalkURLsVo talkURLsVo =new TalkURLsVo();
+        talkURLsVo.setCameraIndexCode(one.getCode());
+        talkURLsVo.setTransmode(transmode);
+        String s = haiKangPost.talkURLs(talkURLsVo);
+        return new ResultUtil<Object>().setData(JSONUtil.parseObj(s));
+    }
+
+    @RequestMapping(value = "/getAlarmByCarId", method = RequestMethod.GET)
+    @ApiOperation(value = "鑾峰彇鎶ヨ鍥剧墖")
+    public Result<Object> getAlarmByCarId(String alarmId) {
+        QueryWrapper<Alarm> wrapper = new QueryWrapper<Alarm>();
+        wrapper.eq("alarm_id",alarmId);
+        Alarm alarm = iAlarmService.getOne(wrapper);
+        if(alarm==null){
+            return ResultUtil.error("鎶ヨid閿欒");
+        }
+
+        AlarmVo alarmVo = new AlarmVo();
+        alarmVo.setAlarmId(alarm.getAlarmId());
+        String[] s1 = alarm.getAlarmTime().split(" ");
+        alarmVo.setAlarmTime(s1[0]+"T"+s1[1]+".000+08:00");
+        String s = haiKangPost.findPicturesByAlarmId(alarmVo);
+        return new ResultUtil<Object>().setData(JSONUtil.parseObj(s));
+    }
+
     public double trans2(double v2){
         return (double) Math.round(v2 * 100) / 100;
     }
+
+
+    @RequestMapping(value = "/getYiHuDuoZheng", method = RequestMethod.GET)
+    @ApiOperation(value = "鑾峰彇閰嶉�佸垎鏋愯鎯�")
+    public Result<Object> getYiHuDuoZheng() {
+
+        List<Customer> list = iCustomerService.getYiHuDuoZheng();
+        Map<String,Object> map = new HashMap<>();
+        map.put("name","涓�鎴峰璇�");
+        List<Object> childrens = new ArrayList<>();
+        for(Customer c:list){
+            Map<String,Object> map2 = new HashMap<>();
+            map2.put("name",c.getName());
+
+            List<Object> names = new ArrayList<>();
+            Map<String,Object> map3 = new HashMap<>();
+            map3.put("name",c.getCode());
+            names.add(map3);
+
+            map2.put("children",names);
+
+            childrens.add(map2);
+        }
+        map.put("children",childrens);
+
+        return new ResultUtil<Object>().setData(map);
+    }
 }

--
Gitblit v1.9.1