panlei
2019-07-15 4d44e346df3af148255a1dc3c35b35883ae8542b
ruleserver/readyDataForRule.go
@@ -6,7 +6,6 @@
   "basic.com/pubsub/protomsg.git"
   "basic.com/pubsub/sdkcompare.git"
   "encoding/json"
   "fmt"
   "ruleprocess/cache"
   "ruleprocess/logger"
   "strconv"
@@ -17,6 +16,20 @@
   bigCache.Init()
}
type BaseInfo struct {
   TableId string `json:"tableId"`
   TableName string `json:"tableName"`
   BwType string `json:"bwType"`
   CompareScore float64 `json:"compareScore"`
   PersonId string    `json:"personId"`
   PersonName string   `json:"personName"`
   PersonPicUrl string `json:"personPicUrl"`
   PhoneNum string `json:"phoneNum"`
   Sex string `json:"sex"`
   IdCard string `json:"idCard"`
   MonitorLevel string `json:"monitorLevel"`
   Content string `json:"content"`
}
// 以摄像机id查出跟其相关的所有任务下的所有规则组
func GetRuleGroup(cameraId string) []*protomsg.TaskGroupArgs {
   all := cache.GetCameraTaskRulesByCameraId(cameraId)
@@ -114,7 +127,7 @@
   if err1 != nil {
      logger.Error("查询底库人员信息出错", err1)
   }
   fmt.Println("底库人员信息:",baseinfos)
   logger.Debug("----------------++++++++++++++++++++底库人员信息:",baseinfos)
   //baseinfo.CompareScore = Retain(val)
   //arg.Liker = append(arg.Liker, &baseinfo)
   //logger.Info("------------------第一次看args:",*arg)
@@ -191,7 +204,7 @@
      if threshold <= obj.Score && size <= float64(obj.Rects.Width*obj.Rects.Height) && intersectionper <= PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale) {
         // 这步要备齐表达式里所需要的所有参数
         a.targetNum++
         arg1 := Arg{obj.Score, PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*protomsg.Baseinfo{}}
         arg1 := Arg{obj.Score, PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*BaseInfo{}}
         //logger.Println("放进去的arg:-------", arg1)
         a.args = append(a.args, &arg1)
         a.filterData = append(a.filterData, &arg1)