fuliqi
2024-08-21 9da24a8dfa3766cec565b092fc105f7f006de070
ycl-server/src/main/java/com/ycl/calculate/FaceSnapshotDataCalculation.java
@@ -11,9 +11,7 @@
import com.ycl.platform.service.ICheckIndexFaceService;
import com.ycl.platform.service.ITMonitorService;
import com.ycl.system.mapper.SysConfigMapper;
import constant.ApiConstants;
import constant.CheckConstants;
import constant.CheckSnapCountConstants;
import constant.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@@ -78,7 +76,7 @@
        // 判断今天是否是本月的第一天
        if (today.equals(firstDayOfMonth)) {
            // 如果是,则清除Redis中记录中断次数的数据
            redisTemplate.delete(ApiConstants.Check_Face_ViewConnect);
            redisTemplate.delete(RedisConstant.Check_Face_ViewConnect);
        }
        for (SnapshotDataMonitorResult result : list) {
            TMonitorVO monitor = monitorMap.get(result.getExternalIndexCode());
@@ -141,7 +139,7 @@
            return null;
        }
        //调用点位在线计算方法
        if (stats.totalSites >= ApiConstants.Check_Face_SiteOnline) {
        if (stats.totalSites >= CheckThreadConstants.Check_Face_SiteOnline) {
            Map<String, Object> siteOnlineParam = new HashMap<>();
            siteOnlineParam.put("totalSites", stats.totalSites);
            siteOnlineParam.put("onlineSites", stats.onlineSites);
@@ -152,7 +150,7 @@
        }
        //视图库对接稳定性
        //Redis记录该区县当月无数据上传次数
        Integer noDateCount = (Integer) redisTemplate.opsForHash().get(ApiConstants.Check_Face_ViewConnect, key);
        Integer noDateCount = (Integer) redisTemplate.opsForHash().get(RedisConstant.Check_Face_ViewConnect, key);
        // 如果值为null,则初始化为0
        if (noDateCount == null) {
            noDateCount = 0;
@@ -170,7 +168,7 @@
            noDateCount++;
        }
        // 将新的值放回Hash中
        redisTemplate.opsForHash().put(ApiConstants.Check_Face_ViewConnect, key, noDateCount);
        redisTemplate.opsForHash().put(RedisConstant.Check_Face_ViewConnect, key, noDateCount);
        return checkIndexFace;
    }
}