| | |
| | | import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import constant.CheckConstants; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * 计算公式 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class IndexCalculationServe { |
| | | |
| | | //点位在线率 |
| | |
| | | return accuracySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //url可用性 |
| | | public BigDecimal urlUsability(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal urlQualifySites = new BigDecimal((Integer) param.get("urlQualifySites")); |
| | | return urlQualifySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //大图可用性 |
| | | public BigDecimal picUsability(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal picUsabilitySites = new BigDecimal((Integer) param.get("picUsabilitySites")); |
| | | return picUsabilitySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | |
| | | //返回省厅国标码集合 |
| | | public List<String> getProvince() { |
| | | // TODO: 分省厅市局 需要补充集合数据 |
| | |
| | | checkIndex.setExamineTag(key.startsWith("Province_") ? CheckConstants.Examine_Tag_City : CheckConstants.Examine_Tag_County); |
| | | checkIndex.setCreateTime(new Date()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("无法创建 CheckIndexCar 实例", e); |
| | | checkIndex = null; |
| | | log.error("无法创建 checkIndex 实例", e); |
| | | } |
| | | } |
| | | return checkIndex; |