From 2a9fb82298812743d13e7e590aa08ec94ac9c085 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期二, 26 十一月 2019 14:43:12 +0800
Subject: [PATCH] ---

---
 insertdata/insertDataToEs.go |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/insertdata/insertDataToEs.go b/insertdata/insertDataToEs.go
index af65412..f7d7143 100644
--- a/insertdata/insertDataToEs.go
+++ b/insertdata/insertDataToEs.go
@@ -154,6 +154,7 @@
 				faces = PutFace(faces, results.([]structure.Result))
 				//logger.Info("鏁寸悊鍚庣殑鏁版嵁锛�",faces)
 				if faces != nil {
+					logger.Warn("face涓嶄负nil")
 					var imgMaxUrl []string = []string{}
 					var picTime string = ""
 					for _, face := range faces {
@@ -164,6 +165,7 @@
 							panic("瑙e帇缂╁浘鐗囨椂鍑虹幇閿欒")
 						}
 						alarmRules := []AlarmRule{}
+						logger.Info("寰幆姣忎竴涓洰鏍�")
 						for _, faceResult := range face.rules {
 							alarm := ChangeToString(faceResult.DefenceState, faceResult.AlarmLevel)
 							alarmRules = append(alarmRules, AlarmRule{faceResult.RuleGroupId, alarm, faceResult.RuleText, faceResult.DefenceState, ""})
@@ -171,7 +173,7 @@
 						i := protomsg.Image{}
 						err = proto.Unmarshal(bdata, &i)
 						// 鍏堜紶灏忓浘锛屽啀浼犲ぇ鍥撅紝闃叉鑴镐笂鏈夌嚎
-						bytes := util.SubImg(i, int(face.Location.X), int(face.Location.Y), int(face.Location.X+face.Location.Width), int(face.Location.Y+face.Location.Height))
+						bytes := util.SubImg(i, int(face.Location.X), int(face.Location.Y), int(face.Location.X+face.Location.Width), int(face.Location.Y+face.Location.Height),face.Type)
 						resp, err := util.PostFormBufferData1(weedfsUrl, bytes, uuid.NewV4().String())
 						if err != nil {
 							logger.Error("涓婁紶灏忓浘鍑洪敊")
@@ -361,7 +363,7 @@
 							var target1 = new(Target)
 							target1.TargetId = target.Id
 							target1.TargetScore = target.Score
-							target1.TargetType = target.Type
+							target1.TargetType = "action"
 							target1.TargetLocation = Points{TopLeft: Point{target.Location.X, target.Location.Y}, BottomRight: Point{target.Location.X + target.Location.Width, target.Location.Y + target.Location.Height}}
 							targetInfos = append(targetInfos, *target1)
 						}
@@ -562,7 +564,7 @@
 						var target1 = new(Target)
 						target1.TargetId = target.Id
 						target1.TargetScore = target.Score
-						target1.TargetType = target.Type
+						target1.TargetType = "action"
 						target1.TargetLocation = Points{TopLeft: Point{target.Location.X, target.Location.Y}, BottomRight: Point{target.Location.X + target.Location.Width, target.Location.Y + target.Location.Height}}
 						targetInfos = append(targetInfos, *target1)
 					}

--
Gitblit v1.8.0