fuliqi
2024-09-06 fe8751d252f9ae5710de65586904c46be2134835
Merge remote-tracking branch 'origin/master'
3个文件已修改
595 ■■■■ 已修改文件
ycl-pojo/src/main/java/com/ycl/platform/domain/query/DataCenterQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java 583 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/utils/MongoUtil.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/query/DataCenterQuery.java
@@ -32,6 +32,9 @@
    /** 动态列的表明条件 */
    private String tableName = "t_monitor";
    /** 数据类型:0 全部  1省厅 */
    private Integer dataType = 0;
    public void setTime() {
        if (Objects.nonNull(this.startTime)) {
ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java
@@ -18,6 +18,7 @@
import com.ycl.system.page.PageUtil;
import com.ycl.utils.DateUtils;
import com.ycl.utils.MongoUtil;
import constant.CheckConstants;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections.CollectionUtils;
import org.bson.Document;
@@ -30,6 +31,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -52,6 +54,8 @@
    private final static String TIME_FIELD = "mongoCreateTime";
    private static DecimalFormat DF = new DecimalFormat("#.####");
    /**
     * 视频:点位在线率
@@ -86,7 +90,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(distinctCount + "",onlineRate + "%"));
        map.put("count", Arrays.asList(distinctCount + "",this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -112,7 +116,12 @@
        // 统计数量
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_online");
        Document filter = new Document("deptTag", new Document("$eq", Boolean.TRUE));
        List<Document> dList = new ArrayList<>(2);
        dList.add(new Document("deptTag", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document filter = new Document("$and", dList);
        // 构建聚合管道
        List<Document> pipeline = Arrays.asList(
                // 只要部级的
@@ -131,6 +140,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMinistrySiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -140,7 +150,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(uniqueDeviceIdCount + "", onlineRate + "%"));
        map.put("count", Arrays.asList(uniqueDeviceIdCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -163,7 +173,13 @@
        // 统计数量
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_online");
        Document filter = new Document("importantTag", new Document("$eq", Boolean.TRUE));
        List<Document> dList = new ArrayList<>(2);
        dList.add(new Document("importantTag", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document filter = new Document("$and", dList);
        // 构建聚合管道
        List<Document> pipeline = Arrays.asList(
                new Document("$match", filter),
@@ -182,6 +198,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeySiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -191,7 +208,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(uniqueDeviceIdCount + "", onlineRate + "%"));
        map.put("count", Arrays.asList(uniqueDeviceIdCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -214,7 +231,13 @@
        // 统计数量
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_online");
        Document filter = new Document("importantCommandImageTag", new Document("$eq", Boolean.TRUE));
        List<Document> dList = new ArrayList<>(2);
        dList.add(new Document("importantCommandImageTag", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document filter = new Document("$and", dList);
        // 构建聚合管道
        List<Document> pipeline = Arrays.asList(
                new Document("$match", filter),
@@ -233,6 +256,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyCommandImageOnline)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -242,7 +266,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(uniqueDeviceIdCount + "", onlineRate + "%"));
        map.put("count", Arrays.asList(uniqueDeviceIdCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -266,10 +290,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_monitor_qualify");
        Document ipErrFilter = new Document("ip.error", true);
        Document macdzErrFilter = new Document("macdz.error", true);
        Document latitudeErrFilter = new Document("latitude.error", true);
        Document longitudeErrFilter = new Document("longitude.error", true);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("ip.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("macdz.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("latitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("longitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -293,6 +337,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMonitorRegistration)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -301,7 +346,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -327,10 +372,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_monitor_qualify");
        Document ipErrFilter = new Document("ip.error", true);
        Document macdzErrFilter = new Document("macdz.error", true);
        Document latitudeErrFilter = new Document("latitude.error", true);
        Document longitudeErrFilter = new Document("longitude.error", true);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("ip.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("macdz.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("latitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("longitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -354,6 +419,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMonitorQualification)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -362,7 +428,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -389,10 +455,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_monitor_qualify");
        Document ipErrFilter = new Document("ip.error", true);
        Document macdzErrFilter = new Document("macdz.error", true);
        Document latitudeErrFilter = new Document("latitude.error", true);
        Document longitudeErrFilter = new Document("longitude.error", true);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("ip.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("macdz.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("latitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("longitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -440,7 +526,12 @@
        MongoCollection<Document> collection = database.getCollection("uy_record_meta_d_sum");
        List<Integer> status = Arrays.asList(1, 0, -1);
        List<String> resultCount = status.stream().map(item -> {
            Document filter = new Document("recordStatus", item);
            List<Document> dList = new ArrayList<>(2);
            dList.add(new Document("recordStatus", new Document("$eq", item)));
            if (params.getDataType().equals(1)) {
                dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
            }
            Document filter = new Document("$and", dList);
            // 构建聚合管道
            List<Document> pipeline = Arrays.asList(
                    new Document("$match", filter),
@@ -461,6 +552,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getVideoAvailable)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -469,7 +561,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        resultCount.add(onlineRate + "%");
        resultCount.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", resultCount);
        map.put("list", resultList);
@@ -496,10 +588,13 @@
        MongoCollection<Document> collection = database.getCollection("uy_record_meta_d_sum");
        List<Integer> status = Arrays.asList(1, 0, -1);
        List<String> resultCount = status.stream().map(item -> {
            Document filter = new Document("$and", Arrays.asList(
                    new Document("deptTag", new Document("$eq", Boolean.TRUE)),
                    new Document("recordStatus", item)
            ));
            List<Document> dList = new ArrayList<>(4);
            dList.add(new Document("deptTag", new Document("$eq", Boolean.TRUE)));
            dList.add(new Document("recordStatus",  new Document("$eq", item)));
            if (params.getDataType().equals(1)) {
                dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
            }
            Document filter = new Document("$and", dList);
            // 构建聚合管道
            List<Document> pipeline = Arrays.asList(
                    new Document("$match", filter),
@@ -520,6 +615,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMinistryVideoAvailable)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -528,7 +624,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        resultCount.add(onlineRate + "%");
        resultCount.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", resultCount);
        map.put("list", resultList);
@@ -555,10 +651,13 @@
        MongoCollection<Document> collection = database.getCollection("uy_record_meta_d_sum");
        List<Integer> status = Arrays.asList(1, 0, -1);
        List<String> resultCount = status.stream().map(item -> {
            Document filter = new Document("$and", Arrays.asList(
                    new Document("importantTag", new Document("$eq", Boolean.TRUE)),
                    new Document("recordStatus", item)
            ));
            List<Document> dList = new ArrayList<>(4);
            dList.add(new Document("importantTag", new Document("$eq", Boolean.TRUE)));
            dList.add(new Document("recordStatus", new Document("$eq", item)));
            if (params.getDataType().equals(1)) {
                dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
            }
            Document filter = new Document("$and", dList);
            // 构建聚合管道
            List<Document> pipeline = Arrays.asList(
                    new Document("$match", filter),
@@ -579,6 +678,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyVideoAvailable)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -587,7 +687,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        resultCount.add(onlineRate + "%");
        resultCount.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", resultCount);
        map.put("list", resultList);
@@ -638,11 +738,34 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("osd_check_result");
        Document importantTag = new Document("importantTag", Boolean.TRUE);
        Document osdNameFilter = new Document("$and", Arrays.asList(new Document("osdNameCorrect", 1), importantTag));
        Document osdNameErrFilter = new Document("$and", Arrays.asList(new Document("osdNameCorrect", -1), importantTag));
        Document osdTimeFilter = new Document("$and", Arrays.asList(new Document("osdTimeCorrect", 1), importantTag));
        Document osdTimeErrFilter = new Document("$and", Arrays.asList(new Document("osdTimeCorrect", -1), importantTag));
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("importantTag", Boolean.TRUE));
        dList1.add(new Document("osdNameCorrect", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("importantTag", Boolean.TRUE));
        dList2.add(new Document("osdNameCorrect", new Document("$eq", -1)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("importantTag", Boolean.TRUE));
        dList3.add(new Document("osdTimeCorrect", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("importantTag", Boolean.TRUE));
        dList4.add(new Document("osdTimeCorrect", new Document("$eq", -1)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document osdNameFilter = new Document("$and", dList1);
        Document osdNameErrFilter = new Document("$and", dList2);
        Document osdTimeFilter = new Document("$and", dList3);
        Document osdTimeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(osdNameFilter, osdNameErrFilter, osdTimeFilter, osdTimeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -665,6 +788,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyAnnotationAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -673,7 +797,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -726,9 +850,20 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("osd_check_result");
        Document importantTag = new Document("importantTag", Boolean.TRUE);
        Document osdTimeFilter = new Document("$and", Arrays.asList(new Document("osdTimeCorrect", 1), importantTag));
        Document osdTimeErrFilter = new Document("$and", Arrays.asList(new Document("osdTimeCorrect", -1), importantTag));
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("importantTag", Boolean.TRUE));
        dList1.add(new Document("osdTimeCorrect", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("importantTag", Boolean.TRUE));
        dList2.add(new Document("osdTimeCorrect", new Document("$eq", -1)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document osdTimeFilter = new Document("$and", dList1);
        Document osdTimeErrFilter = new Document("$and", dList2);
        List<Document> lists = Arrays.asList(osdTimeFilter, osdTimeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -751,6 +886,7 @@
        Date now = new Date();
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyTimingAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -759,7 +895,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -786,10 +922,34 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_snapshot_data_monitor");
        Document normalFilter = new Document("resultType", 1);
        Document noDataFilter = new Document("resultType", 2);
        Document trFilter = new Document("resultType", 3);
        Document littleFilter = new Document("resultType", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("importantTag", Boolean.TRUE));
        dList1.add(new Document("resultType", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("importantTag", Boolean.TRUE));
        dList2.add(new Document("resultType", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("importantTag", Boolean.TRUE));
        dList3.add(new Document("resultType", new Document("$eq", 3)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("importantTag", Boolean.TRUE));
        dList4.add(new Document("resultType", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document normalFilter = new Document("$and", dList1);
        Document noDataFilter = new Document("$and", dList2);
        Document trFilter = new Document("$and", dList3);
        Document littleFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(normalFilter, noDataFilter, trFilter, littleFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -812,6 +972,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getViewConnectStability)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -820,7 +981,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -850,6 +1011,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getSiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -859,7 +1021,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(distinctCount + "%", onlineRate + "%"));
        map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -883,11 +1045,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_monitor_qualify");
        Document ipErrFilter = new Document("ip.error", true);
        Document macdzErrFilter = new Document("macdz.error", true);
        Document latitudeErrFilter = new Document("latitude.error", true);
        Document longitudeErrFilter = new Document("longitude.error", true);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("ip.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("macdz.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("latitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("longitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -904,12 +1085,13 @@
                uniqueDeviceIdCount = doc.getInteger("uniqueDeviceIds");
                break; // 不需要继续遍历,因为 $count 只会产生一个结果
            }
            return uniqueDeviceIdCount + "%";
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getDeviceDirectoryConsistent)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -918,7 +1100,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -944,10 +1126,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_cross_detail");
        Document ipErrFilter = new Document("lalType", 1);
        Document macdzErrFilter = new Document("lalType", 2);
        Document latitudeErrFilter = new Document("lalType", 3);
        Document longitudeErrFilter = new Document("lalType", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("lalType", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("lalType", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("lalType", new Document("$eq", 3)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("lalType", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -971,6 +1173,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleInformationCollectionAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -979,7 +1182,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1008,6 +1211,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleCaptureIntegrity)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1018,7 +1222,7 @@
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(onlineRate + "%"));
        map.put("count", Arrays.asList(this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -1041,6 +1245,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleCaptureAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1050,7 +1255,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(onlineRate + "%"));
        map.put("count", Arrays.asList(this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -1075,9 +1280,24 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_vehicle_device_inspection");
        Document ipErrFilter = new Document("snapResult", 1);
        Document macdzErrFilter = new Document("snapResult", 2);
        Document longitudeErrFilter = new Document("snapResult", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("snapResult", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("snapResult", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("snapResult", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document longitudeErrFilter = new Document("$and", dList3);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -1101,6 +1321,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleTimingAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1109,7 +1330,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1135,6 +1356,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleUploadTimeliness)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1144,7 +1366,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(onlineRate + "%"));
        map.put("count", Arrays.asList(this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -1168,6 +1390,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleUrlAvailability)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1177,7 +1400,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(onlineRate + "%"));
        map.put("count", Arrays.asList(this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -1201,6 +1424,7 @@
        Date now = new Date();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehiclePictureAvailability)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1210,7 +1434,7 @@
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(onlineRate + "%"));
        map.put("count", Arrays.asList(this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -1234,10 +1458,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_snapshot_data_monitor");
        Document normalFilter = new Document("resultType", 1);
        Document noDataFilter = new Document("resultType", 2);
        Document trFilter = new Document("resultType", 3);
        Document littleFilter = new Document("resultType", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("resultType", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("resultType", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("resultType", new Document("$eq", 3)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("resultType", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document normalFilter = new Document("$and", dList1);
        Document noDataFilter = new Document("$and", dList2);
        Document trFilter = new Document("$and", dList3);
        Document littleFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(normalFilter, noDataFilter, trFilter, littleFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -1260,6 +1504,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getViewConnectStability)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1268,7 +1513,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1294,10 +1539,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_snapshot_data_monitor");
        Document normalFilter = new Document("resultType", 1);
        Document noDataFilter = new Document("resultType", 2);
        Document trFilter = new Document("resultType", 3);
        Document littleFilter = new Document("resultType", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("resultType", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("resultType", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("resultType", new Document("$eq", 3)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("resultType", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document normalFilter = new Document("$and", dList1);
        Document noDataFilter = new Document("$and", dList2);
        Document trFilter = new Document("$and", dList3);
        Document littleFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(normalFilter, noDataFilter, trFilter, littleFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -1320,6 +1585,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getSiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1328,7 +1594,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1354,11 +1620,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("uy_monitor_qualify");
        Document ipErrFilter = new Document("ip.error", true);
        Document macdzErrFilter = new Document("macdz.error", true);
        Document latitudeErrFilter = new Document("latitude.error", true);
        Document longitudeErrFilter = new Document("longitude.error", true);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("ip.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("macdz.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("latitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("longitude.error", new Document("$eq", Boolean.TRUE)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -1381,6 +1666,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getDeviceDirectoryConsistent)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1389,7 +1675,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1415,11 +1701,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_cross_detail");
        Document ipErrFilter = new Document("lalType", 1);
        Document macdzErrFilter = new Document("lalType", 2);
        Document latitudeErrFilter = new Document("lalType", 3);
        Document longitudeErrFilter = new Document("lalType", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("lalType", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("lalType", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("lalType", new Document("$eq", 3)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("lalType", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
@@ -1442,6 +1747,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFaceInformationCollectionAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1450,7 +1756,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1476,10 +1782,30 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_monitoring_detail");
        Document ipErrFilter = new Document("lalType", 1);
        Document macdzErrFilter = new Document("lalType", 2);
        Document latitudeErrFilter = new Document("lalType", 3);
        Document longitudeErrFilter = new Document("lalType", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("lalType", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("lalType", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("lalType", new Document("$eq", 3)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("lalType", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList4.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document latitudeErrFilter = new Document("$and", dList3);
        Document longitudeErrFilter = new Document("$and", dList4);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, latitudeErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -1503,6 +1829,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFacePictureQualification)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1511,7 +1838,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1537,9 +1864,24 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_vehicle_device_inspection");
        Document ipErrFilter = new Document("snapResult", 1);
        Document macdzErrFilter = new Document("snapResult", 2);
        Document longitudeErrFilter = new Document("snapResult", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("snapResult", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("snapResult", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("snapResult", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document longitudeErrFilter = new Document("$and", dList3);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -1563,6 +1905,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFaceTimingAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1571,7 +1914,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1597,9 +1940,24 @@
        MongoDatabase database = mongoTemplate.getDb();
        MongoCollection<Document> collection = database.getCollection("hk_vehicle_device_inspection");
        Document ipErrFilter = new Document("snapResult", 1);
        Document macdzErrFilter = new Document("snapResult", 2);
        Document longitudeErrFilter = new Document("snapResult", 4);
        List<Document> dList1 = new ArrayList<>(2);
        dList1.add(new Document("snapResult", new Document("$eq", 1)));
        if (params.getDataType().equals(1)) {
            dList1.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList2 = new ArrayList<>(2);
        dList2.add(new Document("snapResult", new Document("$eq", 2)));
        if (params.getDataType().equals(1)) {
            dList2.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        List<Document> dList3 = new ArrayList<>(2);
        dList3.add(new Document("snapResult", new Document("$eq", 4)));
        if (params.getDataType().equals(1)) {
            dList3.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE)));
        }
        Document ipErrFilter = new Document("$and", dList1);
        Document macdzErrFilter = new Document("$and", dList2);
        Document longitudeErrFilter = new Document("$and", dList3);
        List<Document> lists = Arrays.asList(ipErrFilter, macdzErrFilter, longitudeErrFilter);
        List<String> rList = lists.stream().map(filter -> {
@@ -1623,6 +1981,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFaceUploadTimeliness)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1631,7 +1990,7 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        rList.add(onlineRate + "%");
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultList);
@@ -1657,6 +2016,7 @@
        Date now = new Date();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFacePictureAvailability)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
@@ -1665,8 +2025,9 @@
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(onlineRate + "%"));
        map.put("count", Arrays.asList(this.remove0(onlineRate)));
        map.put("list", resultList);
        return Result.ok().data(map).total(total);
    }
@@ -1688,4 +2049,14 @@
        return Result.ok().data(map).total(page.getTotal());
    }
    /**
     * 删除尾部的0
     * @param rate
     * @return
     */
    private String remove0(BigDecimal rate) {
        DF.setDecimalSeparatorAlwaysShown(false);
        return DF.format(rate) + "%";
    }
}
ycl-server/src/main/java/com/ycl/utils/MongoUtil.java
@@ -76,6 +76,12 @@
        // 时间
        Criteria time = Criteria.where(timeFiled).gte(params.getStartTime()).lte(params.getEndTime());
        // 数据类型
        Criteria dType = null;
        if (params.getDataType().equals(1)) {
            dType = Criteria.where("provinceTag").is(Boolean.TRUE);
        }
        // 将查询条件and起来
        Criteria and = new Criteria();
        List<Criteria> qList = new ArrayList<>(3);
@@ -86,6 +92,9 @@
        if (Objects.nonNull(or)) {
            qList.add(or);
        }
        if (Objects.nonNull(dType)) {
            qList.add(dType);
        }
        and.andOperator(qList);
        // 返回查询
        return Query.query(and);