| | |
| | | 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.ImageResourceSecurityDetailMapper; |
| | | import com.ycl.platform.mapper.PlatformOnlineMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.mapper.*; |
| | | import com.ycl.platform.service.IImageResourceSecurityService; |
| | | import com.ycl.utils.DateUtils; |
| | | import com.ycl.utils.DictUtils; |
| | |
| | | private final IImageResourceSecurityService imageResourceSecurityService; |
| | | private final CheckIndexVideoMapper checkIndexVideoMapper; |
| | | private final ImageResourceSecurityDetailMapper imageResourceSecurityDetailMapper; |
| | | private final ImageResourceSecurityMapper imageResourceSecurityMapper; |
| | | |
| | | private static final BigDecimal NUM = new BigDecimal("0.15"); |
| | | |
| | | public void siteOnlineTask() { |
| | |
| | | public void osdTask() { |
| | | log.info("开始计算Osd标注、时间准确率"); |
| | | //计算Osd标注、时间准确率 |
| | | // Date yesterday = DateUtils.addDays(new Date(), -1); |
| | | Date yesterday = DateUtils.addDays(new Date(), -1); |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(yesterday)).lt(DateUtils.getDayEnd(yesterday))); |
| | | List<OsdCheckResult> results = mongoTemplate.find(query, OsdCheckResult.class); |
| | | CalculationStrategy calculator = IndexCalculationFactory.getCalculator(CalculationStrategyConstants.Video_OsdTime); |
| | | calculator.calculate(results); |
| | |
| | | /** |
| | | * 视频图像资源安全,需要排在平台在线率后面。 |
| | | */ |
| | | //手动打分取最近数据,前端页面加打分规则提示 |
| | | @Transactional |
| | | public void videoSecurity() { |
| | | ArrayList<ImageResourceSecurity> imageResourceSecurities = new ArrayList<>(); |
| | |
| | | imageResourceSecurity.setRiskProperty(BigDecimal.valueOf(count / onlineAssetsTotal)); |
| | | imageResourceSecurity.setCreateTime(DateUtils.getNowDate()); |
| | | imageResourceSecurities.add(imageResourceSecurity); |
| | | //获取最近一次数据手动打分 |
| | | ImageResourceSecurity latest = imageResourceSecurityMapper.getLatest(checkIndexVideo.getDeptId(),new Date()); |
| | | imageResourceSecurity.setBoundaryIntegrity(latest.getBoundaryIntegrity()); |
| | | // 更新指标数据 |
| | | checkIndexVideo.setImageResourceSecurity( |
| | | imageResourceSecurity.getPlatformOnline() |