TRX hai 1 ano
pai
achega
ff6e982274

+ 4 - 1
FullCardClient/src/main/java/com/zhongshu/card/client/service/org/UserAccountService.java

@@ -19,6 +19,9 @@ public interface UserAccountService {
     // 注册基本用户
     ResultContent<String> registerUserAccount(RegisterUserAccountParam param);
 
+    // 查询机构用户列表
+    ResultContent<Page<OrganizationUserModel>> projectUserPage(OrganizationUserSearch param, Pageable pageable);
+
     /**
      * 得到机构用户详情
      *
@@ -49,7 +52,7 @@ public interface UserAccountService {
     // 重置用户密码(默认密码)
     ResultContent resetPassWord(UserIdModel param);
 
-    // 查询构用户列表
+    // 查询构用户列表
     ResultContent<Page<OrganizationUserModel>> pageOrgUser(OrganizationUserSearch param, Pageable pageable);
 
     ResultContent<UserCountDetailsModel> getCurrentDetail(AuthTypeParam param);

+ 11 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/org/OrganizationUserController.java

@@ -60,6 +60,17 @@ public class OrganizationUserController {
         // 项目用户 包括项目下所有的机构的用户
         param.setIsSearchProject(Boolean.TRUE);
         Assert.hasText(param.getProjectOid(), "projectOid不能为空");
+        return userAccountService.projectUserPage(param, pageable);
+    }
+
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "机构用户列表-分页查询", description = "机构用户列表-分页查询")
+    @RequestMapping(value = {"orgUserPage"}, method = {RequestMethod.POST})
+    public ResultContent<Page<OrganizationUserModel>> orgUserPage(
+            @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
+            @Parameter(required = false) OrganizationUserSearch param) {
+        param.setIsSearchProject(Boolean.FALSE);
+        Assert.hasText(param.getOid(), "oid不能为空");
         return userAccountService.pageOrgUser(param, pageable);
     }
 

+ 16 - 8
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/user/RoleServiceImpl.java

@@ -81,11 +81,12 @@ public class RoleServiceImpl extends SuperService {
         Assert.hasText(param.getName(), "name不能为空");
         Assert.hasText(param.getCode(), "code不能为空");
         String oid = param.getOid();
-        if (StringUtils.isEmpty(oid)) {
-            oid = getCurrentOid();
-        }
         Assert.hasText(oid, "oid不能为空");
-        param.setOid(oid);
+        Organization organization = organizationDao.findTopByOid(oid);
+        if (ObjectUtils.isEmpty(organization)) {
+            return ResultContent.buildFail(String.format("oid不存在:%s", oid));
+        }
+        param.setAuthType(organization.getAuthType());
         if (param.getSort() == null) {
             param.setSort(1L);
         }
@@ -286,7 +287,7 @@ public class RoleServiceImpl extends SuperService {
             });
         }
         // 角色确定
-        AuthType authType = roleObj.getAuthType();
+        AuthType authType = organization.getAuthType();
         return ResultContent.buildContent(buildAuthList(authType, postAuth));
     }
 
@@ -370,7 +371,6 @@ public class RoleServiceImpl extends SuperService {
         if (role == null) {
             return ResultContent.buildFail("角色不存在");
         }
-
         var roleGroup = roleService.getRoleGroup(role.getRoleGroupId()).getContent();
         com.github.microservice.auth.client.model.RoleModel roleModel;
         if (roleGroup.getRoleId() == null || CollectionUtils.isEmpty(roleGroup.getRoleId())) {
@@ -408,12 +408,20 @@ public class RoleServiceImpl extends SuperService {
         } else {
             auth.removeAll(param.getAuths());
         }
+        Organization organization = organizationDao.findTopByOid(role.getOid());
         // 管理员角色默认有 管理员的权限
         if (role.getIsAdmin() != null && role.getIsAdmin()) {
-            auth.add(AuthConstant.Admin);
+            if (organization != null && organization.getAuthType() == AuthType.Platform) {
+                auth.add(AuthConstant.SuperAdmin);
+            } else {
+                auth.add(AuthConstant.Admin);
+            }
         }
         roleModel.setAuth(auth);
-        roleService.updateRole(roleModel);
+        com.github.microservice.auth.client.content.ResultContent<String> content = roleService.updateRole(roleModel);
+        if (content.getState() == ResultState.Fail) {
+            log.info("错误: {}", content.getMsg());
+        }
         return ResultContent.buildSuccess(roleModel);
     }
 

+ 7 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/user/UserAccountServiceImpl.java

@@ -368,6 +368,13 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
         return ResultContent.buildSuccess();
     }
 
+    @Override
+    public ResultContent<Page<OrganizationUserModel>> projectUserPage(OrganizationUserSearch param, Pageable pageable) {
+        initSearchParam(param);
+        Page<OrganizationUser> page = organizationUserDao.page(pageable, param);
+        return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toOrgUserModel));
+    }
+
     /**
      * 查询机构用户列表
      *