Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
b4c74d81
Commit
b4c74d81
authored
Aug 22, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化身份证校验格式
parent
afdeef55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
TCheckIdCardServiceImpl.java
...d/plus/v1/check/service/impl/TCheckIdCardServiceImpl.java
+22
-22
No files found.
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/service/impl/TCheckIdCardServiceImpl.java
View file @
b4c74d81
...
...
@@ -393,29 +393,29 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
c
.
setIsTrue
(
lastCard
.
getIsTrue
());
c
.
setReason
(
lastCard
.
getReason
());
}
else
{
// 校验姓名身份证规则
if
(!
regIdCard
(
c
.
getIdCard
()))
{
c
.
setIsTrue
(
0
);
c
.
setReason
(
"身份证格式有误"
);
}
else
if
(
regEmpName
(
c
.
getName
()))
{
c
.
setIsTrue
(
0
);
c
.
setReason
(
"姓名含数字或空格,无法校验"
);
nowIdCard
=
returnMap
.
get
(
c
.
getIdCard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
c
.
getName
());
if
(
nowIdCard
!=
null
)
{
c
.
setIsTrue
(
nowIdCard
.
getIsTrue
());
c
.
setReason
(
nowIdCard
.
getReason
());
}
else
{
nowIdCard
=
returnMap
.
get
(
c
.
getIdCard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
c
.
getName
());
// 调用对的身份证信息
nowIdCard
=
trueMap
.
get
(
c
.
getIdCard
());
if
(
nowIdCard
!=
null
)
{
c
.
setIsTrue
(
nowIdCard
.
getIsTrue
());
c
.
setReason
(
nowIdCard
.
getReason
());
if
(
nowIdCard
.
getName
().
equals
(
c
.
getName
()))
{
c
.
setIsTrue
(
nowIdCard
.
getIsTrue
());
c
.
setReason
(
nowIdCard
.
getReason
());
}
else
{
c
.
setIsTrue
(
CommonConstants
.
ZERO_INT
);
c
.
setReason
(
"姓名错误!"
);
}
}
else
{
// 调用对的身份证信息
nowIdCard
=
trueMap
.
get
(
c
.
getIdCard
());
if
(
nowIdCard
!=
null
)
{
if
(
nowIdCard
.
getName
().
equals
(
c
.
getName
()))
{
c
.
setIsTrue
(
nowIdCard
.
getIsTrue
());
c
.
setReason
(
nowIdCard
.
getReason
());
}
else
{
c
.
setIsTrue
(
CommonConstants
.
ZERO_INT
);
c
.
setReason
(
"姓名错误!"
);
}
// 校验姓名身份证规则
if
(!
regIdCard
(
c
.
getIdCard
()))
{
c
.
setIsTrue
(
0
);
c
.
setReason
(
"身份证格式有误"
);
}
else
if
(
regEmpName
(
c
.
getName
()))
{
c
.
setIsTrue
(
0
);
c
.
setReason
(
"姓名含数字或空格,无法校验"
);
}
else
{
// 调用API校验
if
(
nowApiNum
<
canApiNum
)
{
...
...
@@ -432,9 +432,9 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
}
}
}
// 将同身份证的结果存储下来备用,防止撞库
idCardMap
.
put
(
c
.
getIdCard
(),
c
);
}
// 将同身份证的结果存储下来备用,防止撞库
idCardMap
.
put
(
c
.
getIdCard
(),
c
);
}
else
{
c
.
setIsTrue
(
0
);
c
.
setReason
(
"姓名身份证不可为空"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment