|
|
@ -893,7 +893,10 @@ module.exports = function (app, opts) { |
|
|
|
} |
|
|
|
|
|
|
|
if (Object.keys(apMergeDeVeAlarms).length) { |
|
|
|
|
|
|
|
if (proDebug) { |
|
|
|
console.log(`查得数据异常、视频异常合并の告警:`); |
|
|
|
console.log(apMergeDeVeAlarms); |
|
|
|
} |
|
|
|
let deviceSensorRes = [] |
|
|
|
if (deviceIds.size) { |
|
|
|
const device4Search = [...deviceIds] |
|
|
@ -902,7 +905,10 @@ module.exports = function (app, opts) { |
|
|
|
SELECT iota_device_id, sensor FROM t_device_sensor WHERE iota_device_id IN (${device4Search.join(',')}, '-1') |
|
|
|
`).toPromise()
|
|
|
|
} |
|
|
|
|
|
|
|
if (proDebug) { |
|
|
|
console.log(`相关设备及测点信息:`); |
|
|
|
console.log(deviceSensorRes); |
|
|
|
} |
|
|
|
let alarmTitle = dataAlarmTitle.concat( |
|
|
|
videoAlarmTitle.slice(2).map(v => { |
|
|
|
return { |
|
|
@ -917,12 +923,7 @@ module.exports = function (app, opts) { |
|
|
|
let alarmData = [] |
|
|
|
for (let aKey in apMergeDeVeAlarms) { |
|
|
|
let curStrucAlarm = apMergeDeVeAlarms[aKey] |
|
|
|
if (proDebug) { |
|
|
|
console.log(`查得数据异常、视频异常合并の告警:`); |
|
|
|
console.log(apMergeDeVeAlarms); |
|
|
|
console.log(`相关设备及测点信息:`); |
|
|
|
console.log(deviceSensorRes); |
|
|
|
} |
|
|
|
|
|
|
|
for (let de of curStrucAlarm.data_exception) { |
|
|
|
if (!de.id) { |
|
|
|
let corSensor = deviceSensorRes.find(ds => ds.iota_device_id == de.SourceId) |
|
|
|