From 24343439a23a898251fa0893d4cab690f737b3e2 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 12 Apr 2022 14:16:22 +0800 Subject: [PATCH] =?UTF-8?q?24=E3=80=81=E5=B0=8F=E5=8C=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=88=BF=E5=B1=8B=E6=97=B6=EF=BC=8C=E5=87=BA?= =?UTF-8?q?=E7=A7=9F=E6=9B=B4=E6=94=B9=E4=B8=BA=E6=88=BF=E5=B1=8B=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=9A=E5=87=BA=E7=A7=9F=E3=80=81=E9=97=B2=E7=BD=AE?= =?UTF-8?q?=E3=80=81=E8=87=AA=E4=BD=8F=EF=BC=9B=E5=8E=86=E5=8F=B2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=AD=E6=98=AF--=E5=87=BA=E7=A7=9F=EF=BC=8C?= =?UTF-8?q?=E5=90=A6--=E8=87=AA=E4=BD=8F=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E8=87=AA=E4=BD=8F=EF=BC=9B=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E6=88=BF=E5=B1=8B=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=9A=84=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=88=BF=E5=B1=8B=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/IcHouseFormDTO.java | 4 ++-- .../com/epmet/dto/form/ListIcNeighborHoodFormDTO.java | 4 ++++ .../src/main/java/com/epmet/enums/HouseRentFlagEnums.java | 8 ++++++-- .../main/java/com/epmet/controller/HouseController.java | 7 +++---- .../src/main/java/com/epmet/dao/IcHouseDao.java | 3 ++- .../src/main/java/com/epmet/service/HouseService.java | 3 ++- .../java/com/epmet/service/impl/HouseServiceImpl.java | 5 +++-- .../src/main/resources/mapper/IcHouseDao.xml | 7 +++++-- 8 files changed, 27 insertions(+), 14 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java index fb679755d7..5fe1c6c4db 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java @@ -79,9 +79,9 @@ public class IcHouseFormDTO implements Serializable { private String purpose; /** - * 1出租;0未出租 + * 1:出租 0:自住 2:闲置 */ - @NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) + @NotNull(message = "房屋状态不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class}) private Integer rentFlag; /** diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java index 402c86c868..613ee6f3d2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java @@ -62,6 +62,10 @@ public class ListIcNeighborHoodFormDTO implements Serializable{ * 房主电话 */ private String ownerPhone; + /** + * 房屋状态 【1:出租 0:自住 2:闲置】 + */ + private String rentFlag; /** * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java index 618be0ea9a..27cd699bf3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java @@ -3,8 +3,12 @@ package com.epmet.enums; import org.springframework.util.StringUtils; public enum HouseRentFlagEnums { - YES(1,"是"), - NO(0,"否"); + //原有的房屋出租状态是否改为房屋状态【1:出租 0:自住 2:闲置】 + /*YES(1,"是"), + NO(0,"否");*/ + HOUSE_ZZ(0,"自住"), + HOUSE_CZ(1,"出租"), + HOUSE_XZ(2,"闲置"); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 09f29f5330..369fa24d40 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -92,9 +92,8 @@ public class HouseController implements ResultDataResolver { String queryScene = "house_manage"; IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(), - formDTO.getOwnerPhone(), null, - null, queryScene, - formDTO.getPageNo(), formDTO.getPageSize()); + formDTO.getOwnerPhone(), null, null, queryScene, + formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getRentFlag()); return new Result().ok(icNeighborHoodResultDTO); } @@ -142,7 +141,7 @@ public class HouseController implements ResultDataResolver { null); IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null, - neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize()); + neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize(), null); return new Result().ok(icNeighborHoodResultDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index c5a392e6ca..ed7ba8a969 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -38,7 +38,8 @@ public interface IcHouseDao extends BaseDao { @Param("ownerPhone") String ownerPhone, @Param("neighborHoodName") String neighborHoodName, @Param("buildingName") String buildingName, - @Param("queryScene") String queryScene); + @Param("queryScene") String queryScene, + @Param("rentFlag") String rentFlag); List searchAllHouse(@Param("house") IcHouseEntity house); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index a651ed1615..71c435bdf8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -62,7 +62,8 @@ public interface HouseService { String buildingName, String queryScene, Integer pageNo, - Integer pageSize); + Integer pageSize, + String rentFlag); void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception; 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 03458a90fd..04890b50a1 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 @@ -256,7 +256,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { String buildingName, String queryScene, Integer pageNo, - Integer pageSize) { + Integer pageSize, + String rentFlag) { IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); //如果类型是house 查房屋 //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); @@ -280,7 +281,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { IPage page = new Page(pageNo,pageSize); - IPage> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene); + IPage> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene, rentFlag); List> records = mapIPage.getRecords(); records.forEach(item->{ item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 0db3dfa93e..fc49465d73 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -154,7 +154,7 @@ b.BUILDING_NAME as buildingName, d.UNIT_NUM as unitNum, a.DOOR_NAME as doorName, - if(a.RENT_FLAG=1,'是','否') as rentFlag, + if(a.RENT_FLAG=0,'自住',if(a.RENT_FLAG=1,'出租','闲置')) as rentFlag, a.OWNER_NAME as ownerName, /*a.RENT_FLAG as rentFlag, a.PURPOSE as purpose,*/ @@ -197,6 +197,9 @@ AND b.BUILDING_NAME like CONCAT('%',#{buildingName},'%') + + AND a.rent_flag = #{rentFlag} + /*排序规则:如果是社区查询则根据小区、楼栋、单元、房屋名字分别升序排序*/ @@ -220,7 +223,7 @@ a.DOOR_NAME as doorName, a.HOUSE_TYPE as houseType, a.PURPOSE as purpose, - if(a.RENT_FLAG=1,'是','否') as rentFlag, + if(a.RENT_FLAG=0,'自住',if(a.RENT_FLAG=1,'出租','闲置')) as rentFlag, a.OWNER_NAME as ownerName, a.OWNER_PHONE as ownerPhone, a.OWNER_ID_CARD as ownerIdCard,