| | |
| | | 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() { |
| | |
| | | calculator.calculate(tMonitorVOS); |
| | | log.info("结束计算一机一档注册率、档案考核比"); |
| | | } |
| | | public void oneMonitorQualifyTask(){ |
| | | |
| | | public void oneMonitorQualifyTask() { |
| | | log.info("开始计算一机一档合格率"); |
| | | //计算一机一档合格率 |
| | | Date yesterday = DateUtils.addDays(new Date(), -1); |
| | |
| | | calculator.calculate(results); |
| | | log.info("结束计算一机一档合格率"); |
| | | } |
| | | |
| | | public void platformOnlineTask() { |
| | | log.info("开始计算平台在线率"); |
| | | //计算平台在线率 |
| | |
| | | calculator.calculate(list); |
| | | log.info("结束计算平台在线率"); |
| | | } |
| | | |
| | | 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); |
| | |
| | | count++; |
| | | } |
| | | } |
| | | imageResourceSecurity.setWeakPassword(BigDecimal.valueOf(score).divide(new BigDecimal(100),4, RoundingMode.HALF_UP)); |
| | | imageResourceSecurity.setWeakPassword(BigDecimal.valueOf(score).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); |
| | | // 获取字典值-总数 |
| | | int onlineAssetsTotal = Integer.parseInt(DictUtils.getDictValue("online_assets_total", checkIndexVideo.getDeptName())); |
| | | 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().add(imageResourceSecurity.getPropertyAccuracy().add(imageResourceSecurity.getWeakPassword().add(imageResourceSecurity.getRiskProperty()))).multiply(NUM)); |
| | | checkIndexVideo.setImageResourceSecurity( |
| | | imageResourceSecurity.getPlatformOnline() |
| | | .add(imageResourceSecurity.getPropertyAccuracy() |
| | | .add(imageResourceSecurity.getWeakPassword() |
| | | .add(imageResourceSecurity.getRiskProperty()))).multiply(NUM) |
| | | .add(imageResourceSecurity.getBoundaryIntegrity()).multiply(new BigDecimal("0.45")) |
| | | ); |
| | | checkIndexVideoMapper.updateById(checkIndexVideo); |
| | | } |
| | | imageResourceSecurityService.saveBatch(imageResourceSecurities); |