From d57a723b651fdde2c99160d3da9536c14044bd39 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Mon, 13 Nov 2023 15:38:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E5=86=85=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=E6=97=B6=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=E9=A1=B9=E4=BF=AE=E6=94=B9=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PopulationServiceImpl.java | 24 +++++++++++-------- .../resources/templates/population/list.html | 3 +++ .../resources/templates/population/save.html | 4 ++-- .../templates/population/update.html | 4 ++-- 4 files changed, 21 insertions(+), 14 deletions(-) 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 6b50aa1..aab10d6 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 @@ -240,9 +240,11 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio } // 获取人口详情 - PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); - if(null != populationInfoDTO) { - populationDTO.setPopulationInfoDTO(populationInfoDTO); + if(StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) { + PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); + if (null != populationInfoDTO) { + populationDTO.setPopulationInfoDTO(populationInfoDTO); + } } } } @@ -257,15 +259,17 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio // 获取人口详情 for (PopulationDTO populationDTO : overList) { - PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); - PopulationInfoHouseDTO populationInfoHouseDTO = new PopulationInfoHouseDTO(); - BeanUtils.copyProperties(populationInfoDTO, populationInfoHouseDTO); + if(StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) { + PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); + PopulationInfoHouseDTO populationInfoHouseDTO = new PopulationInfoHouseDTO(); + BeanUtils.copyProperties(populationInfoDTO, populationInfoHouseDTO); - // 获取人员 - PopulationInfoBaseDTO base = populationInfoService.getBase(populationDTO.getPopulationInfoId()); - populationInfoHouseDTO.setPopulationInfoBaseDTO(base); + // 获取人员 + PopulationInfoBaseDTO base = populationInfoService.getBase(populationDTO.getPopulationInfoId()); + populationInfoHouseDTO.setPopulationInfoBaseDTO(base); - populationDTO.setPopulationInfoHouseDTO(populationInfoHouseDTO); + populationDTO.setPopulationInfoHouseDTO(populationInfoHouseDTO); + } // 获取房屋详情 HouseDTO houseDTO = houseService.get(populationDTO.getHouseId()); diff --git a/src/main/resources/templates/population/list.html b/src/main/resources/templates/population/list.html index 0631733..7c344b2 100644 --- a/src/main/resources/templates/population/list.html +++ b/src/main/resources/templates/population/list.html @@ -31,6 +31,9 @@ + diff --git a/src/main/resources/templates/population/save.html b/src/main/resources/templates/population/save.html index e766fc1..2d4f04c 100644 --- a/src/main/resources/templates/population/save.html +++ b/src/main/resources/templates/population/save.html @@ -33,13 +33,13 @@
- +
- +
diff --git a/src/main/resources/templates/population/update.html b/src/main/resources/templates/population/update.html index 45d8849..f857efe 100644 --- a/src/main/resources/templates/population/update.html +++ b/src/main/resources/templates/population/update.html @@ -33,13 +33,13 @@
- +
- +