fuliqi
2024-09-24 86d0558a3b81c12d03a2d90113490e7c5e147c54
大屏公安部考核数据
12个文件已修改
98 ■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/OsdTask.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/utils/MongoUtil.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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));
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();
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;
    }
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());
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);
        }
        // 将查询条件and起来
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
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
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
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
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
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">
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