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 72ec20f..6235913 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 @@ -83,10 +83,12 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio params.put("outHouse", 0); // 解除脱敏 - PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationVO.getPopulationInfoId()); - params.put("name", populationInfoDTO.getName()); - params.put("cardNum", populationInfoDTO.getIdcard()); - params.put("phone", populationInfoDTO.getPhone()); + if(null != params.get("populationInfoId") && StringUtils.isNotEmpty(params.get("populationInfoId").toString())) { + PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationVO.getPopulationInfoId()); + params.put("name", populationInfoDTO.getName()); + params.put("cardNum", populationInfoDTO.getIdcard()); + params.put("phone", populationInfoDTO.getPhone()); + } populationDao.save(params); return populationId; @@ -184,7 +186,16 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio public List list(Map params) { List list = populationDao.list(params); for (PopulationDTO populationDTO : list) { - PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); + PopulationInfoDTO populationInfoDTO = new PopulationInfoDTO(); + if(StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) { + populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); + }else { + populationInfoDTO.setIdcard(populationDTO.getCardNum()); + populationInfoDTO.setName(populationDTO.getName()); + populationInfoDTO.setPhone(populationDTO.getPhone()); + populationInfoDTO.setIdcardType("身份证"); + } + populationInfoService.getTuoMin(populationInfoDTO); populationDTO.setCardNum(populationInfoDTO.getIdcard());