From 0bbb169dcd6a055025769bece8a0301be6dde7f4 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 7 Jun 2021 12:07:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=BD=93=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E8=A2=AB=E5=88=A0=E9=99=A4=E5=90=8E=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=BB=A7=E7=BB=AD=E5=9C=A8=E6=AD=A4=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/AccessServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 25afa314fa..09727f5e56 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -453,6 +453,9 @@ public class AccessServiceImpl implements AccessService { } CustomerAgencyDTO belongAgency = belongAgencyRst.getData(); + if (belongAgency == null || belongAgency.getId() == null) { + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode(), "操作权限不足,用户所属的组织信息不存在"); + } //Result agencyByStaffRst = govOrgFeignClient.getAgencyByStaff(staffId); //if (!agencyByStaffRst.success()) { @@ -467,11 +470,15 @@ public class AccessServiceImpl implements AccessService { // 2.拿到当前所处机关单位信息 Result currAgencyRst = govOrgFeignClient.getAgencyById(currAgencyId); - CustomerAgencyDTO currAgencyDto = currAgencyRst.getData(); - if (!currAgencyRst.success() || currAgencyDto == null) { + if (!currAgencyRst.success()) { throw new RenException(String.format("根据当前机构id[%s]查询pids失败:%s", currAgencyId, currAgencyRst.getMsg())); } + CustomerAgencyDTO currAgencyDto = currAgencyRst.getData(); + if (currAgencyDto == null || currAgencyDto.getId() == null) { + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode(), "操作权限不足,当前组织信息不存在"); + } + // 获取机关单位中的角色 // 目前一个人只在一个单位下,所以不动态查询,如果后面需要一个人在多个单位,再改这里 //List roleDTOS = queryGovStaffRoles(staffId, belongAgency.getId());