| | |
| | | package com.ycl.calculate; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ycl.platform.base.CheckIndex; |
| | | import com.ycl.platform.domain.entity.YwPoint; |
| | | import com.ycl.platform.mapper.YwPointMapper; |
| | | import constant.ApiConstants; |
| | | import constant.CheckConstants; |
| | | import enumeration.general.PublishType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Slf4j |
| | | public class IndexCalculationUtils { |
| | | |
| | | //检查是否存在当日数据 |
| | | public <T extends CheckIndex> T getCheckIndex(String key, List<T> checkIndexList, Class<T> clazz) { |
| | | T checkIndex; |
| | | |
| | | // 检查是否已存在今日数据 |
| | | Optional<T> existingIndex = checkIndexList.stream() |
| | | .filter(index -> key.startsWith(ApiConstants.Province) ? |
| | |
| | | return checkIndex; |
| | | } |
| | | |
| | | /** --------指标算法---------*/ |
| | | /** |
| | | * --------指标算法--------- |
| | | */ |
| | | |
| | | //一机一档合格率 |
| | | public BigDecimal monitorQualify(Map<String, Object> param) { |
| | |
| | | public BigDecimal viewConnectStability(Map<String, Object> param) { |
| | | BigDecimal totalDataSum = new BigDecimal((Integer) param.get("totalDataSum")); |
| | | BigDecimal lastCount = (BigDecimal) param.get("lastCount"); |
| | | log.info("视图库对接稳定性,totalDataSum:{},lastCount:{}",totalDataSum,lastCount); |
| | | log.info("视图库对接稳定性,totalDataSum:{},lastCount:{}", totalDataSum, lastCount); |
| | | return totalDataSum.divide(lastCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |