fuliqi
2025-02-13 9963456cd3d9737ecf53ebc1f464df29fd9398e6
数据中心概率调整
2个文件已修改
802 ■■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java 798 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/utils/CheckPointUtil.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java
@@ -26,6 +26,7 @@
import com.ycl.system.page.PageUtil;
import com.ycl.utils.DateUtils;
import com.ycl.utils.MongoUtil;
import com.ycl.utils.StringUtils;
import com.ycl.utils.bean.BeanUtils;
import com.ycl.utils.poi.ExcelUtil;
import constant.ApiConstants;
@@ -159,20 +160,24 @@
            onlineCount = (Integer) result.getOrDefault("onlineCount", 0L);
            totalCount = offlineCount + unknownCount + onlineCount;
        }
        /** 查询当天在线率 */
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getSiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount!=0) {
            onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
//        /** 查询当天在线率 */
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getSiteOnline)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
//                .list();
//
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
//            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(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
@@ -254,21 +259,24 @@
            onlineCount = (Integer) result.getOrDefault("onlineCount", 0L);
            totalCount = offlineCount + unknownCount + onlineCount;
        }
        params.setDeptTag(1);
        params.setDeviceType(1);
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMinistrySiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistrySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount!=0) {
            onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
//        params.setDeptTag(1);
//        params.setDeviceType(1);
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getMinistrySiteOnline)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistrySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
//            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(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
@@ -352,18 +360,22 @@
            onlineCount = (Integer) result.getOrDefault("onlineCount", 0L);
            totalCount = offlineCount + unknownCount + onlineCount;
        }
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeySiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount!=0) {
            onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getKeySiteOnline)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
//            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(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
@@ -448,19 +460,22 @@
            onlineCount = (Integer) result.getOrDefault("onlineCount", 0L);
            totalCount = offlineCount + unknownCount + onlineCount;
        }
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyCommandImageOnline)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyCommandImageOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount!=0) {
            onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getKeyCommandImageOnline)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime())
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyCommandImageOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
//            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(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
@@ -528,19 +543,23 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMonitorRegistration)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorRegistration).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getMonitorRegistration)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorRegistration).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal rate = BigDecimal.ZERO;
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            rate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        rList.add(this.remove0(rate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
        map.put("list", resultVOS);
@@ -666,19 +685,22 @@
            }
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMonitorQualification)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorQualification).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getMonitorQualification)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorQualification).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
@@ -691,6 +713,7 @@
     * 档案留存总量:mongo存的所有去重后的档案
     * 当日档案:当日的档案
     * 档案考核比 = 当日档案/档案留存总量
     *
     * @param params
     * @return1
     */
@@ -743,19 +766,22 @@
            }
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getArchivesRate)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getArchivesRate).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getArchivesRate)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getArchivesRate).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", rList);
@@ -811,18 +837,18 @@
            }
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getVideoAvailable)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getVideoAvailable)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        //加一个总数
        int totalCount = 0;
        for (String s : resultCount) {
@@ -830,6 +856,10 @@
        }
        resultCount.add(0, totalCount + "");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (!StringUtils.isEmpty(resultCount.get(0)) && !"0".equals(resultCount.get(0))) {
            onlineRate = new BigDecimal(resultCount.get(1)).divide(new BigDecimal(resultCount.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        resultCount.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -888,24 +918,28 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getMinistryVideoAvailable)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistryVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getMinistryVideoAvailable)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistryVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        //加一个总数
        int totalCount = 0;
        for (String s : resultCount) {
            totalCount += Integer.parseInt(s);
        }
        resultCount.add(0, totalCount + "");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (!StringUtils.isEmpty(resultCount.get(0)) && !"0".equals(resultCount.get(0))) {
            onlineRate = new BigDecimal(resultCount.get(1)).divide(new BigDecimal(resultCount.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        resultCount.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", resultCount);
@@ -963,24 +997,28 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyVideoAvailable)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getKeyVideoAvailable)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        //加一个总数
        int totalCount = 0;
        for (String s : resultCount) {
            totalCount += Integer.parseInt(s);
        }
        resultCount.add(0, totalCount + "");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (!StringUtils.isEmpty(resultCount.get(0)) && !"0".equals(resultCount.get(0))) {
            onlineRate = new BigDecimal(resultCount.get(1)).divide(new BigDecimal(resultCount.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        resultCount.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", resultCount);
@@ -1131,17 +1169,21 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyAnnotationAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getKeyAnnotationAccuracy)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyAnnotationAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyAnnotationAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -1211,7 +1253,7 @@
    }
    /**
     * 视频:校时正确率
     * 视频:校时正确率(停用)
     *
     * @param params
     * @return
@@ -1330,17 +1372,21 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
                .select(CheckIndexVideo::getKeyTimingAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper())
//                .select(CheckIndexVideo::getKeyTimingAccuracy)
//                .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -1389,10 +1435,19 @@
        dList3.add(new Document("resultType", new Document("$eq", 2)));
        dList3.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR)));
        setTag(params, dList3);
        Document noDataFilter = new Document("$and", dList2);
        Document trFilter = new Document("$and", dList3);
        List<Document> lists = Arrays.asList(noDataFilter, trFilter);
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("resultType", new Document("$eq", 3)));
        dList4.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR)));
        setTag(params, dList4);
        List<Document> dList5 = new ArrayList<>(2);
        dList5.add(new Document("resultType", new Document("$eq", 4)));
        dList5.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR)));
        setTag(params, dList5);
        Document normalFilter = new Document("$and", dList2);
        Document noDataFilter = new Document("$and", dList3);
        Document downFilter = new Document("$and", dList4);
        Document lessFilter = new Document("$and", dList5);
        List<Document> lists = Arrays.asList(normalFilter, noDataFilter,downFilter,lessFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
            List<Document> pipeline = Arrays.asList(
@@ -1426,17 +1481,26 @@
            dataCount = doc.getInteger("dataCount");
        }
        rList.add(0,dataCount+"");
        List<CheckIndexCar> carList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getViewConnectStability)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexCar> carList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getViewConnectStability)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(carList)) {
//            BigDecimal sum = carList.stream().map(CheckIndexCar::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(carList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal normal = new BigDecimal(rList.get(1));
        BigDecimal noData = new BigDecimal(rList.get(2));
        BigDecimal down = new BigDecimal(rList.get(3));
        BigDecimal less = new BigDecimal(rList.get(4));
        BigDecimal totalCount = normal.add(noData).add(down).add(less);
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(carList)) {
            BigDecimal sum = carList.stream().map(CheckIndexCar::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(carList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount.compareTo(BigDecimal.ZERO)>0) {
            onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -1535,17 +1599,21 @@
            totalCount = offlineCount + unknownCount + onlineCount;
        }
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getSiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getSiteOnline)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount!=0) {
            onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate)));
@@ -1619,17 +1687,21 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getDeviceDirectoryConsistent)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getDeviceDirectoryConsistent)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -1709,17 +1781,21 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleInformationCollectionAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getVehicleInformationCollectionAccuracy)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -1777,22 +1853,26 @@
            mainNoIntegrityCount = doc.getInteger("mainNoIntegrityCount");
        }
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleCaptureIntegrity)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureIntegrity).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getVehicleCaptureIntegrity)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureIntegrity).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        List<String> countList = new ArrayList<>();
        countList.add(dataCount+"");
        countList.add(noIntegrityCount+"");
        countList.add(mainNoIntegrityCount+"");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (dataCount!=0) {
            onlineRate = new BigDecimal(dataCount-noIntegrityCount).divide(new BigDecimal(dataCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        countList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", countList);
@@ -1848,23 +1928,27 @@
            importantDiffCount = doc.getInteger("importantDiffCount");
        }
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleCaptureAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getVehicleCaptureAccuracy)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        List<String> countList = new ArrayList<>();
        countList.add(sampleCount+"");
        countList.add(majorDiffCount+"");
        countList.add(importantDiffCount+"");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (sampleCount!=0) {
            onlineRate = new BigDecimal(sampleCount-majorDiffCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        countList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", countList);
@@ -1940,17 +2024,24 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleTimingAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getVehicleTimingAccuracy)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        BigDecimal normal = new BigDecimal(rList.get(0));
        BigDecimal abnormal = new BigDecimal(rList.get(1));
        BigDecimal totalCount = normal.add(abnormal);
        if (totalCount.compareTo(BigDecimal.ZERO)>0) {
            onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -2016,17 +2107,21 @@
        }).collect(Collectors.toList());
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehicleUploadTimeliness)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getVehicleUploadTimeliness)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -2148,20 +2243,24 @@
            expCount = doc.getInteger("expCount");
        }
        List<String> countList = new ArrayList<>();
        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
                .select(CheckIndexCar::getVehiclePictureAvailability)
                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehiclePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper())
//                .select(CheckIndexCar::getVehiclePictureAvailability)
//                .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehiclePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        countList.add(sampleCount+"");
        countList.add(expCount+"");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (sampleCount!=0) {
            onlineRate = new BigDecimal(sampleCount-expCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        countList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", countList);
@@ -2209,9 +2308,19 @@
        dList3.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR)));
        setTag(params, dList3);
        Document noDataFilter = new Document("$and", dList2);
        Document trFilter = new Document("$and", dList3);
        List<Document> lists = Arrays.asList(noDataFilter, trFilter);
        List<Document> dList4 = new ArrayList<>(2);
        dList4.add(new Document("resultType", new Document("$eq", 3)));
        dList4.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR)));
        setTag(params, dList4);
        List<Document> dList5 = new ArrayList<>(2);
        dList5.add(new Document("resultType", new Document("$eq", 4)));
        dList5.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR)));
        setTag(params, dList5);
        Document normalFilter = new Document("$and", dList2);
        Document noDataFilter = new Document("$and", dList3);
        Document downFilter = new Document("$and", dList4);
        Document lessFilter = new Document("$and", dList5);
        List<Document> lists = Arrays.asList(normalFilter, noDataFilter,downFilter,lessFilter);
        List<String> rList = lists.stream().map(filter -> {
            // 构建聚合管道
            List<Document> pipeline = Arrays.asList(
@@ -2246,17 +2355,26 @@
            dataCount = doc.getInteger("dataCount");
        }
        rList.add(0,dataCount+"");
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getViewConnectStability)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getViewConnectStability)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal normal = new BigDecimal(rList.get(1));
        BigDecimal noData = new BigDecimal(rList.get(2));
        BigDecimal down = new BigDecimal(rList.get(3));
        BigDecimal less = new BigDecimal(rList.get(4));
        BigDecimal totalCount = normal.add(noData).add(down).add(less);
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount.compareTo(BigDecimal.ZERO)>0) {
            onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -2353,19 +2471,22 @@
            onlineCount = (Integer) result.getOrDefault("onlineCount", 0L);
            totalCount = offlineCount + unknownCount + onlineCount;
        }
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getSiteOnline)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, params.getStartTime(), params.getEndTime())
                .list();
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getSiteOnline)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, params.getStartTime(), params.getEndTime())
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (totalCount!=0) {
            onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate)));
        map.put("list", resultList);
@@ -2438,17 +2559,21 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getDeviceDirectoryConsistent)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getDeviceDirectoryConsistent)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -2528,17 +2653,21 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFaceInformationCollectionAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getFaceInformationCollectionAccuracy)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -2596,20 +2725,24 @@
        }
        List<String> countList = new ArrayList<>();
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFacePictureQualification)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureQualification).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getFacePictureQualification)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureQualification).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        countList.add(sampleCount+"");
        countList.add(expCount+"");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (sampleCount!=0) {
            onlineRate = new BigDecimal(sampleCount-expCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        countList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", countList);
@@ -2686,17 +2819,24 @@
            return uniqueDeviceIdCount + "";
        }).collect(Collectors.toList());
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFaceTimingAccuracy)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getFaceTimingAccuracy)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        BigDecimal normal = new BigDecimal(rList.get(0));
        BigDecimal abnormal = new BigDecimal(rList.get(1));
        BigDecimal totalCount = normal.add(abnormal);
        if (totalCount.compareTo(BigDecimal.ZERO)>0) {
            onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -2762,17 +2902,21 @@
        }).collect(Collectors.toList());
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFaceUploadTimeliness)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getFaceUploadTimeliness)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) {
            onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        rList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
@@ -2830,20 +2974,24 @@
        List<String> countList = new ArrayList<>();
        // 统计数
        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
                .select(CheckIndexFace::getFacePictureAvailability)
                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
                .list();
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (CollectionUtils.isNotEmpty(videoList)) {
            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add);
            BigDecimal count = BigDecimal.valueOf(videoList.size());
            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
        }
//        List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper())
//                .select(CheckIndexFace::getFacePictureAvailability)
//                .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province)
//                .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept)
//                .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime()))
//                .list();
//        BigDecimal onlineRate = BigDecimal.ZERO;
//        if (CollectionUtils.isNotEmpty(videoList)) {
//            BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add);
//            BigDecimal count = BigDecimal.valueOf(videoList.size());
//            onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
//        }
        countList.add(sampleCount+"");
        countList.add(expCount+"");
        BigDecimal onlineRate = BigDecimal.ZERO;
        if (sampleCount!=0) {
            onlineRate = new BigDecimal(sampleCount-expCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100"));
        }
        countList.add(this.remove0(onlineRate));
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", countList);
ycl-server/src/main/java/com/ycl/utils/CheckPointUtil.java
@@ -61,7 +61,6 @@
            res = selfHttpUtil.get(prefix + monitor.getIp(), null, null);
            monitor.setPingOnline(Objects.nonNull(res) && HttpStatus.OK == res.getStatusCode());
        } catch (Exception e) {
            log.error("web检测离线"+monitor.getIp());
            monitor.setPingOnline(Boolean.FALSE);
        }
        // 如果http得到的不在线,那么再ping一下
@@ -87,7 +86,6 @@
        }
        if (!monitor.getPingOnline()) {
            reachable = checkPing(monitor, reachable);
            if(!reachable) log.error("ping检测离线"+monitor.getIp());
            monitor.setPingOnline(reachable);
        }
        if (!monitor.getPingOnline()) {
@@ -130,7 +128,7 @@
                Thread.sleep(sleepTime);
            }
        } catch (Exception e) {
            log.error("Ping异常{}",e.getMessage());
            log.error("Ping异常",e);
        }
        return reachable;
    }