From 99b9d0b46d82e8b8a132d64113e5b66bfff5043e Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 29 Aug 2022 10:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E3=80=91=E6=8A=A4=E7=85=A7=E6=AD=A3=E5=88=99=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A8-9=E4=BD=8D=E5=AD=97=E6=AF=8D=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/IdCardRegexUtils.java | 4 ++-- .../com/epmet/service/impl/IcResiUserImportServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java index d44e9bb3fb..96d7d02a62 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java @@ -25,7 +25,7 @@ public class IdCardRegexUtils { /** * 9位护照 */ - private static final Pattern PATTERN_9_PASSPORT = Pattern.compile("^[a-zA-Z]{2}\\d{7}$|^[a-zA-Z]{1}\\d{8}$"); + private static final Pattern PATTERN_9_PASSPORT = Pattern.compile("^[a-zA-Z0-9]{8,9}$"); private String inputText; @@ -86,7 +86,7 @@ public class IdCardRegexUtils { } } - if (input.length() == 9) { + if (input.length() == 9 || input.length() == 8) { Matcher matcher = PATTERN_9_PASSPORT.matcher(input); if (matcher.matches()) { return new IdCardRegexUtils(IdCardTypeEnum.PASSPORT, matcher, input); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 3976b304fc..2a57869b36 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -632,7 +632,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // ================== 数据补充 =================== IdCardRegexUtils regexUtilInstance = IdCardRegexUtils.parse(idCard); if (regexUtilInstance == null) { - String s = "请输入正确的证件号"; + String s = "证件号解析错误,或不支持的证件类型。(请使用身份证号或者护照号)"; throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), s, s); }