| | |
| | | if _, ok := cache.CacheMap.Area[id]; ok { |
| | | targets := cache.CacheMap.Area[id].Walk(DoSdkCompare, floatFeat, baseScore) |
| | | if len(targets) > 0 { |
| | | scResult.CompareResult = append(scResult.CompareResult, targets...) |
| | | // 比对结果去重, 同一个人到访过多个小区, 缓存数据内会有多条记录 |
| | | for idx, t := range targets { |
| | | var isRepeat bool |
| | | for _, r := range scResult.CompareResult { |
| | | if t.Id == r.Id { |
| | | isRepeat = true |
| | | break |
| | | } |
| | | } |
| | | if !isRepeat { |
| | | scResult.CompareResult = append(scResult.CompareResult, targets[idx]) |
| | | } |
| | | } |
| | | } |
| | | |
| | | walkedArea[id] = struct{}{} |
| | |
| | | |
| | | targets := val.Walk(DoSdkCompare, floatFeat, baseScore) |
| | | if len(targets) > 0 { |
| | | scResult.CompareResult = append(scResult.CompareResult, targets...) |
| | | if len(targets) > 0 { |
| | | // 比对结果去重, 同一个人到访过多个小区, 缓存数据内会有多条记录 |
| | | for idx, t := range targets { |
| | | var isRepeat bool |
| | | for _, r := range scResult.CompareResult { |
| | | if t.Id == r.Id { |
| | | isRepeat = true |
| | | break |
| | | } |
| | | } |
| | | if !isRepeat { |
| | | scResult.CompareResult = append(scResult.CompareResult, targets[idx]) |
| | | } |
| | | } |
| | | } |
| | | // todo 添加小区外的关联关系, 下次优先比对 |
| | | } |
| | | } |