fuliqi
2024-08-19 fbe06367836796f584984e021729002b3707c26b
ycl-server/src/main/java/com/ycl/calculate/CarSnapshopDataCalculation.java
@@ -10,6 +10,7 @@
import com.ycl.utils.DateUtils;
import constant.ApiConstants;
import constant.CheckSnapCountConstants;
import constant.CheckThreadConstants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@@ -73,7 +74,7 @@
        // 判断今天是否是本月的第一天
        if (today.equals(firstDayOfMonth)) {
            // 如果是,则清除Redis中记录中断次数的数据
            redisTemplate.delete(ApiConstants.Check_Car_ViewConnect);
            redisTemplate.delete(CheckThreadConstants.Check_Car_ViewConnect);
        }
        for (SnapshotDataMonitorResult result : list) {
            TMonitorVO monitor = monitorMap.get(result.getExternalIndexCode());
@@ -144,7 +145,7 @@
        }
        //调用点位在线计算方法
        if (stats.totalSites >= ApiConstants.Check_Car_SiteOnline) {
        if (stats.totalSites >= CheckThreadConstants.Check_Car_SiteOnline) {
            Map<String, Object> siteOnlineParam = new HashMap<>();
            siteOnlineParam.put("totalSites", stats.totalSites);
            siteOnlineParam.put("onlineSites", stats.onlineSites);
@@ -155,7 +156,7 @@
        }
        //视图库对接稳定性
        //Redis记录该区县当月无数据上传次数
        Integer noDateCount = (Integer) redisTemplate.opsForHash().get(ApiConstants.Check_Car_ViewConnect, key);
        Integer noDateCount = (Integer) redisTemplate.opsForHash().get(CheckThreadConstants.Check_Car_ViewConnect, key);
        // 如果值为null,则初始化为0
        if (noDateCount == null) {
            noDateCount = 0;
@@ -173,7 +174,7 @@
            noDateCount++;
        }
        // 将新的值放回Hash中
        redisTemplate.opsForHash().put(ApiConstants.Check_Car_ViewConnect, key, noDateCount);
        redisTemplate.opsForHash().put(CheckThreadConstants.Check_Car_ViewConnect, key, noDateCount);
        return checkIndexCar;
    }
}