瀏覽代碼

单位管理员

tags/24080901
PoffyZhang 1 年之前
父節點
當前提交
082f3fdde0
共有 8 個檔案被更改,包括 17 行新增15 行删除
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrdinaryUserDataScopeProviderImpl.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/OrgAdminDataScopeProviderImpl.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/RegionAdminDataScopeProviderImpl.java
  5. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  6. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  7. +6
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java
  8. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java

+ 1
- 1
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;
}
}


+ 1
- 1
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);
}



+ 1
- 1
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);
}



+ 1
- 1
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);
}



+ 3
- 3
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;


+ 3
- 3
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;


+ 6
- 4
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;



+ 1
- 1
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;
}
}


Loading…
取消
儲存