| | |
| | | // 将字符串格式的坐标序列化为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 |
| | | } |
| | |
| | | flag := splice1(&areaMap) |
| | | if flag != "" { |
| | | fmt.Println("强行拼凑一个人数是否大于0的结果", flag) |
| | | completeFormula = completeFormula + "&&" + flag |
| | | completeFormula = flag |
| | | } |
| | | } |
| | | for j := 0; j < len(groupRule.Rules); j++ { |