Commit 6ad9f13f by guojuxing

用户ID获取账号分组:如果是超管,查询全部

parent dda02516
......@@ -366,7 +366,16 @@ public class UserApiServiceImpl implements UserApiService {
@Override
public ServiceResponse<List<Integer>> listAccountGroupByUserId(Integer userId) {
checkUser(userId);
TabSysUser user = checkUser(userId);
boolean isAdmin = user.getSuperAdmin() == 1;
if (isAdmin) {
List<TabSysAccountGroup> list = accountGroupService.listAccountGroupByEnterpriseId(user.getEnterpriseId());
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(list.stream().mapToInt(e -> e.getAccountGroupId()).boxed().collect(Collectors.toList()));
} else {
return ServiceResponse.success(Collections.emptyList());
}
}
//账号分组
List<TabSysAccountGroupRel> tabSysAccountGroupRelList = accountGroupRelService.listByUserId(userId,
AccountGroupMemberTypeEnum.ADMIN.getCode());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment