From 77e5fff71db526ce307da6ce6f6fa92dea04d88b Mon Sep 17 00:00:00 2001 From: "java_cuibaocheng@163.com" Date: Sat, 4 Nov 2023 15:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=81=E4=BB=B6=E5=8F=B7?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=20,=20=E4=BA=BA=E5=8F=A3=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=20,=20=E5=B9=B4=E9=BE=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../populationinfo/PopulationInfoBaseDTO.java | 7 +- .../impl/PopulationInfoServiceImpl.java | 51 +- .../templates/populationinfo/save.html | 1401 ++++++++-------- .../templates/populationinfo/update.html | 1404 +++++++++-------- 4 files changed, 1477 insertions(+), 1386 deletions(-) diff --git a/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java b/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java index 5cd9a66..96e8b86 100644 --- a/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java @@ -5,6 +5,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.StringUtils; +import java.time.LocalDate; +import java.time.Period; + @ApiModel public class PopulationInfoBaseDTO { @@ -90,7 +93,9 @@ public class PopulationInfoBaseDTO { } public Integer getAge() { - return IdCardVerifyUtil.getIdCardAge(idcard); + LocalDate birthDate = LocalDate.parse(this.birthday); + Period period = Period.between(birthDate, LocalDate.now()); + return period.getYears(); } public void setAge(Integer age) { 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 3d31bff..70945b1 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 @@ -8,7 +8,6 @@ import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResultList; import com.cm.common.token.app.AppTokenManager; import com.cm.common.token.app.entity.AppTokenUser; -import com.cm.common.utils.DateUtil; import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; import com.cm.population.dao.areatree.IAreatreeDao; @@ -40,7 +39,6 @@ import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.util.*; /** @@ -80,13 +78,12 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul List list = iAreatreeDao.getAreaList(params); for (AreaZtreeDTO dto : list) { Integer count = iAreatreeDao.countByParentId(dto.getId()); - if (count > 0) { + if(count > 0) { dto.setIsParent(true); } } return list; } - @Autowired private ICorrectService iCorrectService; @Autowired @@ -101,7 +98,6 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul private IReleaseService iReleaseService; @Autowired private ISecurityService iSecurityService; - @Override public PopulationInfoBaseDTO getBase(String populationInfoId) { Map query = new HashMap<>(); @@ -149,15 +145,17 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul if (dto != null) { throw new SaveException("该证件号码已存在"); } - if (!IdCardVerifyUtil.isIDCard(populationInfoVO.getIdcard().trim())) { - throw new SaveException("该证件号码错误"); + if (populationInfoVO.getIdcardType().equals("身份证")) { + if(!IdCardVerifyUtil.isIDCard(populationInfoVO.getIdcard().trim())) { + throw new SaveException("该证件号码错误"); + } } String areaCode = populationInfoVO.getDomicileAreaCode(); - if (areaCode.startsWith("150271")) { //包头稀土高新技术产业开发区 + if(areaCode.startsWith("150271")) { //包头稀土高新技术产业开发区 populationInfoVO.setDomicileAddressType("3"); - } else if (areaCode.startsWith("1502")) { //包头市 + }else if(areaCode.startsWith("1502")) { //包头市 populationInfoVO.setDomicileAddressType("2"); - } else { //非包头市 + }else { //非包头市 populationInfoVO.setDomicileAddressType("1"); } Map params = HashMapUtil.objectToMap(populationInfoVO); @@ -176,9 +174,9 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul public void remove(String token, List ids) { Map params = getHashMap(2); params.put("populationInfoIds", ids); - if (StringUtils.isEmpty(token)) { + if(StringUtils.isEmpty(token)) { setUpdateInfo(params); - } else { + }else{ setUpdateInfo(token, params); } populationInfoDao.remove(params); @@ -188,9 +186,9 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul public void delete(String token, List ids) { Map params = getHashMap(2); params.put("populationInfoIds", ids); - if (StringUtils.isEmpty(token)) { + if(StringUtils.isEmpty(token)) { setUpdateInfo(params); - } else { + }else{ setUpdateInfo(token, params); } populationInfoDao.delete(params); @@ -208,21 +206,23 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul if (dto != null && !dto.getPopulationInfoId().equals(populationInfoId)) { throw new SaveException("该证件号码已存在"); } - if (!IdCardVerifyUtil.isIDCard(populationInfoVO.getIdcard().trim())) { - throw new SaveException("该证件号码错误"); + if (populationInfoVO.getIdcardType().equals("身份证")) { + if(!IdCardVerifyUtil.isIDCard(populationInfoVO.getIdcard().trim())) { + throw new SaveException("该证件号码错误"); + } } String areaCode = populationInfoVO.getDomicileAreaCode(); - if (areaCode.startsWith("150271")) { //包头稀土高新技术产业开发区 + if(areaCode.startsWith("150271")) { //包头稀土高新技术产业开发区 populationInfoVO.setDomicileAddressType("3"); - } else if (areaCode.startsWith("1502")) { //包头市 + }else if(areaCode.startsWith("1502")) { //包头市 populationInfoVO.setDomicileAddressType("2"); - } else { //非包头市 + }else { //非包头市 populationInfoVO.setDomicileAddressType("1"); } params.put("populationInfoId", populationInfoId); - if (StringUtils.isEmpty(token)) { + if(StringUtils.isEmpty(token)) { setUpdateInfo(params); - } else { + }else{ setUpdateInfo(token, params); } populationInfoDao.update(params); @@ -273,14 +273,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul @Override public List list(Map params) { - List populationInfoDTOS = populationInfoDao.list(params); - populationInfoDTOS.forEach(populationInfoDTO -> { - if (StringUtils.isBlank(populationInfoDTO.getBirthday())) { - return; - } - populationInfoDTO.setAge(DateUtil.getAgeByBirthday(populationInfoDTO.getBirthday())); - }); - return populationInfoDTOS; + return populationInfoDao.list(params); } @Override diff --git a/src/main/resources/templates/populationinfo/save.html b/src/main/resources/templates/populationinfo/save.html index 671858d..edb8ff9 100644 --- a/src/main/resources/templates/populationinfo/save.html +++ b/src/main/resources/templates/populationinfo/save.html @@ -14,11 +14,11 @@ @@ -34,586 +34,243 @@
-
-
- -
- +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
-
-
-
- -
- -
-
-
-
- -
- +
+
+
+ +
+ +
+
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- +
+
+
+ +
+ +
-
-
-
-
- -
- +
+
+ +
+ +
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- - - +
+
+ +
+ +
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
-
-
-
-
- -
- +
+
+ +
+ +
-
-
- -
-
-
-
- -
- - +
+
+ +
+ + + +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- - -
-
-
-
-
-
- -
- - +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- - -
-
-
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
-

老年人

-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-

残疾人

-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
- -
-
-
-
-
-

服役/退役

-
-
-
-
- -
- - +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
-
-
- -
- +
+
+
+
+
    +
  • 老年人
  • +
  • 残疾人
  • +
  • 服役/退役
  • +
  • 社会救助
  • +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
-
-
-
- -
- -
-
-
-
-

社会救助

-
-
-
-
- -
- - +
+
+
+
    +
  • 党员
  • +
  • 其他
  • +
+
+
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
-

党员

-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
diff --git a/src/main/resources/templates/populationinfo/update.html b/src/main/resources/templates/populationinfo/update.html index 52f38f6..547500a 100644 --- a/src/main/resources/templates/populationinfo/update.html +++ b/src/main/resources/templates/populationinfo/update.html @@ -33,586 +33,243 @@
-
-
- -
- +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
-
-
-
- -
- -
-
-
-
- -
- +
+
+
+ +
+ +
+
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- +
+
+
+ +
+ +
-
-
-
-
- -
- +
+
+ +
+ +
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- - - +
+
+ +
+ +
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
-
-
-
-
- -
- +
+
+ +
+ +
-
-
- -
-
-
-
- -
- - +
+
+ +
+ + + +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- - -
-
-
-
-
-
- -
- - +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- - -
-
-
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
-

老年人

-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-

残疾人

-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
-
- -
-
-
-
-
-

服役/退役

-
-
-
-
- -
- - +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
-
-
- -
- +
+
+
+
+
    +
  • 老年人
  • +
  • 残疾人
  • +
  • 服役/退役
  • +
  • 社会救助
  • +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
-
-
-
- -
- -
-
-
-
-

社会救助

-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - -
-
-
-
-
- -
- - +
+
+
+
    +
  • 党员
  • +
  • 其他
  • +
+
+
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
-
-

党员

-
-
-
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
+ + + + + + +