Browse Source

预审列表 申报单位 也要可看

tags/24080901
PoffyZhang 1 year ago
parent
commit
8eead39878
1 changed files with 8 additions and 30 deletions
  1. +8
    -30
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java

+ 8
- 30
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java View File

@@ -231,9 +231,6 @@ public class PrequalificationDeclaredProjectManage {
public PageVo<ProjectLibListItemVO> pageInfo(PrequalificationDeclaredListReq preReq) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!");
if(!user.getIsOrgAdmin()){
return PageVo.empty();
}
//限定参数 复制bean
ProjectListReq req = new ProjectListReq();
BeanUtils.copyProperties(preReq,req);
@@ -278,33 +275,14 @@ public class PrequalificationDeclaredProjectManage {
* @param query
*/
public UserFullInfoDTO buildPermission(LambdaQueryWrapper<Project> query,UserFullInfoDTO user){
Optional<DataScopeDTO> currentUserDataScope = DataScopeUtil.getCurrentUserDataScope(user);
if(!currentUserDataScope.isPresent()){
log.warn("没有取到权限信息 当前查询 没有权限条件");
return user;
}
switch (currentUserDataScope.get().getRole()){
//其它角色 只看自己单位
case SUPER_ADMIN:
case REGION_MANAGER:
case VISITOR:
case DASHBOARD:
case NORMAL_MEMBER:
//普通用户 只能看到自己单位去申报的
query.eq(Project::getBuildOrgCode ,user.getOrganizationCode());
break;
//单位管理角色看 自己单位申报 + 需要本单位来申报的
case COMPANY_MANAGER:
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
query.and(q1 -> q1.eq(Project::getBuildOrgCode ,user.getOrganizationCode()).or(q2 ->
q2.eq(Project::getStage,ProjectStatusEnum.NOT_APPROVED.getCode())
.eq(Project::getStatus,ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode())
.eq(Project::getSuperOrgCode,user.getOrganizationCode())));
break;
default:
//没有权限的话 就让它查不到
query.eq(Project::getId,0L);
break;
if(user.getIsOrgAdmin()){
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
query.and(q1 -> q1.eq(Project::getBuildOrgCode ,user.getOrganizationCode()).or(q2 ->
q2.eq(Project::getStage,ProjectStatusEnum.NOT_APPROVED.getCode())
.eq(Project::getStatus,ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode())
.eq(Project::getSuperOrgCode,user.getOrganizationCode())));
}else{
query.eq(Project::getBuildOrgCode ,user.getOrganizationCode());
}
return user;
}


Loading…
Cancel
Save