diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java index 3565f7e..429b486 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java @@ -47,7 +47,7 @@ public class UserInfoHelperImpl implements UserInfoHelper { if(CollUtil.isNotEmpty(userFullInfo.getUserRoleList())){ for(Role role : userFullInfo.getUserRoleList()){ if(RoleEnum.SUPER_ADMIN.name().equals(role.getCode()) || - RoleEnum.REGION_ADMIN.name().equals(role.getCode()) ){ + RoleEnum.REGION_MANAGER.name().equals(role.getCode()) ){ return Boolean.TRUE; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java index 055f7d8..528a525 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java @@ -34,7 +34,7 @@ public class OrdinaryUserDataScopeProviderImpl implements DataScopeProvider { ds.setEmployeeCode(userFullInfo.getOrganizationCode()); ds.setRegionCodes(Lists.newArrayList(userFullInfo.getRegionCode())); ds.setUserId(userFullInfo.getUserId()); - ds.setRole(RoleEnum.ORDINARY_USER); + ds.setRole(RoleEnum.NORMAL_MEMBER); return Optional.ofNullable(ds); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java index a903b60..8f36b97 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java @@ -33,7 +33,7 @@ public class OrgAdminDataScopeProviderImpl implements DataScopeProvider { ds.setOrgCode(userFullInfo.getOrganizationCode()); ds.setUserId(userFullInfo.getUserId()); ds.setEmployeeCode(userFullInfo.getEmployeeCode()); - ds.setRole(RoleEnum.ORG_ADMIN); + ds.setRole(RoleEnum.COMPANY_MANAGER); return Optional.ofNullable(ds); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/RegionAdminDataScopeProviderImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/RegionAdminDataScopeProviderImpl.java index d4b06cc..e70bde4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/RegionAdminDataScopeProviderImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/RegionAdminDataScopeProviderImpl.java @@ -47,7 +47,7 @@ public class RegionAdminDataScopeProviderImpl implements DataScopeProvider { ds.setRegionCodes(regionCodes.stream().collect(Collectors.toList())); ds.setUserId(userFullInfo.getUserId()); ds.setEmployeeCode(userFullInfo.getEmployeeCode()); - ds.setRole(RoleEnum.REGION_ADMIN); + ds.setRole(RoleEnum.REGION_MANAGER); return Optional.ofNullable(ds); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 52086d6..3124385 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -277,18 +277,18 @@ public class AnnualPlanLibManage { return loginUser; } switch (currentUserDataScope.get().getRole()){ - case ORDINARY_USER: + case NORMAL_MEMBER: //普通用户 只能看到自己单位去申报的 query.eq(Project::getBuildOrgCode ,loginUser.getOrganizationCode()); break; - case ORG_ADMIN: + case COMPANY_MANAGER: //单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目 query.eq(Project::getBuildOrgCode ,loginUser.getOrganizationCode()); break; case SUPER_ADMIN: //超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员 break; - case REGION_ADMIN: + case REGION_MANAGER: //区域管理员 看到自己区域的项目 query.eq(Project::getAreaCode,loginUser.getRegionCode()); break; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index bebd5b6..4230a93 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -210,11 +210,11 @@ public class ProjectLibManage { } Boolean isOrgAdmin = Boolean.FALSE; switch (currentUserDataScope.get().getRole()){ - case ORDINARY_USER: + case NORMAL_MEMBER: //普通用户 只能看到自己单位去申报的 query.eq(Project::getBuildOrgCode ,loginUser.getOrganizationCode()); break; - case ORG_ADMIN: + case COMPANY_MANAGER: //单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目 query.and(q1 -> q1.eq(Project::getBuildOrgCode ,loginUser.getOrganizationCode()).or(q2 -> q2.eq(Project::getStage,ProjectStatusEnum.NOT_APPROVED.getCode()) @@ -224,7 +224,7 @@ public class ProjectLibManage { case SUPER_ADMIN: //超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员 break; - case REGION_ADMIN: + case REGION_MANAGER: //区域管理员 看到自己区域的项目 query.eq(Project::getAreaCode,loginUser.getRegionCode()); break; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java index 54737c2..42ca500 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java @@ -20,19 +20,21 @@ public enum RoleEnum { /** * 系统角色枚举 */ - ORDINARY_USER("普通用户",6), + NORMAL_MEMBER("普通用户",6), EXPERT("专家",5), - ORG_ADMIN("单位管理员",4), + COMPANY_MANAGER("单位管理员",4), EXPERT_ADMIN("专家管理员",2), - REGION_ADMIN("区域管理员",3), + REGION_MANAGER("区域管理员",3), SUPER_ADMIN("超级管理员",1), - VISITOR("访客",7); + VISITOR("访客",7), + + DASHBOARD("工作台",8); private final String desc; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java index d42f1eb..c379237 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java @@ -118,7 +118,7 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { if(CollUtil.isNotEmpty(this.userRoleList)){ for(Role role : this.userRoleList){ RoleEnum roleEnum = RoleEnum.mathByName(role.getCode()); - if(Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.ORG_ADMIN.name())){ + if(Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.COMPANY_MANAGER.name())){ return Boolean.TRUE; } }