From c222383d384ee787f8bbd756f73a3b4c93675f9f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 11 Sep 2023 15:12:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov/manage/GovProjectCollectionManage.java | 13 +++++------ .../ningdatech/pmapi/sys/manage/NoticeManage.java | 25 ++++++++++------------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index 78c5483..5c9c44c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java @@ -220,15 +220,12 @@ public class GovProjectCollectionManage { */ private void permissions(LambdaQueryWrapper wrapper) { UserInfoDetails user = LoginUserUtil.loginUserDetail(); - List userRoleList = user.getUserRoleList(); - for(Role role : userRoleList){ - //超管和区域管理员 - if(RoleEnum.SUPER_ADMIN.name().equals(role.getCode()) || - RoleEnum.REGION_MANAGER.name().equals(role.getCode())){ - log.info("超管和区管 可以看所有"); - return; - } + //超管和区域管理员 + if(user.getSuperAdmin() || user.getRegionAdmin()){ + log.info("超管和区管 可以看所有"); + return; } + wrapper.eq(GovBizProjectBaseinfo::getBaseBuildDeprtDing,user.getEmpPosUnitCode()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java index 9ef91d2..2f454e6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java @@ -302,20 +302,17 @@ public class NoticeManage { notice.setPermissionsValue(user.getEmpPosUnitCode()); return; } - for(Role role : userRoleList){ - if(RoleEnum.SUPER_ADMIN.eq(role.getCode())){ - notice.setPermissions(NoticePermissionsEnum.SUPER.getCode()); - return; - }else if(RoleEnum.REGION_MANAGER.eq(role.getCode())){ - notice.setPermissions(NoticePermissionsEnum.REGION.getCode()); - notice.setPermissionsValue(user.getRegionCode()); - return; - }else if(RoleEnum.COMPANY_MANAGER.eq(role.getCode())){ - notice.setPermissions(NoticePermissionsEnum.ORG.getCode()); - notice.setPermissionsValue(user.getEmpPosUnitCode()); - return; - } - + if(user.getSuperAdmin()){ + notice.setPermissions(NoticePermissionsEnum.SUPER.getCode()); + return; + }else if(user.getRegionAdmin()){ + notice.setPermissions(NoticePermissionsEnum.REGION.getCode()); + notice.setPermissionsValue(user.getRegionCode()); + return; + }else if(user.getIsOrgAdmin()){ + notice.setPermissions(NoticePermissionsEnum.ORG.getCode()); + notice.setPermissionsValue(user.getEmpPosUnitCode()); + return; } notice.setPermissions(NoticePermissionsEnum.ORG.getCode()); notice.setPermissionsValue(user.getEmpPosUnitCode());