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());