Commit 7ad7074c by chamberone

fix: 添加组织结构字段

1 parent cf781249
...@@ -18,4 +18,6 @@ public class OrganizationDTO { ...@@ -18,4 +18,6 @@ public class OrganizationDTO {
*/ */
private String type; private String type;
private Boolean isActive;
} }
...@@ -148,9 +148,7 @@ public class UserService { ...@@ -148,9 +148,7 @@ public class UserService {
userDTO.setMenus(levelOne); userDTO.setMenus(levelOne);
// 获取组织架构资源 // 获取组织架构资源
List<OrganizationDTO> allOrgs = resources.stream().filter(r -> r.getType() == 3) List<OrganizationDTO> allOrgs = resources.stream().filter(r -> r.getType() == 3).map(r -> {
// 暂时只允许一种角色
.limit(1).map(r -> {
List<OrganizationDTO> orgs = Lists.newArrayList(); List<OrganizationDTO> orgs = Lists.newArrayList();
String[] temp = r.getExtra().split("\\|"); String[] temp = r.getExtra().split("\\|");
Result<?> result = organizationService.getAllOrganizations(temp[0], Result<?> result = organizationService.getAllOrganizations(temp[0],
...@@ -160,6 +158,9 @@ public class UserService { ...@@ -160,6 +158,9 @@ public class UserService {
} }
return orgs; return orgs;
}).flatMap(a -> a.stream()).collect(Collectors.toList()); }).flatMap(a -> a.stream()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(allOrgs)) {
allOrgs.get(0).setIsActive(true);
}
userDTO.setAuths(allOrgs); userDTO.setAuths(allOrgs);
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!