From 5414f8d8729ab68b9ce53c40accb8baa4c5bd808 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 08 八月 2024 14:00:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java           |    8 +
 ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java |    8 +
 ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java              |    7 +
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml                      |   32 ++++++++
 ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java   |    6 +
 ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java  |   23 +----
 ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java         |    8 ++
 ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java          |    9 +
 ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java            |    9 ++
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml                     |   30 +++++++
 ycl-server/src/main/java/com/ycl/platform/controller/DashboardController.java          |   20 ++++
 ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java             |    7 +
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml                    |   43 ++++++++++
 13 files changed, 185 insertions(+), 25 deletions(-)

diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/DashboardController.java b/ycl-server/src/main/java/com/ycl/platform/controller/DashboardController.java
index c81bf9c..b39c1b7 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/DashboardController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/DashboardController.java
@@ -1,8 +1,7 @@
 package com.ycl.platform.controller;
 
 import com.ycl.platform.domain.query.DashboardQuery;
-import com.ycl.platform.service.ITMonitorService;
-import com.ycl.platform.service.WorkOrderService;
+import com.ycl.platform.service.*;
 import com.ycl.system.service.ISysDeptService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -25,6 +24,9 @@
     private final WorkOrderService workOrderService;
     private final ITMonitorService monitorService;
     private final ISysDeptService deptService;
+    private final ICheckIndexFaceService checkIndexFaceService;
+    private final ICheckIndexCarService checkIndexCarService;
+    private final ICheckIndexVideoService checkIndexVideoService;
 
     @GetMapping("/department")
     public AjaxResult department() {
@@ -51,5 +53,19 @@
         return AjaxResult.success(monitorService.monitorRate(dashboardQuery));
     }
 
+    @GetMapping("/check/face")
+    public AjaxResult checkFace(DashboardQuery dashboardQuery) {
+        return AjaxResult.success(checkIndexFaceService.dashboard(dashboardQuery));
+    }
+
+    @GetMapping("/check/car")
+    public AjaxResult checkCar(DashboardQuery dashboardQuery) {
+        return AjaxResult.success(checkIndexCarService.dashboard(dashboardQuery));
+    }
+
+    @GetMapping("/check/video")
+    public AjaxResult checkVideo(DashboardQuery dashboardQuery) {
+        return AjaxResult.success(checkIndexVideoService.dashboard(dashboardQuery));
+    }
 
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java
index fc7401b..b610f0c 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ycl.platform.domain.entity.CheckIndexCar;
+import com.ycl.platform.domain.query.DashboardQuery;
 
 import java.util.List;
 
@@ -63,4 +64,10 @@
 
     public List<CheckIndexCar> selectToday(String today);
 
+    /**
+     * 澶у睆杞﹁締鑰冩牳
+     * @param dashboardQuery 鏌ヨ鏉′欢
+     * @return 鏁版嵁
+     */
+    CheckIndexCar dashboard(DashboardQuery dashboardQuery);
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java
index 2e12b8c..f5b3c34 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ycl.platform.domain.entity.CheckIndexFace;
+import com.ycl.platform.domain.query.DashboardQuery;
 
 import java.util.List;
 
@@ -63,4 +64,10 @@
 
     List<CheckIndexFace> selectToday(String date);
 
+    /**
+     * 澶у睆浜鸿劯鑰冩牳
+     * @param dashboardQuery 鏌ヨ鏉′欢
+     * @return 鏁版嵁
+     */
+    CheckIndexFace dashboard(DashboardQuery dashboardQuery);
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java
index e43905a..ec27a1d 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java
@@ -1,8 +1,8 @@
 package com.ycl.platform.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ycl.platform.domain.entity.CheckIndexFace;
 import com.ycl.platform.domain.entity.CheckIndexVideo;
+import com.ycl.platform.domain.query.DashboardQuery;
 
 import java.util.List;
 
@@ -63,4 +63,11 @@
     public int deleteCheckIndexVideoByIds(Long[] ids);
 
     List<CheckIndexVideo> selectToday(String date);
+
+    /**
+     * 澶у睆浜鸿劯鑰冩牳
+     * @param dashboardQuery 鏌ヨ鏉′欢
+     * @return 鏁版嵁
+     */
+    CheckIndexVideo dashboard(DashboardQuery dashboardQuery);
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java
index 24ecc0c..eabf088 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java
@@ -2,7 +2,7 @@
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ycl.platform.domain.entity.CheckIndexCar;
-import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult;
+import com.ycl.platform.domain.query.DashboardQuery;
 
 import java.util.List;
 
@@ -62,4 +62,10 @@
      */
     public int deleteCheckIndexCarById(Long id);
 
+    /**
+     * 澶у睆杞﹁締鑰冩牳
+     * @param dashboardQuery 鏌ヨ鏉′欢
+     * @return 鏁版嵁
+     */
+    CheckIndexCar dashboard(DashboardQuery dashboardQuery);
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java
index 8b0eb91..8a06521 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java
@@ -1,9 +1,8 @@
 package com.ycl.platform.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ycl.platform.domain.entity.CheckIndexCar;
 import com.ycl.platform.domain.entity.CheckIndexFace;
-import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult;
+import com.ycl.platform.domain.query.DashboardQuery;
 
 import java.util.List;
 
@@ -63,4 +62,10 @@
      */
     public int deleteCheckIndexFaceById(Long id);
 
+    /**
+     * 澶у睆浜鸿劯鑰冩牳
+     * @param dashboardQuery 鏌ヨ鏉′欢
+     * @return 鏁版嵁
+     */
+    CheckIndexFace dashboard(DashboardQuery dashboardQuery);
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java
index 832f9c6..250df9b 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ycl.platform.domain.entity.CheckIndexVideo;
+import com.ycl.platform.domain.query.DashboardQuery;
 
 import java.util.List;
 
@@ -59,4 +60,11 @@
      * @return 缁撴灉
      */
     public int deleteCheckIndexVideoById(Long id);
+
+    /**
+     * 澶у睆瑙嗛鑰冩牳
+     * @param dashboardQuery 鏌ヨ鏉′欢
+     * @return 鏁版嵁
+     */
+    CheckIndexVideo dashboard(DashboardQuery dashboardQuery);
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java
index 40e0402..e460f24 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ycl.platform.domain.entity.CheckIndexCar;
+import com.ycl.platform.domain.query.DashboardQuery;
 import com.ycl.platform.mapper.CheckIndexCarMapper;
 import com.ycl.platform.service.ICheckIndexCarService;
 import com.ycl.platform.service.ITMonitorService;
@@ -97,4 +98,9 @@
     public int deleteCheckIndexCarById(Long id) {
         return checkIndexCarMapper.deleteCheckIndexCarById(id);
     }
+
+    @Override
+    public CheckIndexCar dashboard(DashboardQuery dashboardQuery) {
+        return checkIndexCarMapper.dashboard(dashboardQuery);
+    }
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java
index 6f4a5e9..aa55bcf 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java
@@ -1,30 +1,18 @@
 package com.ycl.platform.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ycl.platform.domain.entity.CheckIndexCar;
 import com.ycl.platform.domain.entity.CheckIndexFace;
-import com.ycl.platform.domain.entity.TMonitor;
-import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult;
-import com.ycl.platform.mapper.CheckIndexCarMapper;
+import com.ycl.platform.domain.query.DashboardQuery;
 import com.ycl.platform.mapper.CheckIndexFaceMapper;
 import com.ycl.platform.service.ICheckIndexFaceService;
 import com.ycl.platform.service.ITMonitorService;
 import com.ycl.system.mapper.SysConfigMapper;
 import com.ycl.system.mapper.SysDeptMapper;
-import constant.ApiConstants;
-import constant.CheckConstants;
-import constant.CheckSnapCountConstants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
 import utils.DateUtils;
 
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
+import java.util.List;
 
 /**
  * 浜鸿劯鎸囨爣姒傜巼鏁版嵁Service涓氬姟灞傚鐞�
@@ -109,7 +97,8 @@
         return checkIndexFaceMapper.deleteCheckIndexFaceById(id);
     }
 
-
-
-
+    @Override
+    public CheckIndexFace dashboard(DashboardQuery dashboardQuery) {
+        return checkIndexFaceMapper.dashboard(dashboardQuery);
+    }
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java
index d1b013c..10b5e63 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java
@@ -1,9 +1,8 @@
 package com.ycl.platform.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ycl.platform.domain.entity.CheckIndexFace;
 import com.ycl.platform.domain.entity.CheckIndexVideo;
-import com.ycl.platform.mapper.CheckIndexFaceMapper;
+import com.ycl.platform.domain.query.DashboardQuery;
 import com.ycl.platform.mapper.CheckIndexVideoMapper;
 import com.ycl.platform.service.ICheckIndexVideoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -96,4 +95,9 @@
     {
         return checkIndexVideoMapper.deleteCheckIndexVideoById(id);
     }
+
+    @Override
+    public CheckIndexVideo dashboard(DashboardQuery dashboardQuery) {
+        return checkIndexVideoMapper.dashboard(dashboardQuery);
+    }
 }
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
index 3e251b2..b28ab74 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
@@ -124,4 +124,36 @@
     <select id="selectToday">
         select * from t_check_index_car where DATE(create_time) = #{today}
     </select>
+
+    <select id="dashboard" resultType="com.ycl.platform.domain.entity.CheckIndexCar">
+        SELECT
+            IFNULL(ROUND(AVG(view_connect_stability * 100), 2), 0) AS view_connect_stability,
+            IFNULL(ROUND(AVG(site_online * 100), 2), 0) AS site_online,
+            IFNULL(ROUND(AVG(device_directory_consistent * 100), 2), 0) AS device_directory_consistent,
+            IFNULL(ROUND(AVG(vehicle_information_collection_accuracy * 100), 2), 0) AS vehicle_information_collection_accuracy,
+            IFNULL(ROUND(AVG(vehicle_capture_integrity * 100), 2), 0) AS vehicle_capture_integrity,
+            IFNULL(ROUND(AVG(vehicle_capture_accuracy * 100), 2), 0) AS vehicle_capture_accuracy,
+            IFNULL(ROUND(AVG(vehicle_timing_accuracy * 100), 2), 0) AS vehicle_timing_accuracy,
+            IFNULL(ROUND(AVG(vehicle_upload_timeliness * 100), 2), 0) AS vehicle_upload_timeliness,
+            IFNULL(ROUND(AVG(vehicle_url_availability * 100), 2), 0) AS vehicle_url_availability,
+            IFNULL(ROUND(AVG(vehicle_picture_availability * 100), 2), 0) AS vehicle_picture_availability
+        FROM
+            t_check_index_car
+        <where>
+            <if test="deptId != null">
+                AND dept_id = #{deptId}
+            </if>
+            <if test="dataScope == 1">
+                AND examine_tag = 1
+            </if>
+        </where>
+        ORDER BY
+            create_time DESC
+        <if test="deptId == null">
+            LIMIT 7
+        </if>
+        <if test="deptId != null">
+            LIMIT 1
+        </if>
+    </select>
 </mapper>
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
index 43aaf4d..b2a65f5 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
@@ -114,4 +114,34 @@
     <select id="selectToday">
         select * from t_check_index_car where DATE(create_time) = #{today}
     </select>
+
+    <select id="dashboard" resultType="com.ycl.platform.domain.entity.CheckIndexFace">
+        SELECT
+        IFNULL(ROUND(AVG(view_connect_stability * 100), 2), 0) AS view_connect_stability,
+        IFNULL(ROUND(AVG(site_online * 100), 2), 0) AS site_online,
+        IFNULL(ROUND(AVG(device_directory_consistent * 100), 2), 0) AS device_directory_consistent,
+        IFNULL(ROUND(AVG(face_information_collection_accuracy * 100), 2), 0) AS face_information_collection_accuracy,
+        IFNULL(ROUND(AVG(face_picture_qualification * 100), 2), 0) AS face_picture_qualification,
+        IFNULL(ROUND(AVG(face_timing_accuracy * 100), 2), 0) AS face_timing_accuracy,
+        IFNULL(ROUND(AVG(face_upload_timeliness * 100), 2), 0) AS face_upload_timeliness,
+        IFNULL(ROUND(AVG(face_picture_availability * 100), 2), 0) AS face_picture_availability
+        FROM
+        t_check_index_face
+        <where>
+            <if test="deptId != null">
+                AND dept_id = #{deptId}
+            </if>
+            <if test="dataScope == 1">
+                AND examine_tag = 1
+            </if>
+        </where>
+        ORDER BY
+        create_time DESC
+        <if test="deptId == null">
+            LIMIT 7
+        </if>
+        <if test="deptId != null">
+            LIMIT 1
+        </if>
+    </select>
 </mapper>
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
index 35bd244..ee8c4a0 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
@@ -175,4 +175,47 @@
     <select id="selectToday">
         select * from t_check_index_video where DATE(create_time) = #{today}
     </select>
+
+    <select id="dashboard" resultType="com.ycl.platform.domain.entity.CheckIndexVideo">
+        SELECT
+        IFNULL(ROUND(AVG(platform_online * 100), 2), 0) AS platform_online,
+        IFNULL(ROUND(AVG(monitor_qualification * 100), 2), 0) AS monitor_qualification,
+        IFNULL(ROUND(AVG(monitor_registration * 100), 2), 0) AS monitor_registration,
+        IFNULL(ROUND(AVG(archives_rate * 100), 2), 0) AS archives_rate,
+        IFNULL(ROUND(AVG(site_online * 100), 2), 0) AS site_online,
+        IFNULL(ROUND(AVG(video_available * 100), 2), 0) AS video_available,
+        IFNULL(ROUND(AVG(annotation_accuracy * 100), 2), 0) AS annotation_accuracy,
+        IFNULL(ROUND(AVG(timing_accuracy * 100), 2), 0) AS timing_accuracy,
+        IFNULL(ROUND(AVG(key_site_online * 100), 2), 0) AS key_site_online,
+        IFNULL(ROUND(AVG(key_video_available * 100), 2), 0) AS key_video_available,
+        IFNULL(ROUND(AVG(key_annotation_accuracy * 100), 2), 0) AS key_annotation_accuracy,
+        IFNULL(ROUND(AVG(key_timing_accuracy * 100), 2), 0) AS key_timing_accuracy,
+        IFNULL(ROUND(AVG(key_command_image_inspection * 100), 2), 0) AS key_command_image_inspection,
+        IFNULL(ROUND(AVG(key_command_image_directory_tree * 100), 2), 0) AS key_command_image_directory_tree,
+        IFNULL(ROUND(AVG(online_inspection_platform * 100), 2), 0) AS online_inspection_platform,
+        IFNULL(ROUND(AVG(video_transmission_assets_accuracy * 100), 2), 0) AS video_transmission_assets_accuracy,
+        IFNULL(ROUND(AVG(video_transmission_assets_weak_password_score * 100), 2), 0) AS video_transmission_assets_weak_password_score,
+        IFNULL(ROUND(AVG(video_transmission_dangerous_assets_score * 100), 2), 0) AS video_transmission_dangerous_assets_score,
+        IFNULL(ROUND(AVG(video_transmission_boundary_integrity_detection * 100), 2), 0) AS video_transmission_boundary_integrity_detection,
+        IFNULL(ROUND(AVG(operating_rate * 100), 2), 0) AS operating_rate,
+        IFNULL(ROUND(AVG(key_command_image_online * 100), 2), 0) AS key_command_image_online
+        FROM
+        t_check_index_video
+        <where>
+            <if test="deptId != null">
+                AND dept_id = #{deptId}
+            </if>
+            <if test="dataScope == 1">
+                AND examine_tag = 1
+            </if>
+        </where>
+        ORDER BY
+        create_time DESC
+        <if test="deptId == null">
+            LIMIT 7
+        </if>
+        <if test="deptId != null">
+            LIMIT 1
+        </if>
+    </select>
 </mapper>

--
Gitblit v1.8.0