| | |
| | | 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; |
| | |
| | | // 判断今天是否是本月的第一天 |
| | | 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()); |
| | |
| | | } |
| | | |
| | | //调用点位在线计算方法 |
| | | 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); |
| | |
| | | } |
| | | //视图库对接稳定性 |
| | | //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; |
| | |
| | | noDateCount++; |
| | | } |
| | | // 将新的值放回Hash中 |
| | | redisTemplate.opsForHash().put(ApiConstants.Check_Car_ViewConnect, key, noDateCount); |
| | | redisTemplate.opsForHash().put(CheckThreadConstants.Check_Car_ViewConnect, key, noDateCount); |
| | | return checkIndexCar; |
| | | } |
| | | } |