| | |
| | | import com.ycl.platform.domain.entity.*; |
| | | import com.ycl.platform.domain.query.DataCenterQuery; |
| | | import com.ycl.platform.domain.result.HK.*; |
| | | import com.ycl.platform.domain.result.SYS.TMonitorResult; |
| | | import com.ycl.platform.domain.result.UY.*; |
| | | import com.ycl.platform.domain.vo.PointDetailVO; |
| | | import com.ycl.platform.mapper.ImageResourceSecurityDetailMapper; |
| | | import com.ycl.platform.mapper.YwPointMapper; |
| | | import com.ycl.platform.service.*; |
| | |
| | | */ |
| | | @Override |
| | | public Result videoPointOnlineRate(DataCenterQuery params) { |
| | | // 生成查询 |
| | | List<String> likeFileds = Arrays.asList("arealayerName", "ipAddr", "deviceName", "deviceId"); |
| | | List<String> likeFileds = Arrays.asList("name", "no", "ip"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, null); |
| | | |
| | | // 先查总数再分页 |
| | | long total = mongoTemplate.count(query, VideoOnlineResult.class); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<VideoOnlineResult> resultList = mongoTemplate.find(query, VideoOnlineResult.class); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | resultList.forEach(item -> { |
| | | if (null != item.getPingOnline() && item.getPingOnline()) { |
| | | item.setPingOnlineStr("在线"); |
| | | } else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | if(1== item.getOnline() ){ |
| | | item.setOnlineStr("在线"); |
| | | }else if(-1==item.getOnline()){ |
| | | item.setOnlineStr("离线"); |
| | | }else { |
| | | item.setOnlineStr("未知"); |
| | | } |
| | | }); |
| | | params.setDeptTag(-1); |
| | | params.setDeviceType(1); |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | | // 统计数量 |
| | | MongoDatabase database = mongoTemplate.getDb(); |
| | | MongoCollection<Document> collection = database.getCollection("uy_online"); |
| | | long distinctCount = collection.distinct("deviceId", String.class).into(new ArrayList<>()).size(); |
| | | Date now = new Date(); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getSiteOnline) |
| | |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(distinctCount + "",this.remove0(onlineRate))); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public Result deptVideoPointOnlineRate(DataCenterQuery params) { |
| | | |
| | | List<String> likeFileds = Arrays.asList("arealayerName", "ipAddr", "deviceName", "deviceId"); |
| | | // 生成查询 |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, 1); |
| | | |
| | | // 先查总数再分页 |
| | | long total = mongoTemplate.count(query, VideoOnlineResult.class); |
| | | List<String> likeFileds = Arrays.asList("name", "no", "ip"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<VideoOnlineResult> resultList = mongoTemplate.find(query, VideoOnlineResult.class); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | resultList.forEach(item -> { |
| | | if (null != item.getPingOnline() && item.getPingOnline()) { |
| | | item.setPingOnlineStr("在线"); |
| | | } else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | if (1 == item.getOnline()) { |
| | | item.setOnlineStr("在线"); |
| | | } else if (-1 == item.getOnline()) { |
| | | item.setOnlineStr("离线"); |
| | | } else { |
| | | item.setOnlineStr("未知"); |
| | | } |
| | | }); |
| | | // 统计设备数量 |
| | | params.setDeptTag(1); |
| | | params.setDeviceType(1); |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | | // 统计数量 |
| | | MongoDatabase database = mongoTemplate.getDb(); |
| | | MongoCollection<Document> collection = database.getCollection("uy_online"); |
| | | 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( |
| | | // 只要部级的 |
| | | new Document("$match", filter), |
| | | // $group 去重 |
| | | new Document("$group", new Document("_id", "$deviceId")), |
| | | new Document("$count", "uniqueDeviceIds") |
| | | ); |
| | | // 执行聚合查询并获取结果 |
| | | AggregateIterable<Document> result = collection.aggregate(pipeline); |
| | | Integer uniqueDeviceIdCount = 0; |
| | | for (Document doc : result) { |
| | | uniqueDeviceIdCount = doc.getInteger("uniqueDeviceIds"); |
| | | break; // 不需要继续遍历,因为 $count 只会产生一个结果 |
| | | } |
| | | Date now = new Date(); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getMinistrySiteOnline) |
| | |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(uniqueDeviceIdCount + "", this.remove0(onlineRate))); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public Result videoImportantPointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("arealayerName", "ipAddr", "deviceName", "deviceId"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, 3); |
| | | |
| | | long total = mongoTemplate.count(query, VideoOnlineResult.class); |
| | | List<String> likeFileds = Arrays.asList("name", "no", "ip"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<VideoOnlineResult> resultList = mongoTemplate.find(query, VideoOnlineResult.class); |
| | | |
| | | // 统计数量 |
| | | MongoDatabase database = mongoTemplate.getDb(); |
| | | MongoCollection<Document> collection = database.getCollection("uy_online"); |
| | | |
| | | 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), |
| | | // $group 去重 |
| | | new Document("$group", new Document("_id", "$deviceId")), |
| | | new Document("$count", "uniqueDeviceIds") |
| | | ); |
| | | // 执行聚合查询并获取结果 |
| | | AggregateIterable<Document> result = collection.aggregate(pipeline); |
| | | Integer uniqueDeviceIdCount = 0; |
| | | for (Document doc : result) { |
| | | uniqueDeviceIdCount = doc.getInteger("uniqueDeviceIds"); |
| | | break; // 不需要继续遍历,因为 $count 只会产生一个结果 |
| | | } |
| | | |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | params.setDeptTag(3); |
| | | params.setDeviceType(1); |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | resultList.forEach(item -> { |
| | | if (null != item.getPingOnline() && item.getPingOnline()) { |
| | | item.setPingOnlineStr("在线"); |
| | | } else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | if (1 == item.getOnline()) { |
| | | item.setOnlineStr("在线"); |
| | | } else if (-1 == item.getOnline()) { |
| | | item.setOnlineStr("离线"); |
| | | } else { |
| | | item.setOnlineStr("未知"); |
| | | } |
| | | }); |
| | | Date now = new Date(); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeySiteOnline) |
| | |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(uniqueDeviceIdCount + "", this.remove0(onlineRate))); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public Result videoImportantPointImageOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("arealayerName", "ipAddr", "deviceName", "deviceId"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, 4); |
| | | |
| | | long total = mongoTemplate.count(query, VideoOnlineResult.class); |
| | | List<String> likeFileds = Arrays.asList("name", "no", "ip"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<VideoOnlineResult> resultList = mongoTemplate.find(query, VideoOnlineResult.class); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | |
| | | // 统计数量 |
| | | MongoDatabase database = mongoTemplate.getDb(); |
| | | MongoCollection<Document> collection = database.getCollection("uy_online"); |
| | | |
| | | 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), |
| | | // $group 去重 |
| | | new Document("$group", new Document("_id", "$deviceId")), |
| | | new Document("$count", "uniqueDeviceIds") |
| | | ); |
| | | // 执行聚合查询并获取结果 |
| | | AggregateIterable<Document> result = collection.aggregate(pipeline); |
| | | Integer uniqueDeviceIdCount = 0; |
| | | for (Document doc : result) { |
| | | uniqueDeviceIdCount = doc.getInteger("uniqueDeviceIds"); |
| | | break; // 不需要继续遍历,因为 $count 只会产生一个结果 |
| | | } |
| | | |
| | | params.setDeptTag(4); |
| | | params.setDeviceType(1); |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | resultList.forEach(item -> { |
| | | if (null != item.getPingOnline() && item.getPingOnline()) { |
| | | item.setPingOnlineStr("在线"); |
| | | } else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | if (1 == item.getOnline()) { |
| | | item.setOnlineStr("在线"); |
| | | } else if (-1 == item.getOnline()) { |
| | | item.setOnlineStr("离线"); |
| | | } else { |
| | | item.setOnlineStr("未知"); |
| | | } |
| | | }); |
| | | Date now = new Date(); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeyCommandImageOnline) |
| | |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(uniqueDeviceIdCount + "", this.remove0(onlineRate))); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | */ |
| | | @Override |
| | | public Result videoAssessmentFileRatio(DataCenterQuery params) { |
| | | // TODO 新增一张表记录每次的档案考核 |
| | | List<String> likeFileds = Arrays.asList("ip.showValue", "name.showValue", "serialNumber.showValue"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, null); |
| | | |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | @Override |
| | | public Result videoAvailabilityRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("deviceId", "deviceName"); |
| | | Query query = MongoUtil.getQuery(params,"createTime", likeFileds, null); |
| | | Query query = MongoUtil.getQuery(params, "createTime", likeFileds, null); |
| | | |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | MongoUtil.setPage(query, params, "createTime"); |
| | |
| | | List<String> resultCount = status.stream().map(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))); |
| | | } |
| | | setTag(params, dList); |
| | | Document filter = new Document("$and", dList); |
| | | // 构建聚合管道 |
| | | List<Document> pipeline = Arrays.asList( |
| | |
| | | @Override |
| | | public Result deptVideoAvailabilityRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("deviceId", "deviceName"); |
| | | Query query = MongoUtil.getQuery(params,"createTime", likeFileds, 1); |
| | | Query query = MongoUtil.getQuery(params, "createTime", likeFileds, 1); |
| | | |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | MongoUtil.setPage(query, params, "createTime"); |
| | |
| | | List<String> resultCount = status.stream().map(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))); |
| | | } |
| | | dList.add(new Document("recordStatus", new Document("$eq", item))); |
| | | setTag(params, dList); |
| | | Document filter = new Document("$and", dList); |
| | | // 构建聚合管道 |
| | | List<Document> pipeline = Arrays.asList( |
| | |
| | | @Override |
| | | public Result videoImportantPointAvailabilityRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("deviceId", "deviceName"); |
| | | Query query = MongoUtil.getQuery(params,"createTime", likeFileds, 3); |
| | | Query query = MongoUtil.getQuery(params, "createTime", likeFileds, 3); |
| | | |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | MongoUtil.setPage(query, params, "createTime"); |
| | |
| | | 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))); |
| | | } |
| | | setTag(params, dList); |
| | | Document filter = new Document("$and", dList); |
| | | // 构建聚合管道 |
| | | List<Document> pipeline = Arrays.asList( |
| | |
| | | uniqueDeviceIdCount = doc.getInteger("uniqueDeviceIds"); |
| | | break; // 不需要继续遍历,因为 $count 只会产生一个结果 |
| | | } |
| | | return uniqueDeviceIdCount + "%"; |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | Date now = new Date(); |
| | |
| | | @Override |
| | | public Result videoImportantPointLabelingAccuracy(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("deviceNo", "osdName"); |
| | | Query query = MongoUtil.getQuery(params,"checkTime", likeFileds, 3); |
| | | Query query = MongoUtil.getQuery(params, "checkTime", likeFileds, 3); |
| | | |
| | | long total = mongoTemplate.count(query, OsdCheckResult.class); |
| | | MongoUtil.setPage(query, params, "checkTime"); |
| | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document osdNameFilter = new Document("$and", dList1); |
| | | Document osdNameErrFilter = new Document("$and", dList2); |
| | | Document osdTimeFilter = new Document("$and", dList3); |
| | |
| | | public Result videoImportantPointCheckTimeAccuracy(DataCenterQuery params) { |
| | | |
| | | List<String> likeFileds = Arrays.asList("deviceNo", "osdName"); |
| | | Query query = MongoUtil.getQuery(params,"checkTime", likeFileds, 3); |
| | | Query query = MongoUtil.getQuery(params, "checkTime", likeFileds, 3); |
| | | |
| | | long total = mongoTemplate.count(query, OsdCheckResult.class); |
| | | MongoUtil.setPage(query, params, "checkTime"); |
| | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | Document osdTimeFilter = new Document("$and", dList1); |
| | | Document osdTimeErrFilter = new Document("$and", dList2); |
| | | List<Document> lists = Arrays.asList(osdTimeFilter, osdTimeErrFilter); |
| | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document normalFilter = new Document("$and", dList1); |
| | | Document noDataFilter = new Document("$and", dList2); |
| | | Document trFilter = new Document("$and", dList3); |
| | |
| | | */ |
| | | @Override |
| | | public Result vehiclePointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("externalIndexCode", "deviceName"); |
| | | List<String> likeFileds = Arrays.asList("name", "no", "ip"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, null); |
| | | |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); |
| | | |
| | | // 统计数量 |
| | | MongoDatabase database = mongoTemplate.getDb(); |
| | | MongoCollection<Document> collection = database.getCollection("hk_snapshot_data_monitor"); |
| | | long distinctCount = collection.distinct("externalIndexCode", String.class).into(new ArrayList<>()).size(); |
| | | |
| | | Date now = new Date(); |
| | | //系统ping的结果 |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | params.setDeptTag(-1); |
| | | params.setDeviceType(2); |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | resultList.forEach(item -> { |
| | | if (null != item.getPingOnline() && item.getPingOnline()) { |
| | | item.setPingOnlineStr("在线"); |
| | | } else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | if (1 == item.getOnline()) { |
| | | item.setOnlineStr("在线"); |
| | | } else if (-1 == item.getOnline()) { |
| | | item.setOnlineStr("离线"); |
| | | } else { |
| | | item.setOnlineStr("未知"); |
| | | } |
| | | }); |
| | | 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)) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document longitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document normalFilter = new Document("$and", dList1); |
| | | Document noDataFilter = new Document("$and", dList2); |
| | | Document trFilter = new Document("$and", dList3); |
| | |
| | | */ |
| | | @Override |
| | | public Result facePointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("externalIndexCode", "deviceName"); |
| | | List<String> likeFileds = Arrays.asList("name", "no", "ip"); |
| | | Query query = MongoUtil.getQuery(params, TIME_FIELD, likeFileds, null); |
| | | |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); |
| | | |
| | | // 统计数量 |
| | | MongoDatabase database = mongoTemplate.getDb(); |
| | | MongoCollection<Document> collection = database.getCollection("hk_snapshot_data_monitor"); |
| | | |
| | | 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 -> { |
| | | // 构建聚合管道 |
| | | List<Document> pipeline = Arrays.asList( |
| | | new Document("$match", filter), |
| | | // $group 去重 |
| | | new Document("$group", new Document("_id", "$externalIndexCode")), |
| | | new Document("$count", "uniqueDeviceIds") |
| | | ); |
| | | // 执行聚合查询并获取结果 |
| | | AggregateIterable<Document> result = collection.aggregate(pipeline); |
| | | Integer uniqueDeviceIdCount = 0; |
| | | for (Document doc : result) { |
| | | uniqueDeviceIdCount = doc.getInteger("uniqueDeviceIds"); |
| | | break; // 不需要继续遍历,因为 $count 只会产生一个结果 |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | resultList.forEach(item -> { |
| | | if (null != item.getPingOnline() && item.getPingOnline()) { |
| | | item.setOnlineStr("在线"); |
| | | } else { |
| | | item.setOnlineStr("离线"); |
| | | } |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | if (1 == item.getOnline()) { |
| | | item.setOnlineStr("在线"); |
| | | } else if (-1 == item.getOnline()) { |
| | | item.setOnlineStr("离线"); |
| | | } else { |
| | | item.setOnlineStr("未知"); |
| | | } |
| | | }); |
| | | params.setDeptTag(-1); |
| | | params.setDeviceType(3); |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | | Date now = new Date(); |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | List<String> rList = new ArrayList<>(2); |
| | | rList.add(distinctCount + ""); |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", rList); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | 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))); |
| | | } |
| | | setTag(params, dList4); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document latitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document longitudeErrFilter = new Document("$and", dList3); |
| | |
| | | |
| | | 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))); |
| | | } |
| | | setTag(params, dList1); |
| | | 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))); |
| | | } |
| | | setTag(params, dList2); |
| | | 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))); |
| | | } |
| | | setTag(params, dList3); |
| | | Document ipErrFilter = new Document("$and", dList1); |
| | | Document macdzErrFilter = new Document("$and", dList2); |
| | | Document longitudeErrFilter = new Document("$and", dList3); |
| | |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | | |
| | | /** |
| | | * 视频:视频图像资源安全管理 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 删除尾部的0 |
| | | * |
| | | * @param rate |
| | | * @return |
| | | */ |
| | |
| | | DF.setDecimalSeparatorAlwaysShown(false); |
| | | return DF.format(rate) + "%"; |
| | | } |
| | | |
| | | /** |
| | | * 设置标签搜索条件 |
| | | * |
| | | * @param params |
| | | * @param dList |
| | | */ |
| | | private void setTag(DataCenterQuery params, List<Document> dList) { |
| | | if (params.getDataType().equals(1)) { |
| | | dList.add(new Document("provinceTag", new Document("$eq", Boolean.TRUE))); |
| | | } else if (params.getDataType().equals(2)) { |
| | | dList.add(new Document("deptTag", new Document("$eq", Boolean.TRUE))); |
| | | } |
| | | } |
| | | } |