diff --git a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java index 85a7d24..aa2bae8 100644 --- a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java +++ b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java @@ -121,7 +121,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul String newName = name.substring(0, 1) + xin + name.substring(name.length()-1, name.length()); dto.setName(newName); }else{ - String newName = name.substring(0, 1); + String newName = name.substring(0, 1) + "*"; dto.setName(newName); } } @@ -157,7 +157,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul String newName = name.substring(0, 1) + xin + name.substring(name.length()-1, name.length()); dto.setName(newName); }else{ - String newName = name.substring(0, 1); + String newName = name.substring(0, 1) + "*"; dto.setName(newName); } } @@ -256,7 +256,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul throw new SaveException("该证件号码错误"); } } - if (populationInfoVO.getName().length() < 2) { + if (populationInfoVO.getName().length() < 2 || populationInfoVO.getName().length() > 15) { throw new SaveException("姓名错误"); } String areaCode = populationInfoVO.getDomicileAreaCode(); @@ -332,7 +332,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul throw new SaveException("该证件号码错误"); } } - if (populationInfoVO.getName().length() < 2) { + if (populationInfoVO.getName().length() < 2 || populationInfoVO.getName().length() > 15) { throw new SaveException("姓名错误"); } String areaCode = populationInfoVO.getDomicileAreaCode();