| | |
| | | int usabilitySites = 0; |
| | | int importantSites = 0; |
| | | int importantUsabilitySites = 0; |
| | | int deptSite =0; |
| | | int depteUsabilitySites = 0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<String> provinceIds = getProvince(); |
| | | //重点点位集合 |
| | | List<String> important = getImportant(); |
| | | |
| | | List<String> deptTag = getDeptTag(); |
| | | Map<String, AreaStats> areaStatsMap = new HashMap<>(); |
| | | for (RecordMetaDSumResult result : list) { |
| | | TMonitorVO monitor = monitorMap.get(result.getDeviceId()); |
| | | if (monitor == null) continue; |
| | | |
| | | String deptId = monitor.getDeptId().toString(); |
| | | updateAreaStats(areaStatsMap, deptId, result, important); |
| | | updateAreaStats(areaStatsMap, deptId, result, important,deptTag); |
| | | |
| | | // 处理省厅数据 |
| | | if (!CollectionUtils.isEmpty(provinceIds) && provinceIds.contains(monitor.getSerialNumber())) { |
| | | String provinceKey = ApiConstants.Province + deptId; |
| | | updateAreaStats(areaStatsMap, provinceKey, result, important); |
| | | updateAreaStats(areaStatsMap, provinceKey, result, important,deptTag); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 累计总点位数、在线点位数、重点点位数、重点点位在线数 |
| | | */ |
| | | private void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, RecordMetaDSumResult result, List<String> important) { |
| | | private void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, RecordMetaDSumResult result, List<String> important,List<String> deptTag) { |
| | | //返回对象的引用,如果不存在会放入新的key,value |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | boolean flag = important.contains(result.getDeviceId()); |
| | | if(flag){ |
| | | if(important.contains(result.getDeviceId())){ |
| | | stats.importantSites++; |
| | | } |
| | | if(deptTag.contains(result.getDeviceId())){ |
| | | stats.deptSite++; |
| | | } |
| | | if (ApiConstants.UY_RecordStatus_Integrity.equals(result.getRecordStatus())){ |
| | | stats.usabilitySites++; |
| | | if(flag){ |
| | | if(important.contains(result.getDeviceId())){ |
| | | stats.importantUsabilitySites++; |
| | | } |
| | | if(deptTag.contains(result.getDeviceId())){ |
| | | stats.depteUsabilitySites++; |
| | | } |
| | | } |
| | | } |
| | |
| | | importantParam.put("usabilitySites", stats.importantUsabilitySites); |
| | | BigDecimal importantVideoUsability = videoUsability(importantParam); |
| | | checkIndexVideo.setKeyVideoAvailable(importantVideoUsability); |
| | | //调用录像可用率计算方法 计算部级录像可用率 |
| | | Map<String, Object> deptParam = new HashMap<>(); |
| | | deptParam.put("totalSites", stats.deptSite); |
| | | deptParam.put("usabilitySites", stats.depteUsabilitySites); |
| | | BigDecimal deptUseability = videoUsability(deptParam); |
| | | checkIndexVideo.setMinistryVideoAvailable(deptUseability); |
| | | return checkIndexVideo; |
| | | } |
| | | } |