This commit is contained in:
zhangheng 2024-05-07 09:39:43 +08:00
parent 2ecb3e50fa
commit d370f1d9b4

View File

@ -180,13 +180,7 @@ public class AgencyServiceImpl implements IAgencyService {
agency.setValue(agency.getId().toString());
}
List<AgencyVO> agenciesTree = buildDeptTree(agencies);
//排序
List<AgencyVO> sortedAgenciesTree = agenciesTree.stream().sorted(Comparator.comparing(AgencyVO::getAgencySort)).collect(Collectors.toList());
for (AgencyVO agencyVO : sortedAgenciesTree) {
List<AgencyVO> collect = agencyVO.getChildren().stream().sorted(Comparator.comparing(AgencyVO::getAgencySort)).collect(Collectors.toList());
agencyVO.setChildren(collect);
}
return sortedAgenciesTree.stream().map(AgencyTreeVO::new).collect(Collectors.toList());
return agenciesTree.stream().map(AgencyTreeVO::new).collect(Collectors.toList());
}
/**