fuliqi
2024-08-02 9ad9017702caff5147b27b2ba95ee38555c1b0d6
ycl-server/src/main/java/com/ycl/calculate/FaceSnapshotDataCalculation.java
File was renamed from ycl-server/src/main/java/com/ycl/calculate/FaceSiteOnlineCalculation.java
@@ -24,13 +24,14 @@
import java.util.stream.Collectors;
/**
 * 抓拍数据量监测结果接口数据
 * 计算人脸点位在线率、视图库对接稳定性
 * 获取分省厅、区域的map<k,v> k为deptId或者Province_deptId
 * 循环map计算点位在线率
 * 更新或新增
 */
@Component
public class FaceSiteOnlineCalculation extends IndexCalculationServe implements CalculationStrategy<SnapshotDataMonitorResult> {
public class FaceSnapshotDataCalculation extends IndexCalculationServe implements CalculationStrategy<SnapshotDataMonitorResult> {
    @Autowired
    private CheckIndexFaceMapper checkIndexFaceMapper;
    @Autowired
@@ -85,7 +86,9 @@
        areaStatsMap.forEach((deptId, stats) -> {
            if (stats.totalSites > 0) {
                CheckIndexFace checkIndexFace = createOrUpdateCheckIndexFace(deptId, stats, cityCountAvg, countyCountAvg, checkIndexFaceList);
                checkIndexFaces.add(checkIndexFace);
                if (checkIndexFace != null) {
                    checkIndexFaces.add(checkIndexFace);
                }
            }
        });
@@ -116,6 +119,9 @@
    //车辆点位在线率和视图库对接稳定性
    private CheckIndexFace createOrUpdateCheckIndexFace(String key, AreaStats stats, BigDecimal cityCountAvg, BigDecimal countyCountAvg, List<CheckIndexFace> checkIndexFaceList) {
        CheckIndexFace checkIndexFace = getCheckIndex(key, checkIndexFaceList, CheckIndexFace.class);
        if (checkIndexFace == null) {
            return null;
        }
        //调用点位在线计算方法
        Map<String, Object> siteOnlineParam = new HashMap<>();
        siteOnlineParam.put("totalSites", stats.totalSites);