From 8eead398789ca5df689633abaab6fcc0aecbbdff Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 6 Apr 2023 17:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E5=AE=A1=E5=88=97=E8=A1=A8=20?= =?UTF-8?q?=E7=94=B3=E6=8A=A5=E5=8D=95=E4=BD=8D=20=E4=B9=9F=E8=A6=81?= =?UTF-8?q?=E5=8F=AF=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrequalificationDeclaredProjectManage.java | 38 +++++----------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java index c55a5ee..9039afe 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java @@ -231,9 +231,6 @@ public class PrequalificationDeclaredProjectManage { public PageVo 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 query,UserFullInfoDTO user){ - Optional 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; }