| | |
| | | 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; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | |
| | | private final static String TIME_FIELD = "mongoCreateTime"; |
| | | |
| | | private static DecimalFormat DF = new DecimalFormat("#.####"); |
| | | |
| | | /** |
| | | * 视频:点位在线率 |
| | |
| | | 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); |
| | | } |
| | |
| | | // 统计数量 |
| | | 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( |
| | | // 只要部级的 |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | // 统计数量 |
| | | 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), |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | // 统计数量 |
| | | 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), |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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 -> { |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | |
| | | 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), |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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), |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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), |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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 -> { |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | return Result.ok().data(map).total(page.getTotal()); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除尾部的0 |
| | | * @param rate |
| | | * @return |
| | | */ |
| | | private String remove0(BigDecimal rate) { |
| | | DF.setDecimalSeparatorAlwaysShown(false); |
| | | return DF.format(rate) + "%"; |
| | | } |
| | | } |