| | |
| | | package com.ycl.calculate; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ycl.platform.domain.entity.CheckIndexCar; |
| | | import com.ycl.platform.domain.entity.YwPoint; |
| | | import com.ycl.platform.domain.result.HK.VehicleDeviceInspectionResult; |
| | | import com.ycl.platform.mapper.CheckIndexCarMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.mapper.YwPointMapper; |
| | | import com.ycl.platform.service.ICheckIndexCarService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 计算车辆时钟准确性 |
| | |
| | | @Override |
| | | public void calculate(List<VehicleDeviceInspectionResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | //时钟准确率大于90%为合格设备 |
| | | if (result.getSnapClock().getClockPercent() >= 0.9) { |
| | | if (result.getSnapClock()!=null && result.getSnapClock().getClockPercent()!=null && result.getSnapClock().getClockPercent() >= 0.9) { |
| | | stats.accuracySites++; |
| | | } |
| | | } |