| | |
| | | |
| | | import com.ycl.platform.domain.entity.CheckIndexCar; |
| | | import com.ycl.platform.domain.entity.CheckIndexFace; |
| | | import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult; |
| | | import com.ycl.platform.domain.result.SYS.TMonitorResult; |
| | | import com.ycl.platform.mapper.CheckIndexCarMapper; |
| | | import com.ycl.platform.mapper.CheckIndexFaceMapper; |
| | | import com.ycl.platform.service.ICheckIndexCarService; |
| | | import com.ycl.platform.service.ICheckIndexFaceService; |
| | | import com.ycl.utils.DateUtils; |
| | | import constant.ApiConstants; |
| | | import constant.CheckThreadConstants; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class FaceOnlineCalculation extends IndexCalculationServe<TMonitorResult, FaceOnlineCalculation.AreaStats> implements CalculationStrategy<TMonitorResult> { |
| | | public class FaceOnlineCalculation extends IndexCalculationServe<SnapshotDataMonitorResult, FaceOnlineCalculation.AreaStats> implements CalculationStrategy<SnapshotDataMonitorResult> { |
| | | @Autowired |
| | | private CheckIndexFaceMapper checkIndexFaceMapper; |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void calculate(List<TMonitorResult> list) { |
| | | public void calculate(List<SnapshotDataMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | |
| | | * 累计总点位数、离线数、总抓拍量 |
| | | */ |
| | | @Override |
| | | public void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, TMonitorResult result) { |
| | | public void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, SnapshotDataMonitorResult result) { |
| | | //返回对象的引用,如果不存在会放入新的key,value |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | |
| | | if (result.getOnline()!=null && result.getOnline()) { |
| | | if (ApiConstants.HK_SnapCount_ResultType_Null != result.getResultType()) { |
| | | stats.onlineSites++; |
| | | } |
| | | } |