diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java index 47faf87ea9..182a405e5d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java @@ -58,10 +58,12 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO) { + //获取工作人员所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); if (StringUtils.isEmpty(formDTO.getCommunityId())) { //获取工作人员所属组织 - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); - if(null == staffInfo) { +// CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败"); } formDTO.setCommunityId(staffInfo.getAgencyId()); @@ -69,7 +71,10 @@ public class HouseInformationServiceImpl implements HouseInformationService { String orgName; CustomerAgencyEntity agency = customerAgencyDao.selectById(formDTO.getCommunityId()); if (null == agency) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在"); + agency = customerAgencyDao.selectById(staffInfo.getAgencyId()); + if (null == agency) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在"); + } } CustomerAgencyEntity parentAgency = customerAgencyDao.selectById(agency.getPid()); if (null == parentAgency) { @@ -254,7 +259,7 @@ public class HouseInformationServiceImpl implements HouseInformationService { //排序 list = list.stream().sorted(Comparator.comparing(BuildingListResultDTO::getDifferPersonCount).reversed()).collect(Collectors.toList()); //分页 - list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); + list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); } } @@ -387,7 +392,7 @@ public class HouseInformationServiceImpl implements HouseInformationService { //排序 list = list.stream().sorted(Comparator.comparing(HomeListResultDTO::getPersonCount).reversed()).collect(Collectors.toList()); //分页 - list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); + list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); } }