From 0675d2616534c4efe8575ec9f6ced4ac3a98d908 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 20 十一月 2019 17:25:44 +0800
Subject: [PATCH] fix

---
 controllers/fileController.go |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/controllers/fileController.go b/controllers/fileController.go
index d66b079..07cb985 100644
--- a/controllers/fileController.go
+++ b/controllers/fileController.go
@@ -336,7 +336,7 @@
 			}
 			var ti = make([]TargetInfo,0)
 			if vp.TargetInfo !=nil {
-				for _,vti :=range ti {
+				for _,vti :=range vp.TargetInfo {
 					tl := protomsg.Location{
 						X: vti.TargetLocation.TopLeft.X,
 						Y: vti.TargetLocation.TopLeft.Y,
@@ -362,6 +362,7 @@
 				Id: vp.Id,
 				CompareScore: captureM[vp.Id].CompareScore,
 				CameraId: vp.CameraId,
+				CameraName: vp.CameraName,
 				CameraAddr: vp.CameraAddr,
 				PicDate: vp.PicDate,
 				PicMaxUrl: vp.PicMaxUrl,
@@ -521,8 +522,9 @@
 	} else {
 		arg.TableIds = []string{}
 	}
+	alarmLevelTypes := strings.Replace(strings.Trim(fmt.Sprint(getAlarmLevel(searchBody.AlarmLevel)), "[]"), " ", "\",\"", -1)
 	arg.Source = true // 鏍囪瘑鏉ユ簮鏄痺eb
-	arg.AlarmLevel = searchBody.AlarmLevel
+	arg.AlarmLevel = alarmLevelTypes
 	arg.Tasks = searchBody.Tasks
 	arg.TreeNodes = searchBody.TreeNodes
 	arg.Tabs = searchBody.Tabs
@@ -607,8 +609,9 @@
 		}
 		localConf, err := cache.GetServerInfo()
 		if err ==nil && localConf.AlarmIp != "" && localConf.ServerId != "" {
+			alarmLevelTypes := strings.Replace(strings.Trim(fmt.Sprint(getAlarmLevel(searchBody.AlarmLevel)), "[]"), " ", "\",\"", -1)
 			arg.Source = true // 鏍囪瘑鏉ユ簮鏄痺eb
-			arg.AlarmLevel = searchBody.AlarmLevel
+			arg.AlarmLevel = alarmLevelTypes
 			arg.Tasks = searchBody.Tasks
 			arg.TreeNodes = searchBody.TreeNodes
 			arg.Tabs = searchBody.Tabs
@@ -616,7 +619,7 @@
 			arg.InputValue = searchBody.InputValue
 			arg.Collection = searchBody.Collection
 			arg.AnalyServerId = localConf.ServerId
-			alarmLevelTypes := strings.Replace(strings.Trim(fmt.Sprint(getAlarmLevel(searchBody.AlarmLevel)), "[]"), " ", "\",\"", -1)
+
 			captureIds := esApi.GetAllLocalVideopersonsId(arg, config.EsInfo.EsIndex.AiOcean.IndexName, localConf.AlarmIp, strconv.Itoa(int(localConf.AlarmPort)), alarmLevelTypes)
 			logger.Debug("searchPhoto first Result.len:",len(*co.CompareData),"twice len(captureIds):",len(captureIds))
 			if captureIds !=nil {

--
Gitblit v1.8.0