From 3e84ce972f45edc12b49e2cd3ab4635bb717321d Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 20 十二月 2019 11:03:54 +0800
Subject: [PATCH] fix bak
---
controllers/fileController.go | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/controllers/fileController.go b/controllers/fileController.go
index d66b079..32fefb3 100644
--- a/controllers/fileController.go
+++ b/controllers/fileController.go
@@ -190,8 +190,7 @@
PicDate string `json:"picDate"`
Content string `json:"content"`
IsAlarm bool `json:"isAlarm"`
- PicMaxUrl string `json:"picMaxUrl"`
- PicSmUrl []string `json:"picSmUrl"`
+ PicMaxUrl []string `json:"picMaxUrl"`
TargetInfo []TargetInfo `json:"targetInfo"`
TaskId string `json:"taskId"`
TaskName string `json:"taskName"`
@@ -203,6 +202,7 @@
type TargetInfo struct {
TargetId string `json:"targetId"`
+ TargetType string `json:"targetType"`
TargetScore float64 `json:"targetScore"`
Feature string `json:"feature"`
PicSmUrl string `json:"picSmUrl"`
@@ -215,15 +215,16 @@
}
type DbPersonVo struct {
+ TableId string `json:"tableId"`
+ TableName string `json:"tableName"`
BwType string `json:"bwType"`
CompareScore float64 `json:"compareScore"`
- MonitorLevel string `json:"monitorLevel"`
TargetId string `json:"targetId"`
TargetName string `json:"targetName"`
TargetPicUrl string `json:"targetPicUrl"`
+ MonitorLevel string `json:"monitorLevel"`
Labels string `json:"labels"`
- TableId string `json:"tableId"`
- TableName string `json:"tableName"`
+ Content string `json:"content"`
Enable int32 `json:"enable"`
}
@@ -253,13 +254,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)
}
@@ -282,8 +283,9 @@
MonitorLevel: p.MonitorLevel,
TargetName: p.PersonName,
TargetPicUrl: p.PersonPicUrl,
- Labels: p.Sex+" / "+p.IdCard+" / "+p.IdCard,
+ Labels: p.PhoneNum+"/"+p.Sex+"/"+p.IdCard,
TableId: p.TableId,
+ Content: p.Reserved,
Enable: p.Enable,
}
dbTableInfos, _ := dtApi.DbtablesById([]string{ p.TableId })
@@ -311,8 +313,8 @@
for _,p :=range vp.BaseInfo {
bi = append(bi, DbPersonVo{
TargetId: p.TargetId,
- CompareScore: float64(p.CompareScore),
- MonitorLevel: parseMonitorLevel(p.MonitorLevel),
+ CompareScore: util.ParseScore64(p.CompareScore),
+ MonitorLevel: p.MonitorLevel,
TargetName: p.TargetName,
TargetPicUrl: p.TargetPicUrl,
Labels: p.Labels,
@@ -336,7 +338,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,
@@ -347,6 +349,7 @@
}
tInfo := TargetInfo{
TargetId: vti.TargetId,
+ TargetType: vti.TargetType,
TargetScore: vti.TargetScore,
Feature: vti.Feature,
PicSmUrl: vti.PicSmUrl,
@@ -362,6 +365,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 +525,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 +612,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 +622,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