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

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

diff --git a/controllers/fileController.go b/controllers/fileController.go
index d66b079..e31f95c 100644
--- a/controllers/fileController.go
+++ b/controllers/fileController.go
@@ -253,13 +253,13 @@
 		if v.Tableid == service.CaptureTable {
 			captureM[v.Id] = ScoreIndex{
 				Index: idx,
-				CompareScore: float64(v.CompareScore),
+				CompareScore: util.ParseScore64(float64(v.CompareScore)),
 			}
 			captureIds = append(captureIds,v.Id)
 		} else {
 			dbPersonM[v.Id] = ScoreIndex{
 				Index: idx,
-				CompareScore: float64(v.CompareScore),
+				CompareScore: util.ParseScore64(float64(v.CompareScore)),
 			}
 			personIds = append(personIds,v.Id)
 		}
@@ -311,7 +311,7 @@
 			for _,p :=range vp.BaseInfo {
 				bi = append(bi, DbPersonVo{
 					TargetId: p.TargetId,
-					CompareScore: float64(p.CompareScore),
+					CompareScore: util.ParseScore64(p.CompareScore),
 					MonitorLevel: parseMonitorLevel(p.MonitorLevel),
 					TargetName: p.TargetName,
 					TargetPicUrl: p.TargetPicUrl,
@@ -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