---
panlei
2019-11-19 7850c0b26dc32f1ccad56b705bb3bbfc0dcc883a
insertdata/insertDataToEs.go
@@ -49,8 +49,8 @@
   Content         string                `json:"content"`
   AlarmRules      []AlarmRule           `json:"alarmRules"`
   LikeDate        string                `json:"likeDate"`
   ShowLables      string                `json:"showLables"`
   OtherLables     string                `json:"otherLables"`
   ShowLabels      string                `json:"showLabels"`
   OtherLabels     string                `json:"otherLabels"`
   VideoUrl        string                `json:"videoUrl"`
   AnalyServerId   string                `json:"analyServerId"`
   AnalyServerName string                `json:"analyServerName"`
@@ -79,8 +79,8 @@
   Content         string                `json:"content"`
   AlarmRules      []AlarmRule           `json:"alarmRules"`
   LikeDate        string                `json:"likeDate"`
   ShowLables      string                `json:"showLables"`
   OtherLables     string                `json:"otherLables"`
   ShowLabels      string                `json:"showLabels"`
   OtherLabels     string                `json:"otherLabels"`
   VideoUrl        string                `json:"videoUrl"`
   AnalyServerId   string                `json:"analyServerId"`
   AnalyServerName string                `json:"analyServerName"`
@@ -97,7 +97,7 @@
type Target struct {
   TargetId       string  `json:"targetId"`
   TargetScore    float64 `json:"targetScore"`
   FaceFeature    string  `json:"faceFeature"`
   FaceFeature    string  `json:"feature"`
   PicSmUrl       string  `json:"picSmUrl"`
   TargetLocation Points  `json:"targetLocation"`
}
@@ -164,8 +164,7 @@
      panic("配置文件不合法")
   }
   weedfsUrl = "http://" + localConfig1.WebPicIp + ":" + strconv.Itoa(int(localConfig1.WebPicPort)) + "/submit"
   videoPersonUrl = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.VideoPersons.IndexName + "/" + EsInfo.EsIndex.VideoPersons.IndexType
   personAction = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.Personaction.IndexName + "/" + EsInfo.EsIndex.Personaction.IndexType
   videoPersonUrl = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.AIOcean.IndexName + "/" + EsInfo.EsIndex.AIOcean.IndexType
   InsertFace(msg)
   InsertYolo(msg)
   InsertTarget(msg)
@@ -220,6 +219,14 @@
                  target.TargetLocation = Points{TopLeft: Point{face.Location.X, face.Location.Y}, BottomRight: Point{face.Location.X + face.Location.Width, face.Location.Y + face.Location.Height}}
                  var targetInfos []Target
                  targetInfos = append(targetInfos, *target)
                  sdkname := ""
                  switch key {
                  case "face":
                     sdkname = "人脸"
                  case "plate":
                     sdkname = "车牌识别"
                  }
                  pervideo := PerVideoPicture{
                     face.Uuid,
                     msg.Cid,
@@ -229,8 +236,8 @@
                     imgMaxUrl,
                     msg.Tasklab.Taskid,
                     msg.Tasklab.Taskname,
                     "人脸",
                     time.Now().Format("2006-01-02 15:04:05"),
                     sdkname,
                     "",
                     alarmRules,
                     time.Now().Format("2006-01-02 15:04:05"), // 只检测,没有比对时间
                     lable,
@@ -259,7 +266,7 @@
                  if err1 != nil {
                     logger.Error("上传ES出错!---", err1)
                  } else {
                     logger.Info("插入es返回的信息(人脸):", resp1)
                     logger.Info("插入es返回的信息:", sdkname,"---",resp1)
                     // 发出录像信号
                     ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: face.Uuid, CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, VideoUrl: msg.Push.VideoUrl, ImgId: i.Id, SdkIds: []string{"-1"}, Type: 1})
                  }
@@ -465,7 +472,7 @@
               logger.Info("json parse error ", err)
               return
            }
            resp1, err2 := EsReq("POST", personAction, requstbody)
            resp1, err2 := EsReq("POST", videoPersonUrl, requstbody)
            if err2 != nil {
               logger.Error("往ES插入数据失败", err)
            } else {
@@ -626,7 +633,7 @@
                  logger.Info("json parse error ", err)
                  return
               }
               resp1, err2 := EsReq("POST", personAction, requstbody)
               resp1, err2 := EsReq("POST", videoPersonUrl, requstbody)
               if err2 != nil {
                  logger.Error("往ES插入数据失败", err)
               } else {