Commit 596962f18f4c6c8512f10565173a0b0d8ce11e1c
1 parent
097722ca
fix: [DEFECT-1008]recursion organization tree oder by sort
Showing
1 changed file
with
11 additions
and
1 deletions
... | ... | @@ -257,10 +257,20 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
257 | 257 | result.add(node); |
258 | 258 | } |
259 | 259 | Collections.sort(result); |
260 | - result.forEach(node -> Collections.sort(node.getChildren())); | |
260 | + sortOrganization(result); | |
261 | 261 | return result; |
262 | 262 | } |
263 | 263 | |
264 | + private void sortOrganization(List<OrganizationDTO> result){ | |
265 | + result.forEach(node -> { | |
266 | + if(node.getChildren().size()>0){ | |
267 | + List<OrganizationDTO> children= node.getChildren(); | |
268 | + Collections.sort(children); | |
269 | + sortOrganization(children); | |
270 | + } | |
271 | + }); | |
272 | + } | |
273 | + | |
264 | 274 | @Override |
265 | 275 | @Transactional |
266 | 276 | public void bindUserToOrganization(String tenantId, String userId, String[] organizationIds) { | ... | ... |