| | |
| | | import com.ycl.platform.domain.entity.CheckIndexVideo; |
| | | import com.ycl.platform.domain.param.UY.RecordMetaDSumParam; |
| | | import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult; |
| | | import com.ycl.platform.domain.result.UY.QueryVqdResult; |
| | | import com.ycl.platform.domain.result.UY.*; |
| | | import com.ycl.platform.domain.vo.PlatformOnlineVO; |
| | | import com.ycl.platform.domain.vo.TMonitorVO; |
| | | import com.ycl.platform.mapper.CheckIndexVideoMapper; |
| | | import com.ycl.platform.mapper.PlatformOnlineMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.service.PlatformOnlineService; |
| | | import com.ycl.system.mapper.SysDeptMapper; |
| | | import com.ycl.utils.DateUtils; |
| | |
| | | @Autowired |
| | | private PlatformOnlineMapper platformOnlineMapper; |
| | | @Autowired |
| | | private CheckIndexVideoMapper videoMapper; |
| | | @Autowired |
| | | private SysDeptMapper deptMapper; |
| | | private TMonitorMapper monitorMapper; |
| | | |
| | | public void siteOnlineTask() { |
| | | Date yesterday = DateUtils.addDays(new Date(), -1); |
| | | //计算点位在线率和重点点位在线率 |
| | | //TODO:时间写死了 |
| | | Date date = DateUtils.getDay(2024,7,13); |
| | | //计算点位在线率和重点点位在线率和指挥图像在线率 |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(yesterday)).lt(DateUtils.getDayEnd(yesterday))); |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date))); |
| | | |
| | | List<QueryVqdResult> results = mongoTemplate.find(query, QueryVqdResult.class); |
| | | List<VideoOnlineResult> results = mongoTemplate.find(query, VideoOnlineResult.class); |
| | | CalculationStrategy calculator = IndexCalculationFactory.getCalculator(CalculationStrategyConstants.Video_SiteOnline); |
| | | calculator.calculate(results); |
| | | } |
| | | |
| | | public void videoUsabilityTask() { |
| | | Date yesterday = DateUtils.addDays(new Date(), -1); |
| | | //TODO:时间写死了 |
| | | Date date = DateUtils.getDay(2024,7,13); |
| | | //计算录像可用率和重点录像可用率 |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(yesterday)).lt(DateUtils.getDayEnd(yesterday))); |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date))); |
| | | |
| | | List<RecordMetaDSumParam> results = mongoTemplate.find(query, RecordMetaDSumParam.class); |
| | | List<RecordMetaDSumResult> results = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | CalculationStrategy calculator = IndexCalculationFactory.getCalculator(CalculationStrategyConstants.Video_Usability); |
| | | calculator.calculate(results); |
| | | } |
| | | |
| | | public void oneMonitorFileTask() { |
| | | //计算一机一档注册率、一机一档合格率、档案考核比 |
| | | //计算一机一档注册率、档案考核比 |
| | | List<TMonitorVO> tMonitorVOS = monitorMapper.selectMonitorVOList(); |
| | | CalculationStrategy calculator = IndexCalculationFactory.getCalculator(CalculationStrategyConstants.Video_MonitorRegis_ArchiveRate); |
| | | calculator.calculate(tMonitorVOS); |
| | | } |
| | | |
| | | public void oneMonitorQualifyTask(){ |
| | | //计算一机一档合格率 |
| | | // Date yesterday = DateUtils.addDays(new Date(), -1); |
| | | //TODO:时间写死了 |
| | | Date date = DateUtils.getDay(2024,7,13); |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date))); |
| | | List<MonitorQualifyResult> results = mongoTemplate.find(query, MonitorQualifyResult.class); |
| | | CalculationStrategy calculator = IndexCalculationFactory.getCalculator(CalculationStrategyConstants.Video_MonitorQualify); |
| | | calculator.calculate(results); |
| | | } |
| | | public void platformOnlineTask() { |
| | | //计算平台在线率 |
| | | //拿到今日离线时长数据 |
| | | List<PlatformOnlineVO> list = platformOnlineMapper.sumYesterday(DateUtils.getMouthStart(new Date()), DateUtils.getMouthEnd(new Date())); |
| | | |
| | | // int num = (time / 60) % 30; |
| | | // double score = Math.max(1 - num * 0.1, 0); |
| | | // List<CheckIndexVideo> checkIndexVideos = videoMapper.selectToday(DateUtils.getDate()); |
| | | // List<Long> deptIds = deptMapper.selectByParentId(207L); |
| | | // Map<String, CheckIndexVideo> map = new HashMap<>(); |
| | | // for (Long deptId : deptIds) { |
| | | // CheckIndexVideo video = new CheckIndexVideo(); |
| | | // video.setExamineTag(CheckConstants.Examine_Tag_County); |
| | | // map.put(deptId + "", video); |
| | | // CheckIndexVideo provinceVideo = new CheckIndexVideo(); |
| | | // provinceVideo.setExamineTag(CheckConstants.Examine_Tag_Province); |
| | | // map.put("Province_" + deptId, new CheckIndexVideo()); |
| | | // } |
| | | // map.forEach((deptId, video) -> { |
| | | // |
| | | // }); |
| | | |
| | | |
| | | List<PlatformOnlineVO> list = platformOnlineMapper.yesterdayData(DateUtils.getMouthStart(new Date()), DateUtils.getMouthEnd(new Date())); |
| | | CalculationStrategy calculator = IndexCalculationFactory.getCalculator(CalculationStrategyConstants.Video_PlatformOnline); |
| | | calculator.calculate(list); |
| | | } |
| | | public void osdTask() { |
| | | //计算Osd标注、时间准确率 |
| | | Date yesterday = DateUtils.addDays(new Date(), -1); |
| | | //TODO:时间写死了 |
| | | Date date = DateUtils.getDay(2024,7,13); |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date))); |
| | | List<PyOsdResult> results = mongoTemplate.find(query, PyOsdResult.class); |
| | | CalculationStrategy calculator = IndexCalculationFactory.getCalculator(CalculationStrategyConstants.Video_OsdTime); |
| | | calculator.calculate(results); |
| | | } |
| | | |
| | | } |