| | |
| | | List<Region> list = regionService.list(); |
| | | List<Region> collect = list.stream().filter(s -> s.getParentId() == 0).collect(Collectors.toList()); |
| | | for (Region region : collect) { |
| | | List<Region> collect1 = list.stream().filter(s -> s.getParentId() == region.getId()).collect(Collectors.toList()); |
| | | List<Region> collect1 = list.stream().filter(s -> s.getParentId().equals(region.getId())).collect(Collectors.toList()); |
| | | for (Region region1 : collect1) { |
| | | List<Region> collect2 = list.stream().filter(s -> s.getParentId() == region1.getId()).collect(Collectors.toList()); |
| | | List<Region> collect2 = list.stream().filter(s -> s.getParentId().equals(region1.getId())).collect(Collectors.toList()); |
| | | region1.setChilds(collect2); |
| | | } |
| | | region.setChilds(collect1); |