Browse Source

告警推送++

dev
CODE 1 year ago
parent
commit
410e2ff47b
  1. 7
      api/app/lib/schedule/alarms_push.js

7
api/app/lib/schedule/alarms_push.js

@ -1,7 +1,7 @@
const moment = require('moment') const moment = require('moment')
let isDev = false let isDev = false
isDev = true // isDev = true
let proDebug = false let proDebug = false
proDebug = true proDebug = true
@ -130,6 +130,7 @@ module.exports = function (app, opts) {
pepProject_name.push({ id: poms.id, anxinProjectId: poms.anxinProjectId, name: corPepProject.project_name }) pepProject_name.push({ id: poms.id, anxinProjectId: poms.anxinProjectId, name: corPepProject.project_name })
} else { } else {
// 不符合当前项目的时间节点 // 不符合当前项目的时间节点
pLog(`不符合当前项目的时间节点`)
continue continue
} }
} else { } else {
@ -220,6 +221,7 @@ module.exports = function (app, opts) {
searchStrucIds.unshift(-1) searchStrucIds.unshift(-1)
} else { } else {
// 没有结构物可查 // 没有结构物可查
pLog(`没有结构物可查`)
continue continue
} }
let pepProjectName = let pepProjectName =
@ -1108,6 +1110,7 @@ module.exports = function (app, opts) {
pLog(`异常比率 ${rate} 设定值 ${deviceProportion}`) pLog(`异常比率 ${rate} 设定值 ${deviceProportion}`)
if (rate < parseFloat(deviceProportion)) { if (rate < parseFloat(deviceProportion)) {
// 设备异常率低于设定值 // 设备异常率低于设定值
pLog(`异常设备率低于设定值`)
continue continue
} }
@ -1687,7 +1690,7 @@ module.exports = function (app, opts) {
html: html html: html
}) })
//存日志 存动态 socket到前端 // //存日志 存动态 socket到前端
let dataToSave = { let dataToSave = {
time: moment().format(), time: moment().format(),
pushConfigId: c.id, pushConfigId: c.id,

Loading…
Cancel
Save