|
@@ -36,7 +36,7 @@ public class IotWarnBussinessService {
|
|
|
log.info("从缓存中获取到重复次数: {}", count);
|
|
log.info("从缓存中获取到重复次数: {}", count);
|
|
|
return count;
|
|
return count;
|
|
|
}
|
|
}
|
|
|
- IotWarncount iotWarncount = iotWarncountMapper.selectIotWarnCountByDevAndConfig(devId, configId);
|
|
|
|
|
|
|
+ IotWarncount iotWarncount = iotWarncountMapper.selectIotWarnCountByDevAndConfig(devId, configId);
|
|
|
if (iotWarncount == null) {
|
|
if (iotWarncount == null) {
|
|
|
log.warn("数据库中未找到设备ID: {}, 配置ID: {} 的重复次数数据", devId, configId);
|
|
log.warn("数据库中未找到设备ID: {}, 配置ID: {} 的重复次数数据", devId, configId);
|
|
|
return null;
|
|
return null;
|
|
@@ -76,7 +76,15 @@ public class IotWarnBussinessService {
|
|
|
|
|
|
|
|
public int resetReCount() {
|
|
public int resetReCount() {
|
|
|
log.info("重置所有重复次数");
|
|
log.info("重置所有重复次数");
|
|
|
- redisCacheManager.deleteObject(RedisCacheKey.IOT_WARN_RE_COUNTS, "*");
|
|
|
|
|
|
|
+ List<IotWarncount> iotWarncounts = iotWarncountMapper.getAllReCount();
|
|
|
|
|
+ for (IotWarncount iotWarncount : iotWarncounts) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ redisCacheManager.deleteObject(RedisCacheKey.IOT_WARN_RE_COUNTS, iotWarncount.getWcBid() + ":" + iotWarncount.getDevBid());
|
|
|
|
|
+ log.info("重置所有重复次数:配置id:{},设备id{},成功", iotWarncount.getWcBid() , iotWarncount.getDevBid());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.info("重置所有重复次数:配置id:{},设备id{},异常:{}", iotWarncount.getWcBid() , iotWarncount.getDevBid(), e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
int result = iotWarncountMapper.resetReCount();
|
|
int result = iotWarncountMapper.resetReCount();
|
|
|
log.info("重置所有重复次数结果: {}", result);
|
|
log.info("重置所有重复次数结果: {}", result);
|
|
|
return result;
|
|
return result;
|