|
|
@@ -170,4 +170,15 @@ public class RegionsCacheHelperImpl extends AbstractRegionCacheHelper implements |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<RegionDTO> listChildren(String code, int level) { |
|
|
|
RegionDTO curr = getByCodeAndLevel(code, level); |
|
|
|
if (curr.getParentCode().equals(curr.getRegionCode())) { |
|
|
|
return Collections.singletonList(curr); |
|
|
|
} |
|
|
|
return all().stream() |
|
|
|
.filter(w -> StrUtils.split(w.getRegionCodePath()).contains(code)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
} |