From d665c10a32ea765a852f48c01686d60111fd87df Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 11 Jul 2022 09:34:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8F=8C=E5=AE=9Ebug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/BuildingListResultDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java index 67b4642640..084d69cdc2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java @@ -16,7 +16,7 @@ public class BuildingListResultDTO implements Serializable { private static final long serialVersionUID = -1423424057500044373L; private String id; private String name; - private Integer unitCoun = 0; + private Integer unitCount = 0; private Integer houseCount = 0; private Integer personCount = 0; private Integer differHouseCount = 0; From 4f3dfc736393484d728d8c5de7b5ef1a6046194a Mon Sep 17 00:00:00 2001 From: YUJT Date: Mon, 11 Jul 2022 09:34:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=BA=94=E6=80=A5?= =?UTF-8?q?=E7=9A=84=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HouseInformationServiceImpl.java | 40 +------------------ 1 file changed, 2 insertions(+), 38 deletions(-) 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 1acb3f8184..33f3e3ab33 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,11 +58,9 @@ 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()); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); if (null == staffInfo) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败"); } @@ -71,12 +69,7 @@ public class HouseInformationServiceImpl implements HouseInformationService { String orgName; CustomerAgencyEntity agency = customerAgencyDao.selectById(formDTO.getCommunityId()); if (null == agency) { - agency = customerAgencyDao.selectById(staffInfo.getAgencyId()); - if (null == agency) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在"); - } else { - formDTO.setCommunityId(staffInfo.getAgencyId()); - } + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在"); } CustomerAgencyEntity parentAgency = customerAgencyDao.selectById(agency.getPid()); if (null == parentAgency) { @@ -128,35 +121,6 @@ public class HouseInformationServiceImpl implements HouseInformationService { } item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount()); }); - - } else { - return deleteAfetrEmergency(formDTO); - } - return new PageData<>(list, pageInfo.getTotal()); - } - - private PageData deleteAfetrEmergency(HouseInformationFormDTO formDTO) { - //获取工作人员所属组织 - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); - formDTO.setCommunityId(staffInfo.getAgencyId()); - PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); - List list = icNeighborHoodDao.getGridList(formDTO); - PageInfo pageInfo = new PageInfo<>(list); - if (CollectionUtils.isNotEmpty(list)) { - //获取录入人口数 - IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); - countFormDTO.setOrgType(NumConstant.ZERO_STR); - countFormDTO.setOrgId(formDTO.getCommunityId()); - countFormDTO.setType(NumConstant.ONE_STR); - Map map = getMapResult(countFormDTO); - - list.forEach(item -> { - if (map.containsKey(item.getId())) { - item.setPersonCount(map.get(item.getId())); - } - item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount()); - }); - } return new PageData<>(list, pageInfo.getTotal()); } From 1c7efe6803f8873e6aaf4f61cc13da66eaf1b969 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 11 Jul 2022 16:21:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8F=8C=E5=AE=9Ebug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/IcNeighborHoodDao.xml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index ba47187e06..7314031436 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -530,7 +530,8 @@ SELECT a.ID, a.BUILDING_NAME AS name, - IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitCount, + IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount, + IFNULL(c.unitCount, 0) AS unitCount, SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount, SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount, IFNULL(b.houseCount, 0) AS houseCount, @@ -541,6 +542,10 @@ FROM ic_house WHERE DEL_FLAG = '0' AND NEIGHBOR_HOOD_ID = #{neighborHoodId} GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID + LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount + FROM ic_building_unit + WHERE DEL_FLAG = '0' + GROUP BY BUILDING_ID ) c ON a.ID = c.BUILDING_ID WHERE a.DEL_FLAG = '0' AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId} @@ -578,7 +583,8 @@ a.ID AS buildingId, a.TYPE AS buildingType, CONCAT(NEIGHBOR_HOOD_NAME,' ',BUILDING_NAME) AS buildingName, - IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitCount, + IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount, + IFNULL( d.unitCount, 0 ) AS unitCount, SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount, SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount, IFNULL( b.houseCount, 0 ) AS houseCount, @@ -590,6 +596,11 @@ WHERE DEL_FLAG = '0' AND BUILDING_ID = #{buildingId} GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID + LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount + FROM ic_building_unit + WHERE DEL_FLAG = '0' + AND BUILDING_ID = #{buildingId} + GROUP BY BUILDING_ID ) d ON a.ID = d.BUILDING_ID INNER JOIN ic_neighbor_hood c ON a.NEIGHBOR_HOOD_ID = c.ID WHERE a.DEL_FLAG = '0'