| | |
| | | |
| | | import com.ycl.platform.domain.entity.CheckIndexCar; |
| | | import com.ycl.platform.domain.result.HK.VehicleDeviceSamplingResult; |
| | | import com.ycl.platform.domain.vo.TMonitorVO; |
| | | import com.ycl.platform.mapper.CheckIndexCarMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.service.ICheckIndexCarService; |
| | | import constant.ApiConstants; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | import utils.DateUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 计算车辆抓拍数据准确性、url可用性、大图可用性 |
| | |
| | | public class CarDeviceSampleCalculation extends IndexCalculationServe<VehicleDeviceSamplingResult, CarDeviceSampleCalculation.AreaStats> implements CalculationStrategy<VehicleDeviceSamplingResult> { |
| | | @Autowired |
| | | private CheckIndexCarMapper checkIndexCarMapper; |
| | | @Autowired |
| | | private TMonitorMapper monitorMapper; |
| | | @Autowired |
| | | private ICheckIndexCarService checkIndexCarService; |
| | | |
| | |
| | | if (bigUseful.getBigUsefulPercent() >= 0.9) { |
| | | stats.picUsabilitySites++; |
| | | } |
| | | if (bigUseful.getSampleCount() != 0) { |
| | | //图片访问正常量 = 抽检量-异常量 |
| | | BigDecimal picNormalCount = new BigDecimal(bigUseful.getSampleCount() - bigUseful.getBigPicExpCount()); |
| | | //图片抽检量 |
| | | BigDecimal sampleCount = new BigDecimal(bigUseful.getSampleCount()); |
| | | //图片访问率>=90% 视为合格 |
| | | if (picNormalCount.divide(sampleCount, 4, RoundingMode.HALF_UP).compareTo(new BigDecimal("0.9")) >= 0) { |
| | | stats.urlUsabilitySites++; |
| | | } |
| | | //图片访问率>=90% 视为合格 |
| | | if (VehicleDeviceSamplingResult.BigUsefulness.calUrl(bigUseful).compareTo(new BigDecimal("0.9")) >= 0) { |
| | | stats.urlUsabilitySites++; |
| | | } |
| | | } |
| | | |