From 86d0558a3b81c12d03a2d90113490e7c5e147c54 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 24 九月 2024 15:27:13 +0800
Subject: [PATCH] 大屏公安部考核数据

---
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml                 |    6 +++
 ycl-server/src/main/java/com/ycl/utils/MongoUtil.java                             |    2 +
 ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml                     |    6 +-
 ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml                       |    4 +
 ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml                    |    6 +++
 ycl-server/src/main/java/com/ycl/task/OsdTask.java                                |    1 
 ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java |    8 +++
 ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java  |   25 ++++++++++--
 ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java |    4 +
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml                |    6 +++
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml               |    6 +++
 ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml                      |   24 ++++++------
 12 files changed, 75 insertions(+), 23 deletions(-)

diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
index 93cfca3..8fd7965 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -538,8 +538,14 @@
         dashboardQuery.setStartTime(DateUtils.getMouthStart(now));
         dashboardQuery.setEndTime(DateUtils.getMouthEnd(now));
         List<CheckScore> dashboard = scoreMapper.dashboard(dashboardQuery);
+        //鍒濆鍖栧悇涓尯鍘挎暟鎹�
         Map<String, Map<String, Object>> resultMap = new HashMap<>();
-
+        for (AreaDeptEnum value : AreaDeptEnum.values()) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("score", 0);
+            resultMap.put(value.getName(), map);
+        }
+        //濉厖鍚勪釜鍖哄幙鏁版嵁
         for (CheckScore checkScore : dashboard) {
             Map<String, Object> map = new HashMap<>();
             map.put("score", checkScore.getScore().setScale(2,RoundingMode.HALF_UP));
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java
index 7d463d4..da8133f 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java
@@ -578,6 +578,8 @@
             dList.add(new Document("recordStatus", new Document("$eq", item)));
             if (params.getDataType().equals(1)) {
                 dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
+            }else if(params.getDataType().equals(2)){
+                dList.add(new Document("deptTag", new Document("$eq", Boolean.TRUE)));
             }
             Document filter = new Document("$and", dList);
             // 鏋勫缓鑱氬悎绠¢亾
@@ -594,7 +596,7 @@
                 uniqueDeviceIdCount = doc.getInteger("uniqueDeviceIds");
                 break; // 涓嶉渶瑕佺户缁亶鍘嗭紝鍥犱负 $count 鍙細浜х敓涓�涓粨鏋�
             }
-            return uniqueDeviceIdCount + "%";
+            return uniqueDeviceIdCount + "";
         }).collect(Collectors.toList());
 
         Date now = new Date();
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
index b89867f..1770465 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
@@ -37,10 +37,7 @@
 import com.ycl.utils.redis.RedisCache;
 import com.ycl.utils.uuid.IdUtils;
 import constant.Constants;
-import enumeration.general.NotifyTypeEnum;
-import enumeration.general.UrgentLevelEnum;
-import enumeration.general.WorkOrderDistributeWayEnum;
-import enumeration.general.WorkOrderStatusEnum;
+import enumeration.general.*;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
@@ -665,7 +662,25 @@
 
     @Override
     public List<WorkOrderRegionVO> workOrderRegion(DashboardQuery dashboardQuery) {
-        return baseMapper.workOrderRegion(dashboardQuery);
+        //鍒濆鍖栨墍鏈夊尯鍩熸暟鎹�
+        List<WorkOrderRegionVO> vos = new ArrayList<>();
+        for (AreaDeptEnum value : AreaDeptEnum.values()) {
+            WorkOrderRegionVO vo = new WorkOrderRegionVO();
+            vo.setArea(value.getName());
+            vo.setDoneNum(0);
+            vo.setTodoNum(0);
+            vos.add(vo);
+        }
+        List<WorkOrderRegionVO> workOrderRegionVOS = baseMapper.workOrderRegion(dashboardQuery);
+        for (WorkOrderRegionVO vo : vos) {
+            for (WorkOrderRegionVO workOrder : workOrderRegionVOS) {
+                //璧嬪��
+                if(vo.getArea().equals(workOrder.getArea())){
+                    BeanUtils.copyProperties(workOrder,vo);
+                }
+            }
+        }
+        return vos;
     }
 
 
diff --git a/ycl-server/src/main/java/com/ycl/task/OsdTask.java b/ycl-server/src/main/java/com/ycl/task/OsdTask.java
index 76e3edd..a847840 100644
--- a/ycl-server/src/main/java/com/ycl/task/OsdTask.java
+++ b/ycl-server/src/main/java/com/ycl/task/OsdTask.java
@@ -130,6 +130,7 @@
     private OsdCheckResult getOsdCheckResult(OSDResult osdResult, TMonitor monitor) {
         OsdCheckResult osdCheckResult = new OsdCheckResult();
         osdCheckResult.setDeviceNo(osdResult.getSerialNumber());
+        osdCheckResult.setNo(osdResult.getSerialNumber());
         osdCheckResult.setIp(monitor.getIp());
         osdCheckResult.setDeviceType(monitor.getCameraFunType());
         osdCheckResult.setCheckTime(osdResult.getCheckTime());
diff --git a/ycl-server/src/main/java/com/ycl/utils/MongoUtil.java b/ycl-server/src/main/java/com/ycl/utils/MongoUtil.java
index 70ea00e..3cff535 100644
--- a/ycl-server/src/main/java/com/ycl/utils/MongoUtil.java
+++ b/ycl-server/src/main/java/com/ycl/utils/MongoUtil.java
@@ -80,6 +80,8 @@
         Criteria dType = null;
         if (params.getDataType().equals(1)) {
             dType = Criteria.where("provinceTag").is(Boolean.TRUE);
+        }else if(params.getDataType().equals(2)){
+            dType = Criteria.where("deptTag").is(Boolean.TRUE);
         }
 
         // 灏嗘煡璇㈡潯浠禷nd璧锋潵
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
index 8472ac5..9e37712 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
@@ -158,8 +158,14 @@
                 AND dept_id = #{deptId}
             </if>
             <if test="dataScope == 1">
+                AND examine_tag = 0
+            </if>
+            <if test="dataScope == 2">
                 AND examine_tag = 1
             </if>
+            <if test="dataScope == 3">
+                AND examine_tag = 2
+            </if>
         </where>
         ORDER BY
             create_time DESC
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
index bad4ffe..66f5c54 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
@@ -149,8 +149,14 @@
                 AND dept_id = #{deptId}
             </if>
             <if test="dataScope == 1">
+                AND examine_tag = 0
+            </if>
+            <if test="dataScope == 2">
                 AND examine_tag = 1
             </if>
+            <if test="dataScope == 3">
+                AND examine_tag = 2
+            </if>
         </where>
         ORDER BY
         create_time DESC
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
index c6d6db9..c66973c 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
@@ -178,8 +178,14 @@
                 AND dept_id = #{deptId}
             </if>
             <if test="dataScope == 1">
+                AND examine_tag = 0
+            </if>
+            <if test="dataScope == 2">
                 AND examine_tag = 1
             </if>
+            <if test="dataScope == 3">
+                AND examine_tag = 2
+            </if>
         </where>
         ORDER BY
         create_time DESC
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
index bd47211..15812fe 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
@@ -212,8 +212,14 @@
         <where>
             s.create_time between #{startTime} and #{endTime}
             <if test="dataScope == 1">
+                AND s.examine_tag = 0
+            </if>
+            <if test="dataScope == 2">
                 AND s.examine_tag = 1
             </if>
+            <if test="dataScope == 3">
+                AND s.examine_tag = 2
+            </if>
         </where>
         GROUP BY s.dept_id
         ORDER BY s.create_time DESC
diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
index b6c5b25..96e1a0f 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -438,8 +438,8 @@
             COUNT(p2.id) AS errorNum,
             COUNT(p1.id) - COUNT(p2.id) AS normalNum
         FROM t_monitor
-        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.important_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
-        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
         WHERE INSTR(camera_fun_type, 1)
         UNION ALL
         SELECT
@@ -448,8 +448,8 @@
             COUNT(p2.id) AS errorNum,
             COUNT(p1.id) - COUNT(p2.id) AS normalNum
         FROM t_monitor
-        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.important_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
-        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = '1' </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = '1' </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
         WHERE INSTR(camera_fun_type, 2)
         UNION ALL
         SELECT
@@ -458,8 +458,8 @@
             COUNT(p2.id) AS errorNum,
             COUNT(p1.id) - COUNT(p2.id) AS normalNum
         FROM t_monitor
-        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.important_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
-        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if>
+        LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.recovery = 1 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if>
         WHERE INSTR(camera_fun_type, 3)
     </select>
     <select id="monitorRate" resultType="com.ycl.platform.domain.vo.screen.MonitorRateVO">
@@ -475,8 +475,8 @@
                     COUNT(m2.id) AS faceErrorNum
                 FROM
                     sys_dept d
-                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.important_tag = 1 </if>
-                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if>
+                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
+                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
                         LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 3)
                         LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 3)
                 WHERE d.del_flag = 0 AND d.area IS NOT NULL
@@ -493,8 +493,8 @@
                     COUNT(m2.id) AS carErrorNum
                 FROM
                     sys_dept d
-                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.important_tag = 1 </if>
-                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if>
+                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
+                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
                         LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 2)
                         LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 2)
                 WHERE d.del_flag = 0 AND d.area IS NOT NULL
@@ -511,8 +511,8 @@
                     COUNT(m2.id) AS videoErrorNum
                 FROM
                     sys_dept d
-                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.important_tag = 1 </if>
-                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.important_tag = 1 </if>
+                        LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if>
+                        LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.recovery = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if>
                         LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 1)
                         LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 1)
                 WHERE d.del_flag = 0 AND d.area IS NOT NULL
diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
index 3be2778..57d8df7 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
@@ -209,7 +209,7 @@
         LEFT JOIN t_yw_point p ON w.serial_number = p.serial_number AND p.deleted = 0
         WHERE w.deleted = 0
         <if test="dataScope == 1"> AND p.province_tag = 1 </if>
-        <if test="dataScope == 3"> AND p.important_tag = 1 </if>
+        <if test="dataScope == 3"> AND p.dept_tag = 1 </if>
         <if test="deptId != null"> AND p.dept_id = #{deptId} </if>
     </select>
 
@@ -224,10 +224,10 @@
         LEFT JOIN t_work_order w ON w.serial_number = p.serial_number AND w.deleted = 0
         WHERE d.del_flag = 0 AND d.area IS NOT NULL
         <if test="dataScope == 1"> AND p.province_tag = 1 </if>
-        <if test="dataScope == 3"> AND p.important_tag = 1 </if>
+        <if test="dataScope == 3"> AND p.dept_tag = 1 </if>
         <!-- <if test="deptId != null"> AND p.dept_id = #{deptId} </if> -->
         GROUP BY d.area, d.dept_id
-        ORDER BY d.dept_id
+        ORDER BY d.area_code
     </select>
 
     <select id="hasErrorWorkOrderList" resultType="com.ycl.platform.domain.vo.DeviceInfoVO">
diff --git a/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
index 34b5f19..946239a 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
@@ -61,13 +61,15 @@
         FROM
              t_yw_point p INNER JOIN t_monitor m ON p.serial_number = m.serial_number
         <where>
-            AND p.create_time between #{query.startTime} and #{query.endTime}
             <if test="query.keyword != null and query.keyword != ''">
                 AND (m.name like concat('%', #{query.keyword}, '%') OR m.serial_number like concat('%', #{query.keyword}, '%'))
             </if>
             <if test="query.dataType == 1">
                 AND p.province_tag = 1
             </if>
+            <if test="query.dataType == 2">
+                AND p.dept_tag = 1
+            </if>
             <choose>
                 <when test="query.deptTag == 1">
                     AND p.dept_tag = 1

--
Gitblit v1.8.0