Browse Source

告警推送++

dev
CODE 1 year ago
parent
commit
9750566ce8
  1. 14
      api/app/lib/schedule/alarms_push.js

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

@ -654,8 +654,6 @@ module.exports = function (app, opts) {
}, {
n: '告警信息',
k: 'AlarmContent'
}, {
}, {
n: '告警等级(当前)',
k: '',
@ -1045,12 +1043,9 @@ module.exports = function (app, opts) {
* 以测点关联
*/
if (
isDev ||
(
apMergeDeVeAnxinProjectId_.length &&
d.SourceName && d.SourceName.includes('扬尘') &&
apMergeDeVeAnxinProjectId_.some(pid => pid == (strucMap[d.StructureId] || {}).projectId)
)
) {
// SourceTypeId 0: 'DTU' / 1: '传感器' / 2: '测点'
@ -1121,9 +1116,9 @@ module.exports = function (app, opts) {
.replace('**', abnormalDeviceCount.toFixed(0))
}
// 注1
if (apMergeDeVeAnxinProjectId_.length || isDev) {
if (apMergeDeVeAnxinProjectId_.length) {
for (let a of videoAlarms) {
let existStruc = a.struc.find(asc => apMergeDeVeAlarms[asc.id] || isDev)
let existStruc = a.struc.find(asc => apMergeDeVeAlarms[asc.id])
if (existStruc) {
apMergeDeVeAlarms[existStruc.id].video_exception.push(a)
}
@ -1631,10 +1626,11 @@ module.exports = function (app, opts) {
de.id = corSensor.sensor
}
}
let corVideoException = curStrucAlarm.video_exception.filter(v => {
let corVideoException =
curStrucAlarm.video_exception ? curStrucAlarm.video_exception.filter(v => {
// ! de.id 是告警信息关联查出来的测点的id
return v.station.some(vs => vs.id == de.id)
})
}) : []
if (!corVideoException.length) {
// 构造一个长度 以便在for循环里把 data_exception 放进去
corVideoException.push({})

Loading…
Cancel
Save