panlei
2019-11-06 e85732bde0865f46195d1c74253ce491df6f702e
insertdata/insertDataToEs.go
@@ -208,19 +208,6 @@
               imgMaxUrl = bigPhotoUrl["fileUrl"].(string)
               picTime = i.Timestamp
            }
            // 人脸检测,没有相似的底库人员
            localConfig, err := cache.GetServerInfo()
            if err != nil {
               logger.Error("查询本机信息失败!")
            }
            serverIp, err := GetLocalIP()
            // 查询cameraName
            camera, err := cache.GetCameraById(msg.Cid)
            if err != nil {
               logger.Error("查询摄像机信息失败")
            }
            //logger.Info("================小图地址:", resp["fileUrl"].(string))
            sex := ""
            logger.Info(sex)
            if face.ThftRes.Gender == 1 {
@@ -245,7 +232,7 @@
            pervideo := PerVideoPicture{
               esDataId,
               msg.Cid,
               camera.Addr,
               msg.Push.Cam.Addr,
               picTime,
               imgMaxUrl,
               msg.Tasklab.Taskid,
@@ -263,9 +250,9 @@
               base64.StdEncoding.EncodeToString(face.Feature),
               []string{resp["fileUrl"].(string)},
               "暂无集群",
               localConfig.ServerId,
               localConfig.ServerName,
               serverIp,
               msg.Push.ServerId,
               msg.Push.ServerName,
               msg.Push.LocalIp,
               "",
               linksId,
               face.Score,
@@ -288,7 +275,7 @@
            } else {
               logger.Info("插入es返回的信息:", resp1)
               // 发出录像信号
               ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: esDataId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, ImgId: i.Id, SdkIds: []string{}, Type: 1})
               ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: esDataId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, VideoUrl:msg.Push.VideoUrl,ImgId: i.Id, SdkIds: []string{}, Type: 1})
            }
         }
      }
@@ -455,20 +442,7 @@
            // 不是报警数据不存
            return
         }
         // logger.Println("图片上传返回值:", resp)
         // 查询本机信息
         localConfig, err := cache.GetServerInfo()
         if err != nil {
            logger.Error("查询本机信息失败!")
         }
         // 查询cameraName
         camera, err := cache.GetCameraById(msg.Cid)
         if err != nil {
            logger.Error("查询摄像机信息失败")
         }
         logger.Info("摄像机信息:",camera)
         serverIp, err := GetLocalIP()
         logger.Info("%%%%%%%%%%%%%%%%%yolo的target信息:",targetInfos)
         if resp["fileUrl"] != nil {
            url = append(url, resp["fileUrl"].(string))
            esDataId := uuid.NewV4().String()
@@ -479,16 +453,16 @@
            peraction := Personaction{
               esDataId,
               msg.Cid,
               camera.Name,
               camera.Addr,
               msg.Push.Cam.Name,
               msg.Push.Cam.Addr,
               msg.Tasklab.Taskid,
               msg.Tasklab.Taskname,
               sdkNames,
               "",
               alarmRules,
               localConfig.ServerId,
               localConfig.ServerName,
               serverIp,
               msg.Push.ServerId,
               msg.Push.ServerName,
               msg.Push.LocalIp,
               "",
               url,
               i.Timestamp,
@@ -513,7 +487,8 @@
            } else {
               logger.Debug("插入es返回的数据信息是:", resp1)
               // 发出录像信号
               ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: esDataId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, ImgId: i.Id, SdkIds: []string{}, Type: 2})
               logger.Info("给录像的视频地址:",msg.Push.VideoUrl)
               ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: esDataId, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid,VideoUrl:msg.Push.VideoUrl, ImgId: i.Id, SdkIds: []string{}, Type: 2})
               logger.Warn("__________________________________________往ES插入yolo数据成功")
               //os.Exit(1)
            }