| | |
| | | //区域人脸点位在线指标的内部类 |
| | | protected static class AreaStats { |
| | | int totalSites = 0; |
| | | int onlineSites = 0; |
| | | int totalDataSum = 0; |
| | | } |
| | | |
| | |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | if (ApiConstants.HK_SnapCount_ResultType_Null != result.getResultType()) { |
| | | stats.onlineSites++; |
| | | stats.totalDataSum += result.getDataCount(); |
| | | } |
| | | } |
| | | |
| | | |
| | | //车辆点位在线率和视图库对接稳定性 |
| | | //人脸视图库对接稳定性 |
| | | private CheckIndexFace createOrUpdateCheckIndexFace(String key, AreaStats stats, List<CheckIndexFace> checkIndexFaceList,List<SysDictData> faceSnap) { |
| | | CheckIndexFace checkIndexFace = getCheckIndex(key, checkIndexFaceList, CheckIndexFace.class); |
| | | if (checkIndexFace == null) { |
| | | return null; |
| | | } |
| | | //调用点位在线计算方法 |
| | | if (stats.totalSites >= CheckThreadConstants.Check_Face_SiteOnline) { |
| | | Map<String, Object> siteOnlineParam = new HashMap<>(); |
| | | siteOnlineParam.put("totalSites", stats.totalSites); |
| | | siteOnlineParam.put("onlineSites", stats.onlineSites); |
| | | BigDecimal siteOnline = siteOnline(siteOnlineParam); |
| | | checkIndexFace.setSiteOnline(siteOnline); |
| | | } else { |
| | | checkIndexFace.setSiteOnline(BigDecimal.ZERO); |
| | | } |
| | | //视图库对接稳定性 |
| | | //Redis记录该区县当月无数据上传次数 |