panlei
2019-08-01 10d76b18b246b8bc0344c704ff6bc5ae8e310be9
换个比分转化
1个文件已修改
12 ■■■■ 已修改文件
ruleserver/readyDataForRule.go 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/readyDataForRule.go
@@ -50,7 +50,7 @@
    TableId      string  `json:"tableId"`
    TableName    string  `json:"tableName"`
    BwType       string  `json:"bwType"`
    CompareScore float64 `json:"compareScore"`
    CompareScore float32 `json:"compareScore"`
    PersonId     string  `json:"personId"`
    PersonName   string  `json:"personName"`
    PersonPicUrl string  `json:"personPicUrl"`
@@ -92,9 +92,9 @@
    // float32与float64互转会有位数保留不准的问题
    return v
}
func Decimal(value float64) float64 {
    value, _ = strconv.ParseFloat(fmt.Sprintf("%.4f", value), 64)
    return value
func Decimal(value float32) float32 {
    value1, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", value), 32)
    return float32(value1)
}
// 取出某个时间规则的第几天的规则段集合
func GetTimeById(id string, index int) []TimeRange {
@@ -181,8 +181,8 @@
            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: 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}
            logger.Debug("看看这个base的对比值是多少:", Decimal(m[baseinfo.Id]) * 100)
            base := BaseInfo{TableId: baseinfo.TableId, TableName: table[0].TableName, BwType: table[0].BwType, CompareScore: Decimal(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)
        }