554325746@qq.com
2019-12-23 0222e79afe45d9fc55aed9a7e62ca239c228ab73
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 // 标识来源是web
   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 // 标识来源是web
         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 {