From 54b18d72b991779fdc64829233a789535bf33eeb Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 22 Jun 2022 17:02:57 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BA=94=E5=A4=A7=E5=9B=BE=E5=B1=82?= =?UTF-8?q?=E3=80=91=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E3=80=82=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BA=86house=E7=9A=84fullname=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E6=A3=80=E7=B4=A2=E3=80=82=E5=B9=B6=E4=B8=94=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E6=88=BF=E5=B1=8Badd=E3=80=81update=E3=80=81?= =?UTF-8?q?import=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=94=9F=E6=88=90ful?= =?UTF-8?q?lname=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/govorg/IcHouseEntity.java | 5 +++ .../impl/GovOrgCoverageServiceImpl.java | 2 +- .../service/impl/CoverageServiceImpl.java | 3 +- .../main/java/com/epmet/dto/IcHouseDTO.java | 5 +++ .../java/com/epmet/dto/ImportGeneralDTO.java | 2 ++ .../java/com/epmet/entity/IcHouseEntity.java | 5 +++ .../epmet/model/ImportHouseInfoListener.java | 1 + .../com/epmet/service/IcHouseService.java | 6 ++++ .../epmet/service/impl/HouseServiceImpl.java | 2 ++ .../service/impl/IcHouseServiceImpl.java | 34 ++++++++++++++++--- .../migration/V0.0.24__houseAddResiNumber.sql | 5 ++- 11 files changed, 63 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcHouseEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcHouseEntity.java index 2982cee72f..757def979a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcHouseEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcHouseEntity.java @@ -72,6 +72,11 @@ public class IcHouseEntity extends BaseEpmetEntity { */ private String houseName; + /** + * 全名:小区,楼栋,单元,房屋 + */ + private String fullName; + /** * 门牌号 */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java index f00359057f..12e1e789e7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java @@ -317,7 +317,7 @@ public class GovOrgCoverageServiceImpl implements GovOrgCoverageService { query.eq(IcHouseEntity::getCustomerId, customerId); query.likeRight(IcHouseEntity::getOrgIdPath, staffOrgIds); if (StringUtils.isNotBlank(search)) { - query.like(IcHouseEntity::getHouseName, search); // todo 这个字段要么丰富一下,要么建立新字段用于查询 + query.like(IcHouseEntity::getFullName, search); } query.ge(IcHouseEntity::getResiNumber, resiNumberBiggerThan); return query; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java index 62c1f5f1e6..6a1341a785 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java @@ -360,7 +360,8 @@ public class CoverageServiceImpl implements CoverageService { latitude = buildingInfo.getLatitude(); longitude = buildingInfo.getLongitude(); } - return new CoverageAnalisisDataListResultDTO(h.getId(), categoryKey, categoryDict.getCategoryName(), placeType, h.getHouseName(), latitude, longitude); + String houseName = StringUtils.isNotBlank(h.getFullName()) ? h.getFullName() : h.getHouseName(); + return new CoverageAnalisisDataListResultDTO(h.getId(), categoryKey, categoryDict.getCategoryName(), placeType, houseName, latitude, longitude); }).collect(Collectors.toList()); } else if (PLACE_TYPE_PUBLIC_SERVICE.equals(placeType)) { diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java index 42163539ce..f3221c4f69 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -71,6 +71,11 @@ public class IcHouseDTO implements Serializable { */ private String houseName; + /** + * 全名:小区,楼栋,单元,房屋 + */ + private String fullName; + /** * 门牌号 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java index 8f4783e7e7..df0f6b0530 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java @@ -147,6 +147,8 @@ public class ImportGeneralDTO implements Serializable { private String houseName; + private String fullName; + private String customerId; private Boolean existStatus = false; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java index 08fc8036a5..7c8eeee13d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java @@ -72,6 +72,11 @@ public class IcHouseEntity extends BaseEpmetEntity { */ private String houseName; + /** + * 全名:小区,楼栋,单元,房屋 + */ + private String fullName; + /** * 门牌号 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java index c3bbe3dc76..812792b964 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java @@ -241,6 +241,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(n.getGridId()); n.setOrgIdPath(gridInfo.getPids().concat(":").concat(gridInfo.getId())); + n.setFullName(icHouseService.getFullName(n.getNeighborHoodId(), n.getBuildingId(), n.getBuildingUnitId(), n.getDoorName())); }); // 根据单元ID_doorName查询已存在的 List ids = needInsertList.stream().filter(n -> StringUtils.isNotBlank(n.getBuildingUnitId())).map(m -> m.getBuildingUnitId() + "_" + m.getDoorName()).distinct().collect(Collectors.toList()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java index 161aad6c4e..f0ded0429e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -136,4 +136,10 @@ public interface IcHouseService extends BaseService { * @date 2022/6/1/0001 16:21 */ IcHouseDTO getByHouseCode(String houseCode); + + /** + * 房屋全名:小区、楼栋、单元、房间号 + * @return + */ + String getFullName(String neighborHoodId, String buildingId, String unitId, String doorName); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 1c042a9285..7b551f0515 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -142,6 +142,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { IcHouseEntity icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); icHouseDTO.setCustomerId(customerId); icHouseDTO.setHouseName(getHouseName(formDTO)); + icHouseDTO.setFullName(icHouseService.getFullName(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName())); //获取所属组织地区码 String areaCode = icNeighborHoodDao.getAreaCode(formDTO.getNeighborHoodId()); if (StringUtils.isNotBlank(areaCode)) { @@ -202,6 +203,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { icHouseDTO.setRentName(HouseRentFlagEnums.getTypeValue(formDTO.getRentFlag())); //设置 icHouseDTO.setHouseName(getHouseName(formDTO)); + icHouseDTO.setFullName(icHouseService.getFullName(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName())); houseChangeRecord(formDTO.getHouseId(), customerId, icHouseDTO); icHouseService.update(icHouseDTO); //删除房屋缓存 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index ef99e35c94..59557eae92 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -16,16 +16,19 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcBuildingDao; +import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dao.IcHouseDao; -import com.epmet.dto.IcHouseDTO; -import com.epmet.dto.IcResiCategoryStatsConfigDTO; -import com.epmet.dto.IcResiUserDTO; -import com.epmet.dto.ImportGeneralDTO; +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.*; import com.epmet.dto.form.HouseFormDTO; import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.HouseListResultDTO; import com.epmet.dto.result.HousesNameResultDTO; +import com.epmet.entity.IcBuildingEntity; +import com.epmet.entity.IcBuildingUnitEntity; import com.epmet.entity.IcHouseEntity; +import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; @@ -61,6 +64,12 @@ public class IcHouseServiceImpl extends BaseServiceImpl u.getNeighborHoodName()).orElse(""); + String buildingName = Optional.ofNullable(building).map(u -> u.getBuildingName()).orElse(""); + String unitName = Optional.ofNullable(unit).map(u -> u.getUnitNum().concat("单元")).orElse(""); + return new StringBuilder().append(neighborhoodName).append(buildingName).append(unitName).append(doorName).toString(); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.24__houseAddResiNumber.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.24__houseAddResiNumber.sql index 503de780a3..e3fe09cd0f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.24__houseAddResiNumber.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.24__houseAddResiNumber.sql @@ -2,4 +2,7 @@ alter table ic_house add column RESI_NUMBER int(2) comment '居住人数' after OWNER_ID_CARD; alter table ic_house - add column ORG_ID_PATH varchar(256) comment '房屋所属父级列表。目前包括机关+网格' after CUSTOMER_ID; \ No newline at end of file + add column ORG_ID_PATH varchar(256) comment '房屋所属父级列表。目前包括机关+网格' after CUSTOMER_ID; + +alter table ic_house + add column FULL_NAME varchar(64) comment '全名。小区、楼栋、单元、房屋' after DOOR_NAME; \ No newline at end of file