diff --git a/api/app/lib/controllers/alarm/video.js b/api/app/lib/controllers/alarm/video.js index 323c456..3c7a959 100644 --- a/api/app/lib/controllers/alarm/video.js +++ b/api/app/lib/controllers/alarm/video.js @@ -1,7 +1,7 @@ 'use strict'; const moment = require('moment') const { alarmConfirmLog } = require('./alarmConfirmLog'); -async function deviceType(ctx) { +async function deviceType (ctx) { try { const { models } = ctx.fs.dc; const { clickHouse } = ctx.app.fs @@ -21,7 +21,7 @@ async function deviceType(ctx) { } } -async function alarmList(ctx) { +async function alarmList (ctx) { try { const { models } = ctx.fs.dc; const { clickHouse } = ctx.app.fs @@ -46,7 +46,11 @@ async function alarmList(ctx) { } } if (kindId) { - cameraWhereOption.push(`camera.kind_id = ${kindId}`) + let sql = `camera.kind_id = ${kindId}` + if (kindId == 1314) { + sql = `(camera.kind_id = ${kindId} OR camera.kind_id IS null)` + } + cameraWhereOption.push(sql) } let statusAlarmWhereOption = [] @@ -262,7 +266,7 @@ async function alarmList(ctx) { } } -async function confirm(ctx) { +async function confirm (ctx) { try { const { alarmId, content, confirmPost } = ctx.request.body; // TODO: 以视频·应用的秘钥进行鉴权 @@ -288,7 +292,7 @@ let structsAche = { dataList: [], expireTime: null//10分钟更新一次结构物列表 } -async function getStructsAche(ctx) { +async function getStructsAche (ctx) { const { utils: { getAxyStructs } } = ctx.app.fs try { if (!structsAche.dataList.length || moment() > moment(structsAche.expireTime)) { @@ -302,7 +306,7 @@ async function getStructsAche(ctx) { } } -async function alarmAdded(ctx) { +async function alarmAdded (ctx) { try { const { models } = ctx.fs.dc; const { clickHouse } = ctx.app.fs @@ -362,7 +366,7 @@ async function alarmAdded(ctx) { } } -async function vcmpAppAuthToken(ctx) { +async function vcmpAppAuthToken (ctx) { try { const { models } = ctx.fs.dc; const { utils: { vcmpAuth } } = ctx.app.fs