| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 计算视频设备点位在线率、重点点位在线率、重点指挥图像在线率、部级点位在线率 |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //重点指挥图像特殊处理,统一采用区县数据 |
| | | Map<Long, BigDecimal> keyCommandMap = checkIndexVideos.stream().filter(checkIndexVideo -> !checkIndexVideo.getDeptTag() && !checkIndexVideo.getProvinceTag()) |
| | | .collect(Collectors.toMap(checkIndexVideo -> checkIndexVideo.getDeptId(), checkIndexVideo -> checkIndexVideo.getKeyCommandImageOnline())); |
| | | for (CheckIndexVideo checkIndexVideo : checkIndexVideos) { |
| | | //替换省厅和部级 重点指挥图像 |
| | | if(checkIndexVideo.getProvinceTag() || checkIndexVideo.getDeptTag()){ |
| | | BigDecimal keyCommand = keyCommandMap.get(checkIndexVideo.getDeptId()); |
| | | checkIndexVideo.setKeyCommandImageOnline(keyCommand); |
| | | } |
| | | } |
| | | checkIndexVideoService.saveOrUpdateBatch(checkIndexVideos); |
| | | } |
| | | |
| | |
| | | BigDecimal siteOnline = siteOnline(param); |
| | | checkIndexVideo.setSiteOnline(siteOnline); |
| | | //区县不少于100路 |
| | | if(stats.totalSites < CheckThreadConstants.Check_Video_SiteOnline){ |
| | | if(!key.startsWith(ApiConstants.Dept) && stats.totalSites < CheckThreadConstants.Check_Video_SiteOnline){ |
| | | checkIndexVideo.setSiteOnline(BigDecimal.ZERO); |
| | | } |
| | | //调用点位在线率计算方法 计算重点点位在线率 |
| | |
| | | } |
| | | |
| | | //区县视频重点点位数不少于10路 |
| | | if(stats.importantSites<CheckThreadConstants.Check_Video_ImportantSite){ |
| | | if(!key.startsWith(ApiConstants.Dept) && stats.importantSites < CheckThreadConstants.Check_Video_ImportantSite){ |
| | | checkIndexVideo.setKeySiteOnline(BigDecimal.ZERO); |
| | | } |
| | | |