zhaobing’ 1 year ago
parent
commit
0e2b7329c7
  1. 8
      api/app/lib/index.js
  2. 8
      script/3.5/schema/1.add_alarm_code.sql

8
api/app/lib/index.js

@ -23,7 +23,7 @@ module.exports.entry = function (app, router, opts) {
app.fs.utils = app.fs.utils || {}; app.fs.utils = app.fs.utils || {};
app.fs.api.authAttr = app.fs.api.authAttr || {}; app.fs.api.authAttr = app.fs.api.authAttr || {};
app.fs.api.logAttr = app.fs.api.logAttr || {}; app.fs.api.logAttr = app.fs.api.logAttr || {};
// 顺序固定 ↓ // 顺序固定 ↓
redisConnect(app, opts) redisConnect(app, opts)
@ -35,7 +35,7 @@ module.exports.entry = function (app, router, opts) {
es(app, opts) es(app, opts)
// kafka(app, opts) kafka(app, opts)
// clickHouse 数据库 client // clickHouse 数据库 client
clickHouseClient(app, opts) clickHouseClient(app, opts)
@ -55,7 +55,7 @@ module.exports.entry = function (app, router, opts) {
router = routes(app, router, opts); router = routes(app, router, opts);
}; };
module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Sequelize, models: {} } module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Sequelize, models: {} }
@ -69,7 +69,7 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
AppInspection, ProjectApp, ProjectCorrelation, AppAlarm, App, AlarmAppearRecord, AlarmConfirmLog, EmailSendLog, LatestDynamicList, AlarmPushConfig, AppInspection, ProjectApp, ProjectCorrelation, AppAlarm, App, AlarmAppearRecord, AlarmConfirmLog, EmailSendLog, LatestDynamicList, AlarmPushConfig,
MaintenanceRecord, MaintenanceRecordExecuteUser, MaintenancePlanExecuteUser, MaintenancePlan, EquipmentMaintenanceRecord, EquipmentMaintenanceRecordProject, MaintenanceRecord, MaintenanceRecordExecuteUser, MaintenancePlanExecuteUser, MaintenancePlan, EquipmentMaintenanceRecord, EquipmentMaintenanceRecordProject,
EquipmentMaintenanceRecordExecuteUser, ServerMaintenanceRecordRepairman, ServerMaintenanceRecord, EquipmentMaintenanceRecordExecuteUser, ServerMaintenanceRecordRepairman, ServerMaintenanceRecord,
AlarmDataContinuityType, AlarmDataContinuity,AbnTypes,AbnReportParams AlarmDataContinuityType, AlarmDataContinuity, AbnTypes, AbnReportParams
} = dc.models; } = dc.models;
AppInspection.belongsTo(App, { foreignKey: 'projectAppId', targetKey: 'id' }); AppInspection.belongsTo(App, { foreignKey: 'projectAppId', targetKey: 'id' });

8
script/3.5/schema/1.add_alarm_code.sql

@ -16,13 +16,13 @@ INSERT INTO t_alarm_group_unit("id","name", "group_id") VALUES (49,'数据毛刺
IF NOT EXISTS(SELECT 1 FROM t_alarm_type WHERE name='识别到数据异常中断,产生告警,并已将告警信息推送至运维服务工程师。' AND code='3020' ) IF NOT EXISTS(SELECT 1 FROM t_alarm_type WHERE name='识别到数据异常中断,产生告警,并已将告警信息推送至运维服务工程师。' AND code='3020' )
THEN THEN
INSERT INTO t_alarm_type (code, name,description,category,enabled,alarm_group,alarm_group_unit,advice_problem) VALUES ('3020','识别到数据异常中断,产生告警,并已将告警信息推送至运维服务工程师。','数据中断',1,true, INSERT INTO t_alarm_type (code, name,description,category,enabled,alarm_group,alarm_group_unit,advice_problem) VALUES ('3020','识别到数据异常中断,产生告警,并已将告警信息推送至运维服务工程师。','数据中断',1,true,
1,(select id from "t_alarm_group_unit" where name='数据中断' LIMIT 1),'非软件处理'); 3,(select id from "t_alarm_group_unit" where name='数据中断' LIMIT 1),'非软件处理');
END IF; END IF;
IF NOT EXISTS(SELECT 1 FROM t_alarm_code WHERE name='数据中断' AND type_code='30200001' ) IF NOT EXISTS(SELECT 1 FROM t_alarm_code WHERE name='数据中断' AND type_code='30200001' )
THEN THEN
INSERT INTO t_alarm_code (code, name,type_code,level,enable,alarm_group,alarm_group_unit,advice_problem) VALUES ('30200001','数据中断','3020',1,true, INSERT INTO t_alarm_code (code, name,type_code,level,enable,alarm_group,alarm_group_unit,advice_problem) VALUES ('30200001','数据中断','3020',1,true,
1,(select id from "t_alarm_group_unit" where name='数据中断' LIMIT 1),'非软件处理'); 3,(select id from "t_alarm_group_unit" where name='数据中断' LIMIT 1),'非软件处理');
END IF; END IF;
-- 添加[数据异常趋势]告警类型 -- 添加[数据异常趋势]告警类型
@ -36,7 +36,7 @@ INSERT INTO t_alarm_group_unit("id","name", "group_id") VALUES (49,'数据毛刺
IF NOT EXISTS(SELECT 1 FROM t_alarm_code WHERE name='数据异常趋势' AND type_code='3021' ) IF NOT EXISTS(SELECT 1 FROM t_alarm_code WHERE name='数据异常趋势' AND type_code='3021' )
THEN THEN
INSERT INTO t_alarm_code (code, name,type_code,level,enable,alarm_group,alarm_group_unit,advice_problem) VALUES ('30210001','数据异常趋势','3021',1,true, INSERT INTO t_alarm_code (code, name,type_code,level,enable,alarm_group,alarm_group_unit,advice_problem) VALUES ('30210001','数据异常趋势','3021',1,true,
1,(select id from "t_alarm_group_unit" where name='数据异常趋势' LIMIT 1),'非软件处理'); 3,(select id from "t_alarm_group_unit" where name='数据异常趋势' LIMIT 1),'非软件处理');
END IF; END IF;
@ -51,7 +51,7 @@ INSERT INTO t_alarm_group_unit("id","name", "group_id") VALUES (49,'数据毛刺
IF NOT EXISTS(SELECT 1 FROM t_alarm_code WHERE name='数据毛刺' AND type_code='3022' ) IF NOT EXISTS(SELECT 1 FROM t_alarm_code WHERE name='数据毛刺' AND type_code='3022' )
THEN THEN
INSERT INTO t_alarm_code (code, name,type_code,level,enable,alarm_group,alarm_group_unit,advice_problem) VALUES ('30220001','数据毛刺','3022',1,true, INSERT INTO t_alarm_code (code, name,type_code,level,enable,alarm_group,alarm_group_unit,advice_problem) VALUES ('30220001','数据毛刺','3022',1,true,
1,(select id from "t_alarm_group_unit" where name='数据毛刺' LIMIT 1),'非软件处理'); 3,(select id from "t_alarm_group_unit" where name='数据毛刺' LIMIT 1),'非软件处理');
END IF; END IF;
END END

Loading…
Cancel
Save