|
@@ -410,6 +410,10 @@ public class RoleServiceImpl extends SuperService {
|
|
|
// 角色存在,查询角色信息
|
|
// 角色存在,查询角色信息
|
|
|
List<String> roleIds = new ArrayList<>(roleGroup.getRoleId());
|
|
List<String> roleIds = new ArrayList<>(roleGroup.getRoleId());
|
|
|
roleModel = roleService.getRole(roleIds.get(0)).getContent();
|
|
roleModel = roleService.getRole(roleIds.get(0)).getContent();
|
|
|
|
|
+ if (StringUtils.isEmpty(role.getRoleId())) {
|
|
|
|
|
+ role.setRoleId(roleIds.get(0));
|
|
|
|
|
+ roleDao.save(role);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
Set<String> auth = roleModel.getAuth();
|
|
Set<String> auth = roleModel.getAuth();
|
|
|
if (CollectionUtils.isEmpty(auth)) {
|
|
if (CollectionUtils.isEmpty(auth)) {
|
|
@@ -438,8 +442,8 @@ public class RoleServiceImpl extends SuperService {
|
|
|
}
|
|
}
|
|
|
roleModel.setAuth(auth);
|
|
roleModel.setAuth(auth);
|
|
|
com.github.microservice.auth.client.content.ResultContent<String> content = roleService.updateRole(roleModel);
|
|
com.github.microservice.auth.client.content.ResultContent<String> content = roleService.updateRole(roleModel);
|
|
|
- if (content.getState() == ResultState.Fail) {
|
|
|
|
|
- log.info("错误: {}", content.getMsg());
|
|
|
|
|
|
|
+ if (content.getState() != ResultState.Success) {
|
|
|
|
|
+ log.error("错误: {}", content.getMsg());
|
|
|
}
|
|
}
|
|
|
return ResultContent.buildSuccess(roleModel);
|
|
return ResultContent.buildSuccess(roleModel);
|
|
|
}
|
|
}
|
|
@@ -470,8 +474,8 @@ public class RoleServiceImpl extends SuperService {
|
|
|
if (ObjectUtils.isEmpty(userAccount)) {
|
|
if (ObjectUtils.isEmpty(userAccount)) {
|
|
|
return auth;
|
|
return auth;
|
|
|
}
|
|
}
|
|
|
-// List<OrganizationUser> organizationUsers = organizationUserDao.findByUserAndAuthType(userAccount, AuthType.Platform);
|
|
|
|
|
- List<OrganizationUser> organizationUsers = organizationUserDao.findByUserId(userAccount.getUserId());
|
|
|
|
|
|
|
+ List<OrganizationUser> organizationUsers = organizationUserDao.findByUserAndAuthType(userAccount, AuthType.Platform);
|
|
|
|
|
+// List<OrganizationUser> organizationUsers = organizationUserDao.findByUserId(userAccount.getUserId());
|
|
|
if (ObjectUtils.isEmpty(organizationUsers)) {
|
|
if (ObjectUtils.isEmpty(organizationUsers)) {
|
|
|
return auth;
|
|
return auth;
|
|
|
}
|
|
}
|
|
@@ -571,9 +575,17 @@ public class RoleServiceImpl extends SuperService {
|
|
|
List<Role> _list = roles.stream().filter(it -> {
|
|
List<Role> _list = roles.stream().filter(it -> {
|
|
|
return it.getIsAdmin();
|
|
return it.getIsAdmin();
|
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
// 如果角色是管理员角色,就把 Admin权限标识返回
|
|
// 如果角色是管理员角色,就把 Admin权限标识返回
|
|
|
if (ObjectUtils.isNotEmpty(_list)) {
|
|
if (ObjectUtils.isNotEmpty(_list)) {
|
|
|
- auth.add(AuthConstant.Admin);
|
|
|
|
|
|
|
+ Organization org = organizationUser.getOrganization();
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(org)) {
|
|
|
|
|
+ if (org.getAuthType() == AuthType.Platform) {
|
|
|
|
|
+ auth.add(AuthConstant.SuperAdmin);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ auth.add(AuthConstant.Admin);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|