---
panlei
2019-08-02 f50d635a8bf79dd3bc594e67a3392c9db5eb2624
ruleserver/readyDataForRule.go
@@ -8,6 +8,7 @@
   "fmt"
   "github.com/go-yaml/yaml"
   "io/ioutil"
   "math"
   "ruleprocess/cache"
   "ruleprocess/logger"
   "strconv"
@@ -50,7 +51,7 @@
   TableId      string  `json:"tableId"`
   TableName    string  `json:"tableName"`
   BwType       string  `json:"bwType"`
   CompareScore float32 `json:"compareScore"`
   CompareScore float64 `json:"compareScore"`
   PersonId     string  `json:"personId"`
   PersonName   string  `json:"personName"`
   PersonPicUrl string  `json:"personPicUrl"`
@@ -92,9 +93,10 @@
   // float32与float64互转会有位数保留不准的问题
   return v
}
func Decimal(value float32) float32 {
   value1, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", value), 32)
   return float32(value1)
func Decimal(value float32) float64 {
   value1, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", value), 64)
   n10 := math.Pow10(4)
   return math.Trunc((value1+0.5/n10)*n10) / n10
}
// 取出某个时间规则的第几天的规则段集合
func GetTimeById(id string, index int) []TimeRange {