From a402d9e5b7ec99d14c7e9b4d6873d9ab50484cc2 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 22 Aug 2022 16:51:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=AF=81=E4=BB=B6=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E3=80=91=E6=8A=A4=E7=85=A7-=E8=AE=BF=E5=AE=A2=E3=80=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=87=87=E9=9B=86=E3=80=81=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E7=A7=9F=E8=B5=81=E3=80=81=E5=85=9A=E5=91=98=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E3=80=81=E5=B1=85=E6=B0=91=E6=B3=A8=E5=86=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=EF=BC=8C=E5=BE=85=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PartyMemberConfirmServiceImpl.java | 9 +++++++++ .../controller/IcResiCollectController.java | 16 ++++++++++++++++ .../IcResiCollectVisitorController.java | 9 +++++++++ .../controller/IcResiUserController.java | 18 ++++++++++++++++++ .../service/impl/UserResiInfoServiceImpl.java | 13 +++++++++++++ .../excel/ic_resi_import_template.xls | Bin 74240 -> 74240 bytes 6 files changed, 65 insertions(+) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 74b9ba9844..961197076d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.IdCardRegexUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.*; import com.epmet.dto.*; @@ -167,6 +168,14 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService @Transactional(rollbackFor = Exception.class) public Result submit(PartymemberInfoDTO partyMemberInfoDTO) { log.info("submit param:{}",JSON.toJSONString(partyMemberInfoDTO)); + + // 证件类型判断----start---- + IdCardRegexUtils regex = IdCardRegexUtils.parse(partyMemberInfoDTO.getIdCard()); + if (regex == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误"); + } + // 证件类型判断----end---- + Result result = new Result(); //校验手机验证码是否正常 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java index cca091439f..d508f670e8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java @@ -4,15 +4,19 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.IdCardRegexUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.IcResiCollectService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -180,6 +184,18 @@ public class IcResiCollectController { //效验数据 ValidatorUtils.validateEntity(formDTO); formDTO.setOrigin("internal");//固定为内部 + + // 证件类型判断----start---- + for (IcResiCollectMemFormDTO member : formDTO.getMemberList()) { + if (StringUtils.isNotBlank(member.getIdNum())) { + IdCardRegexUtils regex = IdCardRegexUtils.parse(member.getIdNum()); + if (regex == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误"); + } + } + } + // 证件类型判断----end---- + return icResiCollectService.saveCollectInfo(formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java index 60995a0211..a3f86c1c28 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java @@ -3,9 +3,12 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.IdCardRegexUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -117,6 +120,12 @@ public class IcResiCollectVisitorController { public Result saveInfo(@RequestBody SaveCollectVisitorFormDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto); + // 证件类型判断----start---- + IdCardRegexUtils regex = IdCardRegexUtils.parse(dto.getIdCard()); + if (regex == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误"); + } + // 证件类型判断----end---- return icResiCollectVisitorService.saveInfo(dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 7604ebc5c7..7ac26844dd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -307,12 +307,30 @@ public class IcResiUserController implements ResultDataResolver { */ @PostMapping("rent/updateimage") public Result updateImage(@LoginUser TokenDto tokenDto, @RequestBody RentTenantFormDTO formDTO) { + + // 身份证号验证 + if (StringUtils.isNotBlank(formDTO.getUser().getIdCard())) { + checkIdCard(formDTO.getUser().getIdCard()); + } + + if (StringUtils.isNotBlank(formDTO.getIdCard())) { + checkIdCard(formDTO.getIdCard()); + } + String resiUserId = icResiUserService.updateImage(tokenDto, formDTO); //推送MQ事件 editResiMq(formDTO.getCustomerId(), resiUserId); return new Result(); } + private void checkIdCard(String idCard) { + // 证件类型判断----start---- + IdCardRegexUtils regex = IdCardRegexUtils.parse(idCard); + if (regex == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "证件号解析错误", "证件号解析错误"); + } + } + private void editResiMq(String customerId, String userId) { //推送MQ事件 IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 44cd7c12a3..8e9af036e7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -26,10 +26,13 @@ import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.enums.IdCardTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.IdCardRegexUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserConstant; @@ -243,6 +246,16 @@ public class UserResiInfoServiceImpl extends BaseServiceImplcms;EPk z@#w>-R!hQ-q_mTa8BMG8o-t7s>`=-yozPP42tD8K=F*OCX76`@-~W8)`=4{ayA#iG z*>hYjlXW@(Afs+nVy=YV@oB>oA&O@Jo)m3FF&6*tJgw99rfa$`)J5;2?{qH8;n6Ke z(IeSKFUm1w=W&tVPIi4f&6X4Brrey$d48b2Iql;6(R_bawySIOQF`iUbx}Wa1jShl zRIWtO6~z$QocF)~#1638;qaM#W{^A6RZDCjuAMn95I07Q7FXbYmpQN&yHTm)q|<^d zE{vplvs38CF7em6x+sbbcLs7iwi>V*4P)wLjWE6tQ0=rV+}WZ<)6V4p?s#`R$S()f z2-?r8wMk`P)h(-Af*cl59aIL1lNIiw-c|$MU?tz$9$g|^lTZ4Z`@=P067?}V)yLKYvV3XTor!8$xLgq{kIwe$|Ul;<1lMe zax9*pIKI|XPri<$Oul|bi;`oLP8|>#Ojw)UCs*%zHoFTZe;d@$Ge7HS>a$uj{79#h zVF`ZsYiJh?ax>yv3-f2|}{%a{3_TLPu?K8f4j_SW1RP%D5r|RqJ zqm&rQB~x{Z3%k=r-m`!nqzrSqBpX13T@tGe4Zn!<-2l*2&Fs4uTO^Cw&_^f^{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