From 96b5724025d3ed9181ebdbb2acdb0d8eddf5282a Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 9 Nov 2022 16:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=AE=BE=E5=A4=87=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=EF=BC=8C=E6=97=A0=E7=B1=BB=E5=9E=8B=E6=88=96=E6=9C=AA?= =?UTF-8?q?=E5=A1=AB=E5=86=99=EF=BC=8C=E5=88=99=E9=BB=98=E8=AE=A4=E5=85=B6?= =?UTF-8?q?=E4=BB=96=EF=BC=8C=E7=9B=B8=E5=85=B3=E7=AD=9B=E9=80=89=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/alarm/video.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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