panlei
2019-06-22 847983cd82cff288e5b610d2bbcebbdb0398f1d6
补充不画区域时的情形
1个文件已修改
18 ■■■■■ 已修改文件
ruleserver/ruleToformula.go 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/ruleToformula.go
@@ -188,11 +188,17 @@
// 将字符串格式的坐标序列化为Point格式
func Json2points(areaPoints string) []Point {
    var pts []Point
    err := json.Unmarshal([]byte(areaPoints), &pts)
    if err != nil {
        fmt.Println("json.Unmarshal错误", err)
        panic("序列化坐标异常,程序退出")
    if areaPoints == "" {
        pts = append(pts,Point{0,0})
        pts = append(pts,Point{0,540})
        pts = append(pts,Point{960,540})
        pts = append(pts,Point{960,0})
    } else {
        err := json.Unmarshal([]byte(areaPoints), &pts)
        if err != nil {
            fmt.Println("json.Unmarshal错误", err)
            panic("序列化坐标异常,程序退出")
        }
    }
    return pts
}
@@ -311,7 +317,7 @@
            flag := splice1(&areaMap)
            if flag != "" {
                fmt.Println("强行拼凑一个人数是否大于0的结果", flag)
                completeFormula = completeFormula  + "&&" + flag
                completeFormula = flag
            }
        }
        for j := 0; j < len(groupRule.Rules); j++ {