| | |
| | | package com.ycl.calculate; |
| | | |
| | | import com.ycl.platform.domain.entity.CheckIndexVideo; |
| | | import com.ycl.platform.domain.result.SYS.TMonitorResult; |
| | | import com.ycl.platform.domain.result.UY.VideoOnlineResult; |
| | | import com.ycl.platform.mapper.CheckIndexVideoMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class VideoOnlineCalculation extends IndexCalculationServe<VideoOnlineResult, VideoOnlineCalculation.AreaStats> implements CalculationStrategy<VideoOnlineResult> { |
| | | public class VideoOnlineCalculation extends IndexCalculationServe<TMonitorResult, VideoOnlineCalculation.AreaStats> implements CalculationStrategy<TMonitorResult> { |
| | | @Autowired |
| | | private CheckIndexVideoMapper checkIndexVideoMapper; |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void calculate(List<VideoOnlineResult> list) { |
| | | public void calculate(List<TMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, VideoOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | if (areaStatsMap == null) return; |
| | |
| | | * 累计总点位数、在线点位数、重点点位数、重点点位在线数、指挥图像数、指挥图像在线数 |
| | | */ |
| | | @Override |
| | | public void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, VideoOnlineResult result) { |
| | | public void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, TMonitorResult result) { |
| | | //返回对象的引用,如果不存在会放入新的key,value |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | |
| | | if(result.getDeptTag()!=null && result.getDeptTag()){ |
| | | stats.deptSites++; |
| | | } |
| | | if (ApiConstants.UY_OnlineSite_Online.equals(result.getStatus())){ |
| | | if (result.getOnline()!=null && result.getOnline()){ |
| | | stats.onlineSites++; |
| | | if(result.getImportantTag()!=null && result.getImportantTag()){ |
| | | stats.importantOnlineSites++; |