Browse Source

视频告警抓取测点信息

dev
巴林闲侠 2 years ago
parent
commit
81d5d48559
  1. 25
      api/app/lib/controllers/alarm/video.js

25
api/app/lib/controllers/alarm/video.js

@ -87,7 +87,9 @@ async function alarmList (ctx) {
camera_status.describe AS statusDescribe, camera_status.describe AS statusDescribe,
camera_status_resolve.resolve AS resolve, camera_status_resolve.resolve AS resolve,
"gbCamera".online AS cameraOnline, "gbCamera".online AS cameraOnline,
anxinIpc.t_video_ipc.name, anxinIpc.t_video_ipc.name AS anxinIpcPosition,
anxinStation.id AS anxinStationId,
anxinStation.name AS anxinStationName,
anxinStruc.name AS strucName, anxinStruc.name AS strucName,
anxinStruc.id AS strucId anxinStruc.id AS strucId
FROM FROM
@ -144,6 +146,10 @@ async function alarmList (ctx) {
AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo
LEFT JOIN ${anxinyun}.t_structure AS anxinStruc LEFT JOIN ${anxinyun}.t_structure AS anxinStruc
ON anxinStruc.id = anxinIpc.structure ON anxinStruc.id = anxinIpc.structure
LEFT JOIN ${anxinyun}.t_video_ipc_station AS anxinIpcStation
ON anxinIpcStation.ipc = anxinIpc.id
LEFT JOIN ${anxinyun}.t_sensor AS anxinStation
ON anxinStation.id = anxinIpcStation.station
` `
).toPromise() ).toPromise()
@ -165,6 +171,13 @@ async function alarmList (ctx) {
name: a.strucName name: a.strucName
}) })
} }
if (a.anxinStationId && !curD.station.some(s => s.id == a.anxinStationId)) {
curD.station.push({
id: a.anxinStationId,
name: a.anxinStationName,
position: a.anxinIpcPosition
})
}
} else { } else {
let d = { let d = {
cameraId: a.cameraId, cameraId: a.cameraId,
@ -185,7 +198,8 @@ async function alarmList (ctx) {
cameraKindId: a.cameraKindId, cameraKindId: a.cameraKindId,
resolve: [], resolve: [],
struc: [] struc: [],
station: []
} }
if (a.resolveId) { if (a.resolveId) {
d.resolve.push({ d.resolve.push({
@ -199,6 +213,13 @@ async function alarmList (ctx) {
name: a.strucName name: a.strucName
}) })
} }
if (a.anxinStationId) {
d.station.push({
id: a.anxinStationId,
name: a.anxinStationName,
position: a.anxinIpcPosition
})
}
returnD.push(d) returnD.push(d)
positionD[a.cameraId] = { positionD[a.cameraId] = {
positionReturnD: returnD.length - 1 positionReturnD: returnD.length - 1

Loading…
Cancel
Save