panlei
2019-08-01 7fa8354721afe641341e1c161ee02138dccc422b
ruleserver/readyDataForRule.go
@@ -92,7 +92,10 @@
   // float32与float64互转会有位数保留不准的问题
   return v
}
func Decimal(value float64) float64 {
   value, _ = strconv.ParseFloat(fmt.Sprintf("%.4f", value), 64)
   return value
}
// 取出某个时间规则的第几天的规则段集合
func GetTimeById(id string, index int) []TimeRange {
   _, cameraTimeRule := cache.GetTimeRuleById(id)
@@ -179,7 +182,7 @@
            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}
         base := BaseInfo{TableId: baseinfo.TableId, TableName: table[0].TableName, BwType: table[0].BwType, CompareScore: Decimal(float64(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}
         //os.Exit(1)
         arg.Liker = append(arg.Liker, &base)
      }