panlei
2019-08-01 408290cf3fe23f639c8718d984d66809fad50ed8
---看看比分
1个文件已修改
9 ■■■■ 已修改文件
ruleserver/readyDataForRule.go 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/readyDataForRule.go
@@ -13,7 +13,9 @@
    "strconv"
    "time"
)
var serverIp,serverPort,dbTablePersons string
type conf struct {
    PhotoUrl       string `yaml:"photoUrl"`
    VideoPersons   string `yaml:"videoPersons"`
@@ -22,6 +24,7 @@
    ServerPort     string `yaml:"serverPort"`
    DbTablePersons string `yaml:"dbTablePersons"`
}
func Init() {
    data, err := ioutil.ReadFile("./config/conf.yml")
    if err != nil {
@@ -57,6 +60,7 @@
    MonitorLevel string `json:"monitorLevel"`
    Content string `json:"content"`
}
// 以摄像机id查出跟其相关的所有任务下的所有规则组
func GetRuleGroup(cameraId string,taskId string) *protomsg.TaskGroupArgs {
    all := cache.GetCameraTaskRulesByCameraId(cameraId)
@@ -69,6 +73,7 @@
    }
    return taskGroup
}
// 根据摄像机id拿到摄像机所有区域
func GetPolygons(cameraId string) []protomsg.CameraPolygon {
    var cameraPolygons []protomsg.CameraPolygon
@@ -104,7 +109,6 @@
    }
    return nil
}
// 根据传入的字符串得到其在一周内的索引 周一到周日分别对应1到7
func getIndexOfWeek(weekday string) int {
@@ -174,14 +178,15 @@
            if err != nil || len(table) == 0{
                logger.Error("根据id查询底库信息出错!",err,"--返回值长度为:",len(table))
            }
            logger.Debug("看看这个base的对比值是多少:",Retain(m[baseinfo.Id]) * 100)
            base := BaseInfo{TableId:baseinfo.TableId,TableName:table[0].TableName,BwType:table[0].BwType,CompareScore:Retain(m[baseinfo.Id])*100,PersonId:baseinfo.Id,PersonName:baseinfo.PersonName,PersonPicUrl:baseinfo.PersonPicUrl,PhoneNum:baseinfo.PhoneNum,Sex:baseinfo.Sex,IdCard:baseinfo.IdCard,MonitorLevel:baseinfo.MonitorLevel,Content:baseinfo.Reserved}
            //logger.Debug("看看这个base的对比值是多少:",base)
            //os.Exit(1)
            arg.Liker = append(arg.Liker, &base)
        }
    }
}
// 人脸比对
func Compare(args *SdkDatas, groupRule *protomsg.GroupRule) {
    compareFlag := 0