| | |
| | | import com.ycl.system.page.PageUtil; |
| | | import com.ycl.utils.DateUtils; |
| | | import com.ycl.utils.MongoUtil; |
| | | import com.ycl.utils.StringUtils; |
| | | import com.ycl.utils.bean.BeanUtils; |
| | | import com.ycl.utils.poi.ExcelUtil; |
| | | import constant.ApiConstants; |
| | |
| | | onlineCount = (Integer) result.getOrDefault("onlineCount", 0L); |
| | | totalCount = offlineCount + unknownCount + onlineCount; |
| | | } |
| | | /** 查询当天在线率 */ |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getSiteOnline) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | .list(); |
| | | |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount!=0) { |
| | | onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | // /** 查询当天在线率 */ |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getSiteOnline) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | // .list(); |
| | | // |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | |
| | | onlineCount = (Integer) result.getOrDefault("onlineCount", 0L); |
| | | totalCount = offlineCount + unknownCount + onlineCount; |
| | | } |
| | | |
| | | params.setDeptTag(1); |
| | | params.setDeviceType(1); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getMinistrySiteOnline) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistrySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount!=0) { |
| | | onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | // params.setDeptTag(1); |
| | | // params.setDeviceType(1); |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getMinistrySiteOnline) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistrySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | |
| | | onlineCount = (Integer) result.getOrDefault("onlineCount", 0L); |
| | | totalCount = offlineCount + unknownCount + onlineCount; |
| | | } |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeySiteOnline) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount!=0) { |
| | | onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getKeySiteOnline) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeySiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | |
| | | onlineCount = (Integer) result.getOrDefault("onlineCount", 0L); |
| | | totalCount = offlineCount + unknownCount + onlineCount; |
| | | } |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeyCommandImageOnline) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyCommandImageOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount!=0) { |
| | | onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getKeyCommandImageOnline) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyCommandImageOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getMonitorRegistration) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorRegistration).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getMonitorRegistration) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorRegistration).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal rate = BigDecimal.ZERO; |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | rate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | rList.add(this.remove0(rate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", rList); |
| | | map.put("list", resultVOS); |
| | |
| | | } |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getMonitorQualification) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorQualification).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getMonitorQualification) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMonitorQualification).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", rList); |
| | |
| | | * 档案留存总量:mongo存的所有去重后的档案 |
| | | * 当日档案:当日的档案 |
| | | * 档案考核比 = 当日档案/档案留存总量 |
| | | * |
| | | * @param params |
| | | * @return1 |
| | | */ |
| | |
| | | } |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getArchivesRate) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getArchivesRate).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getArchivesRate) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getArchivesRate).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", rList); |
| | |
| | | } |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getVideoAvailable) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getVideoAvailable) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | //加一个总数 |
| | | int totalCount = 0; |
| | | for (String s : resultCount) { |
| | |
| | | } |
| | | resultCount.add(0, totalCount + ""); |
| | | |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (!StringUtils.isEmpty(resultCount.get(0)) && !"0".equals(resultCount.get(0))) { |
| | | onlineRate = new BigDecimal(resultCount.get(1)).divide(new BigDecimal(resultCount.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | resultCount.add(this.remove0(onlineRate)); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getMinistryVideoAvailable) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistryVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getMinistryVideoAvailable) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getMinistryVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | //加一个总数 |
| | | int totalCount = 0; |
| | | for (String s : resultCount) { |
| | | totalCount += Integer.parseInt(s); |
| | | } |
| | | resultCount.add(0, totalCount + ""); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (!StringUtils.isEmpty(resultCount.get(0)) && !"0".equals(resultCount.get(0))) { |
| | | onlineRate = new BigDecimal(resultCount.get(1)).divide(new BigDecimal(resultCount.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | resultCount.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", resultCount); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeyVideoAvailable) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getKeyVideoAvailable) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyVideoAvailable).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | //加一个总数 |
| | | int totalCount = 0; |
| | | for (String s : resultCount) { |
| | | totalCount += Integer.parseInt(s); |
| | | } |
| | | resultCount.add(0, totalCount + ""); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (!StringUtils.isEmpty(resultCount.get(0)) && !"0".equals(resultCount.get(0))) { |
| | | onlineRate = new BigDecimal(resultCount.get(1)).divide(new BigDecimal(resultCount.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | resultCount.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", resultCount); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeyAnnotationAccuracy) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getKeyAnnotationAccuracy) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyAnnotationAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyAnnotationAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 视频:校时正确率 |
| | | * 视频:校时正确率(停用) |
| | | * |
| | | * @param params |
| | | * @return |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeyTimingAccuracy) |
| | | .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | // .select(CheckIndexVideo::getKeyTimingAccuracy) |
| | | // .eq(params.getDataType().equals(1), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexVideo::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexVideo::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexVideo::getKeyTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | dList3.add(new Document("resultType", new Document("$eq", 2))); |
| | | dList3.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR))); |
| | | setTag(params, dList3); |
| | | |
| | | Document noDataFilter = new Document("$and", dList2); |
| | | Document trFilter = new Document("$and", dList3); |
| | | List<Document> lists = Arrays.asList(noDataFilter, trFilter); |
| | | List<Document> dList4 = new ArrayList<>(2); |
| | | dList4.add(new Document("resultType", new Document("$eq", 3))); |
| | | dList4.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR))); |
| | | setTag(params, dList4); |
| | | List<Document> dList5 = new ArrayList<>(2); |
| | | dList5.add(new Document("resultType", new Document("$eq", 4))); |
| | | dList5.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR))); |
| | | setTag(params, dList5); |
| | | Document normalFilter = new Document("$and", dList2); |
| | | Document noDataFilter = new Document("$and", dList3); |
| | | Document downFilter = new Document("$and", dList4); |
| | | Document lessFilter = new Document("$and", dList5); |
| | | List<Document> lists = Arrays.asList(normalFilter, noDataFilter,downFilter,lessFilter); |
| | | List<String> rList = lists.stream().map(filter -> { |
| | | // 构建聚合管道 |
| | | List<Document> pipeline = Arrays.asList( |
| | |
| | | dataCount = doc.getInteger("dataCount"); |
| | | } |
| | | rList.add(0,dataCount+""); |
| | | List<CheckIndexCar> carList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getViewConnectStability) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexCar> carList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getViewConnectStability) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(carList)) { |
| | | // BigDecimal sum = carList.stream().map(CheckIndexCar::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(carList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal normal = new BigDecimal(rList.get(1)); |
| | | BigDecimal noData = new BigDecimal(rList.get(2)); |
| | | BigDecimal down = new BigDecimal(rList.get(3)); |
| | | BigDecimal less = new BigDecimal(rList.get(4)); |
| | | BigDecimal totalCount = normal.add(noData).add(down).add(less); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(carList)) { |
| | | BigDecimal sum = carList.stream().map(CheckIndexCar::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(carList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount.compareTo(BigDecimal.ZERO)>0) { |
| | | onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | totalCount = offlineCount + unknownCount + onlineCount; |
| | | } |
| | | |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getSiteOnline) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getSiteOnline) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount!=0) { |
| | | onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate))); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getDeviceDirectoryConsistent) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getDeviceDirectoryConsistent) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getVehicleInformationCollectionAccuracy) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getVehicleInformationCollectionAccuracy) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | mainNoIntegrityCount = doc.getInteger("mainNoIntegrityCount"); |
| | | } |
| | | |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getVehicleCaptureIntegrity) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureIntegrity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getVehicleCaptureIntegrity) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureIntegrity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | List<String> countList = new ArrayList<>(); |
| | | countList.add(dataCount+""); |
| | | countList.add(noIntegrityCount+""); |
| | | countList.add(mainNoIntegrityCount+""); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (dataCount!=0) { |
| | | onlineRate = new BigDecimal(dataCount-noIntegrityCount).divide(new BigDecimal(dataCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | countList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", countList); |
| | |
| | | importantDiffCount = doc.getInteger("importantDiffCount"); |
| | | } |
| | | |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getVehicleCaptureAccuracy) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getVehicleCaptureAccuracy) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleCaptureAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | |
| | | List<String> countList = new ArrayList<>(); |
| | | countList.add(sampleCount+""); |
| | | countList.add(majorDiffCount+""); |
| | | countList.add(importantDiffCount+""); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (sampleCount!=0) { |
| | | onlineRate = new BigDecimal(sampleCount-majorDiffCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | countList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", countList); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getVehicleTimingAccuracy) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getVehicleTimingAccuracy) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | BigDecimal normal = new BigDecimal(rList.get(0)); |
| | | BigDecimal abnormal = new BigDecimal(rList.get(1)); |
| | | BigDecimal totalCount = normal.add(abnormal); |
| | | if (totalCount.compareTo(BigDecimal.ZERO)>0) { |
| | | onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | }).collect(Collectors.toList()); |
| | | |
| | | |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getVehicleUploadTimeliness) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getVehicleUploadTimeliness) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehicleUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | expCount = doc.getInteger("expCount"); |
| | | } |
| | | List<String> countList = new ArrayList<>(); |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getVehiclePictureAvailability) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehiclePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | // .select(CheckIndexCar::getVehiclePictureAvailability) |
| | | // .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexCar::getVehiclePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | countList.add(sampleCount+""); |
| | | countList.add(expCount+""); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (sampleCount!=0) { |
| | | onlineRate = new BigDecimal(sampleCount-expCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | countList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", countList); |
| | |
| | | dList3.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR))); |
| | | setTag(params, dList3); |
| | | |
| | | Document noDataFilter = new Document("$and", dList2); |
| | | Document trFilter = new Document("$and", dList3); |
| | | List<Document> lists = Arrays.asList(noDataFilter, trFilter); |
| | | List<Document> dList4 = new ArrayList<>(2); |
| | | dList4.add(new Document("resultType", new Document("$eq", 3))); |
| | | dList4.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR))); |
| | | setTag(params, dList4); |
| | | List<Document> dList5 = new ArrayList<>(2); |
| | | dList5.add(new Document("resultType", new Document("$eq", 4))); |
| | | dList5.add(new Document("dataType", new Document("$eq", ApiConstants.HK_DataType_CAR))); |
| | | setTag(params, dList5); |
| | | Document normalFilter = new Document("$and", dList2); |
| | | Document noDataFilter = new Document("$and", dList3); |
| | | Document downFilter = new Document("$and", dList4); |
| | | Document lessFilter = new Document("$and", dList5); |
| | | List<Document> lists = Arrays.asList(normalFilter, noDataFilter,downFilter,lessFilter); |
| | | List<String> rList = lists.stream().map(filter -> { |
| | | // 构建聚合管道 |
| | | List<Document> pipeline = Arrays.asList( |
| | |
| | | dataCount = doc.getInteger("dataCount"); |
| | | } |
| | | rList.add(0,dataCount+""); |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getViewConnectStability) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getViewConnectStability) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal normal = new BigDecimal(rList.get(1)); |
| | | BigDecimal noData = new BigDecimal(rList.get(2)); |
| | | BigDecimal down = new BigDecimal(rList.get(3)); |
| | | BigDecimal less = new BigDecimal(rList.get(4)); |
| | | BigDecimal totalCount = normal.add(noData).add(down).add(less); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getViewConnectStability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount.compareTo(BigDecimal.ZERO)>0) { |
| | | onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | onlineCount = (Integer) result.getOrDefault("onlineCount", 0L); |
| | | totalCount = offlineCount + unknownCount + onlineCount; |
| | | } |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getSiteOnline) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | .list(); |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getSiteOnline) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, params.getStartTime(), params.getEndTime()) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getSiteOnline).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (totalCount!=0) { |
| | | onlineRate = new BigDecimal(onlineCount).divide(new BigDecimal(totalCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(totalCount + "", onlineCount + "", offlineCount + "", unknownCount + "", this.remove0(onlineRate))); |
| | | map.put("list", resultList); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getDeviceDirectoryConsistent) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getDeviceDirectoryConsistent) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getDeviceDirectoryConsistent).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getFaceInformationCollectionAccuracy) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getFaceInformationCollectionAccuracy) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceInformationCollectionAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(1)).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | } |
| | | List<String> countList = new ArrayList<>(); |
| | | |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getFacePictureQualification) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureQualification).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getFacePictureQualification) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureQualification).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | countList.add(sampleCount+""); |
| | | countList.add(expCount+""); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (sampleCount!=0) { |
| | | onlineRate = new BigDecimal(sampleCount-expCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | countList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", countList); |
| | |
| | | return uniqueDeviceIdCount + ""; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getFaceTimingAccuracy) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getFaceTimingAccuracy) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceTimingAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | BigDecimal normal = new BigDecimal(rList.get(0)); |
| | | BigDecimal abnormal = new BigDecimal(rList.get(1)); |
| | | BigDecimal totalCount = normal.add(abnormal); |
| | | if (totalCount.compareTo(BigDecimal.ZERO)>0) { |
| | | onlineRate = normal.divide(totalCount, 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | }).collect(Collectors.toList()); |
| | | |
| | | |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getFaceUploadTimeliness) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getFaceUploadTimeliness) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getFaceUploadTimeliness).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | if (!StringUtils.isEmpty(rList.get(0)) && !"0".equals(rList.get(0))) { |
| | | onlineRate = new BigDecimal(rList.get(0)).subtract(new BigDecimal(rList.get(1))).divide(new BigDecimal(rList.get(0)), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | List<String> countList = new ArrayList<>(); |
| | | |
| | | // 统计数 |
| | | List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | .select(CheckIndexFace::getFacePictureAvailability) |
| | | .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | | BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | // List<CheckIndexFace> videoList = new LambdaQueryChainWrapper<>(checkIndexFaceService.getBaseMapper()) |
| | | // .select(CheckIndexFace::getFacePictureAvailability) |
| | | // .eq(params.getDataType().equals(1), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | // .eq(params.getDataType().equals(2), CheckIndexFace::getExamineTag, CheckConstants.Examine_Tag_Dept) |
| | | // .between(CheckIndexFace::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | // .list(); |
| | | // BigDecimal onlineRate = BigDecimal.ZERO; |
| | | // if (CollectionUtils.isNotEmpty(videoList)) { |
| | | // BigDecimal sum = videoList.stream().map(CheckIndexFace::getFacePictureAvailability).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal count = BigDecimal.valueOf(videoList.size()); |
| | | // onlineRate = sum.divide(count, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | // } |
| | | countList.add(sampleCount+""); |
| | | countList.add(expCount+""); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (sampleCount!=0) { |
| | | onlineRate = new BigDecimal(sampleCount-expCount).divide(new BigDecimal(sampleCount), 3,RoundingMode.DOWN).multiply(new BigDecimal("100")); |
| | | } |
| | | countList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", countList); |