|
|
@ -468,18 +468,27 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
|
return agencysResultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
private List<ParentListResultDTO> getParentListMultic(List<ParentListResultDTO> resList,ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) { |
|
|
|
private List<ParentListResultDTO> getParentListMultic(List<ParentListResultDTO> resList, ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) { |
|
|
|
ParentListResultDTO resultDTO = new ParentListResultDTO(); |
|
|
|
resultDTO.setId(firstParent.getAgencyId()); |
|
|
|
resultDTO.setName(firstParent.getAgencyName()); |
|
|
|
resultDTO.setLevel(firstParent.getLevel()); |
|
|
|
resultDTO.setAreaCode(firstParent.getAreaCode()); |
|
|
|
resList.add(resultDTO); |
|
|
|
if (firstParent.getCustomerId().equals(currentUserCustomerId) && firstParent.getAgencyId().equals(rootAgencyId)) { |
|
|
|
Collections.reverse(resList); |
|
|
|
return resList; |
|
|
|
} else { |
|
|
|
ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(firstParent.getParentAreaCode()); |
|
|
|
return getParentListMultic(resList,parentAgency, currentUserCustomerId, rootAgencyId); |
|
|
|
String parentAgencyAreaCode = firstParent.getParentAreaCode(); |
|
|
|
if (StringUtils.isNotBlank(parentAgencyAreaCode)) { |
|
|
|
parentAgencyAreaCode = parentAgencyAreaCode.replaceAll("(0)+$", ""); |
|
|
|
} |
|
|
|
ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(parentAgencyAreaCode); |
|
|
|
if (null != parentAgency) { |
|
|
|
return getParentListMultic(resList, parentAgency, currentUserCustomerId, rootAgencyId); |
|
|
|
} else { |
|
|
|
return resList; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|