panlei
2019-09-29 0d08415bcbc5d1b260861365f26b0532771da2c5
insertdata/insertDataToEs.go
@@ -1,13 +1,12 @@
package insertdata
import (
   "basic.com/valib/logger.git"
   "encoding/base64"
   "encoding/json"
   "errors"
   "fmt"
   "net"
   "ruleprocess/cache"
   "basic.com/valib/logger.git"
   "strconv"
   "time"
@@ -192,7 +191,7 @@
            err = proto.Unmarshal(bdata, &i)
            if imgMaxUrl == "" {
               bigPhotoUrl := make(map[string]interface{})
               bigPhotoUrl, err = util.PostFormBufferData(weedfsUrl, i, uuid.NewV4().String())
               bigPhotoUrl, err = util.DrawPolygonOnImageForFace(msg.Cid, i, msg.RuleResult["face"].([]ruleserver.FaceResult), weedfsUrl)
               logger.Debug("========大图路径:", bigPhotoUrl)
               imgMaxUrl = bigPhotoUrl["fileUrl"].(string)
               picTime = i.Timestamp
@@ -243,9 +242,9 @@
               "",
               alarmRules,
               time.Now().Format("2006-01-02 15:04:05"), // 只检测,没有比对时间
               strconv.FormatUint(face.Id, 10),            //暂改为人脸id strconv.FormatUint(face.Id, 10)
               sex,            //暂改为人脸id strconv.FormatUint(face.Id, 10)
               face.ThftRes.Age,
               fmt.Sprintf("%.2f",face.Score), // 暂改为分值fmt.Sprintf("%.2f",face.Score)
               ageDescription, // 暂改为分值fmt.Sprintf("%.2f",face.Score)
               race,
               face.ThftRes.Smile,
               face.ThftRes.Beauty,
@@ -368,7 +367,7 @@
                     }
                     i := protomsg.Image{}
                     err = proto.Unmarshal(bdata, &i)
                     resp1, err1 := util.DrawPolygonOnImage(msg1.Cid, i, msg1.RuleResult["yolo"].([]ruleserver.Result), weedfsUrl)
                     resp1, err1 := util.DrawPolygonOnImageForYolo(msg1.Cid, i, msg1.RuleResult["yolo"].([]ruleserver.Result), weedfsUrl)
                     if err1 != nil {
                        logger.Error("缓存数据画框或上传图片服务器出错", err)
                     } else {
@@ -411,7 +410,7 @@
         if len(alarmRules) > 0 {
            isAlarm = 1
            //resp, err = util.PostFormBufferData(weedfsUrl, i, uuid.NewV4().String())
            resp, err = util.DrawPolygonOnImage(msg.Cid, i, msg.RuleResult["yolo"].([]ruleserver.Result), weedfsUrl)
            resp, err = util.DrawPolygonOnImageForYolo(msg.Cid, i, msg.RuleResult["yolo"].([]ruleserver.Result), weedfsUrl)
            if err != nil {
               logger.Error("画框或上传图片服务器出错", err)
               return