Эх сурвалжийг харах

feat(事件),设计模块间的事件提交机制,和去除多余的isactive字段

xiaoguohua 5 өдөр өмнө
parent
commit
7950a3c731

+ 0 - 2
doc/数据库脚本/electricity_init_new.sql

@@ -3212,7 +3212,6 @@ CREATE TABLE alarm_event_template (
                                       category VARCHAR(50),
                                       content_format VARCHAR(500),
                                       color_code VARCHAR(20),
-                                      is_active SMALLINT NOT NULL DEFAULT 1,
                                       enable_flag BOOLEAN NOT NULL DEFAULT TRUE,
                                       del_flag BOOLEAN NOT NULL DEFAULT FALSE,
                                       create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -3229,7 +3228,6 @@ COMMENT ON COLUMN alarm_event_template.template_name IS '模板名称';
 COMMENT ON COLUMN alarm_event_template.category IS '告警分类(如:数据异常、设备故障、预测偏差)';
 COMMENT ON COLUMN alarm_event_template.content_format IS '内容模板(支持占位符,如:{station_name}发生{metric}偏差)';
 COMMENT ON COLUMN alarm_event_template.color_code IS 'UI展示颜色(如:#FF0000)';
-COMMENT ON COLUMN alarm_event_template.is_active IS '是否有效(1-有效,0-无效)';
 COMMENT ON COLUMN alarm_event_template.create_time IS '创建时间';
 COMMENT ON COLUMN alarm_event_template.update_time IS '更新时间';
 

+ 0 - 2
doc/数据库脚本/update/20261113-20261126/1.sql

@@ -21,7 +21,6 @@ CREATE TABLE alarm_event_template (
                                       category VARCHAR(50),
                                       content_format VARCHAR(500),
                                       color_code VARCHAR(20),
-                                      is_active SMALLINT NOT NULL DEFAULT 1,
                                       enable_flag BOOLEAN NOT NULL DEFAULT TRUE,
                                       del_flag BOOLEAN NOT NULL DEFAULT FALSE,
                                       create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -38,7 +37,6 @@ COMMENT ON COLUMN alarm_event_template.template_name IS '模板名称';
 COMMENT ON COLUMN alarm_event_template.category IS '告警分类(如:数据异常、设备故障、预测偏差)';
 COMMENT ON COLUMN alarm_event_template.content_format IS '内容模板(支持占位符,如:{station_name}发生{metric}偏差)';
 COMMENT ON COLUMN alarm_event_template.color_code IS 'UI展示颜色(如:#FF0000)';
-COMMENT ON COLUMN alarm_event_template.is_active IS '是否有效(1-有效,0-无效)';
 COMMENT ON COLUMN alarm_event_template.create_time IS '创建时间';
 COMMENT ON COLUMN alarm_event_template.update_time IS '更新时间';
 

+ 16 - 0
forecast-backend-server/模块集成说明.md

@@ -0,0 +1,16 @@
+# 事件登记说明
+    数据采集网关和功率预测模块等产生事件,也通业务平台来统一提交事件
+    sys_config中配置alarm_event_record_key校验密钥和alarm_event_record_url提交地址
+    POST:/alarm/eventRecord/inner, 非登录用户可调用,
+    request body
+        {
+            key,            // 来自sys_config中的 alarm_event_record_key,防止外部用户
+            station_id,     // 场站id
+            source,         // 发生源的唯一标识,典型的可以用id
+            rule_code,      // 和alarm_event_rule中的rule_code对应
+            alarm_time,		//发生时间
+            map<string, Object> values,  // 用于格式化的数据
+            action:open|close  // open表示发生了事件,如果该事件源的该事件还处于0,1态,则不再登记。close表示该事件消失了,如果该事件源的该事件还处于0,1态,则设置为已恢复
+        }
+    response
+        参考com.ufo.base.framework.web.domain.AjaxResult