refactor(event): 重构事件通知服务并优化异步处理
- 新增 AppNotificationService 处理应用通知推送逻辑 - 新增 SmsNotificationService 处理短信通知异步发送 - 添加 AsyncConfig 配置类定义事件和短信通知线程池 - 在 CsAlarmServiceImpl 中替换 sendEventUtils 为 appNotificationService - 在 EventServiceImpl 中替换 sendEventUtils 为 appNotificationService 和 smsNotificationService - 移除废弃的 SendEventUtils 工具类 - 优化暂降事件短信发送逻辑并支持幅值和持续时间参数 - 修复时序数据库时间处理注释说明,统一使用UTC时间转换 - 启用 Spring 异步注解支持事件和短信异步处理
This commit is contained in:
@@ -214,7 +214,7 @@ public class StatServiceImpl implements IStatService {
|
||||
//这边特殊处理,如果数据为3.14159,则将数据置为null
|
||||
fields.put(dataArrayList.get(i).getName(),Objects.equals(floats.get(i),3.14159f) ? null:floats.get(i));
|
||||
fields.put(InfluxDBTableConstant.IS_ABNORMAL,item.getDataTag());
|
||||
//fixme 这边前置传递的应该是UTC时间,但是前置说是传递的北京时间,讨论了一下没太理解。这边暂时先这样处理,influx入库处理成北京时间,减去8小时。
|
||||
//fixme 设备上送的是北京时间,时序数据库录入时 需要utc时间,减去8小时
|
||||
boolean flag = Objects.equals(DicDataEnum.DEV_CLD.getCode(), devType) && Objects.equals(accessMethod, "CLD");
|
||||
Point point = influxDbUtils.pointBuilder(tableName, flag?item.getDataTimeSec():item.getDataTimeSec()-8*3600, TimeUnit.SECONDS, tags, fields);
|
||||
BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
|
||||
|
||||
Reference in New Issue
Block a user