|
@@ -69,22 +69,22 @@ public class AdminWebsitLogic {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
|
|
|
List<AdminWebsit> list = adminWebsitService.lambdaQuery()
|
|
|
- .and(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()), v -> v.in(AdminWebsit::getCompanyWechatId,adminUser.getCompanyWechatIds()))
|
|
|
+ .and(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()), v -> v.in(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatIds()))
|
|
|
.list();
|
|
|
List<AdminWebsitTree> trees = new ArrayList<>();
|
|
|
- for(AdminWebsit adminWebsit : list){
|
|
|
+ for (AdminWebsit adminWebsit : list) {
|
|
|
AdminWebsitTree adminWebsitTree = new AdminWebsitTree();
|
|
|
- BeanUtils.copyProperties(adminWebsit,adminWebsitTree);
|
|
|
+ BeanUtils.copyProperties(adminWebsit, adminWebsitTree);
|
|
|
trees.add(adminWebsitTree);
|
|
|
}
|
|
|
AdminUserWebsitRela one = adminUserWebsitRelaService.lambdaQuery().eq(AdminUserWebsitRela::getAdminUserId, adminUser.getAdminUserId()).last("limit 1").one();
|
|
|
List<AdminWebsitTree> parentList = trees.stream()
|
|
|
.filter(x -> (one == null && x.getParentId().equals("0")) || (one != null && x.getWebsitId().equals(one.getAdminWebsitId()))).collect(Collectors.toList());
|
|
|
- if(CollectionUtils.isEmpty(parentList)){
|
|
|
+ if (CollectionUtils.isEmpty(parentList)) {
|
|
|
parentList = trees.stream().filter(x -> x.getParentId().equals("0")).collect(Collectors.toList());
|
|
|
}
|
|
|
- for(AdminWebsitTree adminWebsit:parentList){
|
|
|
- adminWebsit.setChildren(this.treeModule(trees,adminWebsit.getWebsitId()));
|
|
|
+ for (AdminWebsitTree adminWebsit : parentList) {
|
|
|
+ adminWebsit.setChildren(this.treeModule(trees, adminWebsit.getWebsitId()));
|
|
|
}
|
|
|
return parentList;
|
|
|
}
|