From f96265706c04836e5f26e11759052add631658e8 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Tue, 21 Nov 2023 17:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=BF=E5=B1=8B=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E5=88=97=E8=A1=A8=E6=89=A7=E8=A1=8C=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cm/population/dao/house/IHouseDao.java | 2 ++ .../population/pojo/dtos/house/HouseDTO.java | 10 +++++++ .../service/house/impl/HouseServiceImpl.java | 10 +++---- .../impl/PopulationServiceImpl.java | 2 +- .../mybatis/mapper/house/house-mapper.xml | 30 ++++++++++++++++++- 5 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/cm/population/dao/house/IHouseDao.java b/src/main/java/com/cm/population/dao/house/IHouseDao.java index 28b66f6..e14cf6e 100644 --- a/src/main/java/com/cm/population/dao/house/IHouseDao.java +++ b/src/main/java/com/cm/population/dao/house/IHouseDao.java @@ -124,4 +124,6 @@ public interface IHouseDao { * @return */ List findPopulation(Map params); + + List listForAll(Map params); } \ No newline at end of file diff --git a/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java b/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java index 5fb1add..2456dde 100644 --- a/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/house/HouseDTO.java @@ -129,6 +129,8 @@ public class HouseDTO { private String houseType; @ApiModelProperty(name = "populationVOList", value = "同住人信息") private List populationDTOList; + @ApiModelProperty(name = "count", value = "房屋人员") + private Integer count; public String getHouseId() { return houseId; @@ -577,4 +579,12 @@ public class HouseDTO { public void setPopulationDTOList(List populationDTOList) { this.populationDTOList = populationDTOList; } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } } diff --git a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java index d1a811a..f486192 100644 --- a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java +++ b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java @@ -262,7 +262,7 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { batchHouseDTO.setUnitCount(unitNum.toString()); // 获取当前楼栋下的所有房屋信息 - List houseDTOList = houseDao.list(params); + List houseDTOList = houseDao.listForAll(params); List floorList = new ArrayList<>(); for (int i = 1; i <= floorsNum; i++) { @@ -281,7 +281,7 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { BatchHouseDTO.House house = new BatchHouseDTO.House(); if (null != houseDTO.getAffiliationFloors()) { if (i == Integer.valueOf(houseDTO.getAffiliationFloors())) { - if (null != houseDTO.getAffiliatedUnit()) { + if (null != houseDTO.getAffiliationUnit()) { if (j == Integer.valueOf(houseDTO.getAffiliationUnit())) { house.setIsCreator(0); house.setPopulationCount(0); @@ -291,9 +291,9 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { if (userId.equals(houseDTO.getCreator()) || isAdmin()) { house.setIsCreator(1); // 获取当前房屋内的人数 - params.put("houseId", houseDTO.getHouseId()); - Integer count = populationService.count(params); - house.setPopulationCount(count); + /*params.put("houseId", houseDTO.getHouseId()); + Integer count = populationService.count(params);*/ + house.setPopulationCount(houseDTO.getCount()); } houseList.add(house); } diff --git a/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java b/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java index a033b28..19d4781 100644 --- a/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java +++ b/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java @@ -361,7 +361,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio // 获取人员 PopulationInfoBaseDTO base = populationInfoService.getBase(populationDTO.getPopulationInfoId()); - populationInfoService.getTuoMin(base); + // populationInfoService.getTuoMin(base); populationInfoHouseDTO.setPopulationInfoBaseDTO(base); populationDTO.setPopulationInfoHouseDTO(populationInfoHouseDTO); diff --git a/src/main/resources/mybatis/mapper/house/house-mapper.xml b/src/main/resources/mybatis/mapper/house/house-mapper.xml index 54c18b4..5f3491c 100644 --- a/src/main/resources/mybatis/mapper/house/house-mapper.xml +++ b/src/main/resources/mybatis/mapper/house/house-mapper.xml @@ -57,6 +57,7 @@ + @@ -795,7 +796,7 @@ hp.population_info_id = #{populationInfoId} ) - ORDER BY house_num ASC + ORDER BY affiliation_unit, affiliation_floors, house_num ASC @@ -1054,4 +1055,31 @@ + + \ No newline at end of file