|  |  | @ -386,6 +386,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn | 
			
		
	
		
			
				
					|  |  |  |         // 查询所有街道、社区
 | 
			
		
	
		
			
				
					|  |  |  |         List<AreaCodeChildDTO> areaCodeChildDTOS = childDao.selectAllChild(); | 
			
		
	
		
			
				
					|  |  |  |         List<AreaCodeDictResultDTO> fourResult = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         List<AreaCodeDictResultDTO> fiveResult = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         // 街道-社区
 | 
			
		
	
		
			
				
					|  |  |  |         Map<Integer, List<AreaCodeChildDTO>> groupByLevel = areaCodeChildDTOS.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getLevel)); | 
			
		
	
		
			
				
					|  |  |  |         //社区
 | 
			
		
	
	
		
			
				
					|  |  | @ -393,23 +394,40 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn | 
			
		
	
		
			
				
					|  |  |  |         Map<String, List<AreaCodeChildDTO>> groupByPCode = levelFive.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); | 
			
		
	
		
			
				
					|  |  |  |         //街道
 | 
			
		
	
		
			
				
					|  |  |  |         List<AreaCodeChildDTO> levelFour = groupByLevel.get(NumConstant.FOUR); | 
			
		
	
		
			
				
					|  |  |  |         // 6级
 | 
			
		
	
		
			
				
					|  |  |  |         List<AreaCodeChildDTO> levelSix = groupByLevel.get(NumConstant.SIX); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, List<AreaCodeChildDTO>> groupBySixPCode = levelSix.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         levelFive.forEach(f -> { | 
			
		
	
		
			
				
					|  |  |  |             AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |             dto.setCode(f.getCode()); | 
			
		
	
		
			
				
					|  |  |  |             dto.setName(f.getName()); | 
			
		
	
		
			
				
					|  |  |  |             dto.setParentCode(f.getPCode()); | 
			
		
	
		
			
				
					|  |  |  |             groupBySixPCode.forEach((k,v) -> { | 
			
		
	
		
			
				
					|  |  |  |                 if (dto.getCode().equals(k)){ | 
			
		
	
		
			
				
					|  |  |  |                     List<AreaCodeDictResultDTO> six = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |                     v.forEach(s -> { | 
			
		
	
		
			
				
					|  |  |  |                         AreaCodeDictResultDTO sixDto = new AreaCodeDictResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |                         sixDto.setCode(s.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                         sixDto.setName(s.getName()); | 
			
		
	
		
			
				
					|  |  |  |                         sixDto.setParentCode(k); | 
			
		
	
		
			
				
					|  |  |  |                         six.add(sixDto); | 
			
		
	
		
			
				
					|  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |                     List<AreaCodeDictResultDTO> collect = six.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     dto.setChildren(collect); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |             fiveResult.add(dto); | 
			
		
	
		
			
				
					|  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, List<AreaCodeDictResultDTO>> groupByFivePCode = fiveResult.stream().collect(Collectors.groupingBy(AreaCodeDictResultDTO::getParentCode)); | 
			
		
	
		
			
				
					|  |  |  |         levelFour.forEach(four -> { | 
			
		
	
		
			
				
					|  |  |  |             AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |             dto.setCode(four.getCode()); | 
			
		
	
		
			
				
					|  |  |  |             dto.setName(four.getName()); | 
			
		
	
		
			
				
					|  |  |  |             dto.setParentCode(four.getPCode()); | 
			
		
	
		
			
				
					|  |  |  |             groupByPCode.forEach((pCode,v) -> { | 
			
		
	
		
			
				
					|  |  |  |             groupByFivePCode.forEach((pCode,v) -> { | 
			
		
	
		
			
				
					|  |  |  |                 if (dto.getCode().equals(pCode)){ | 
			
		
	
		
			
				
					|  |  |  |                     List<AreaCodeDictResultDTO> fiveResult = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |                     v.forEach(five -> { | 
			
		
	
		
			
				
					|  |  |  |                         AreaCodeDictResultDTO fiveDto = new AreaCodeDictResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |                         fiveDto.setCode(five.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                         fiveDto.setName(five.getName()); | 
			
		
	
		
			
				
					|  |  |  |                         fiveDto.setParentCode(pCode); | 
			
		
	
		
			
				
					|  |  |  |                         fiveResult.add(fiveDto); | 
			
		
	
		
			
				
					|  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |                     List<AreaCodeDictResultDTO> fiveSort = fiveResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     dto.setChildren(fiveSort); | 
			
		
	
		
			
				
					|  |  |  |                     dto.setChildren(v); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |             fourResult.add(dto); | 
			
		
	
	
		
			
				
					|  |  | 
 |