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 @@
- +
- +