Commit b4c74d81 authored by hongguangwu's avatar hongguangwu

优化身份证校验格式

parent afdeef55
...@@ -393,29 +393,29 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh ...@@ -393,29 +393,29 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
c.setIsTrue(lastCard.getIsTrue()); c.setIsTrue(lastCard.getIsTrue());
c.setReason(lastCard.getReason()); c.setReason(lastCard.getReason());
} else { } else {
// 校验姓名身份证规则 nowIdCard = returnMap.get(c.getIdCard() + CommonConstants.DOWN_LINE_STRING + c.getName());
if (!regIdCard(c.getIdCard())) { if (nowIdCard != null) {
c.setIsTrue(0); c.setIsTrue(nowIdCard.getIsTrue());
c.setReason("身份证格式有误"); c.setReason(nowIdCard.getReason());
} else if (regEmpName(c.getName())) {
c.setIsTrue(0);
c.setReason("姓名含数字或空格,无法校验");
} else { } else {
nowIdCard = returnMap.get(c.getIdCard() + CommonConstants.DOWN_LINE_STRING + c.getName()); // 调用对的身份证信息
nowIdCard = trueMap.get(c.getIdCard());
if (nowIdCard != null) { if (nowIdCard != null) {
c.setIsTrue(nowIdCard.getIsTrue()); if (nowIdCard.getName().equals(c.getName())) {
c.setReason(nowIdCard.getReason()); c.setIsTrue(nowIdCard.getIsTrue());
c.setReason(nowIdCard.getReason());
} else {
c.setIsTrue(CommonConstants.ZERO_INT);
c.setReason("姓名错误!");
}
} else { } else {
// 调用对的身份证信息 // 校验姓名身份证规则
nowIdCard = trueMap.get(c.getIdCard()); if (!regIdCard(c.getIdCard())) {
if (nowIdCard != null) { c.setIsTrue(0);
if (nowIdCard.getName().equals(c.getName())) { c.setReason("身份证格式有误");
c.setIsTrue(nowIdCard.getIsTrue()); } else if (regEmpName(c.getName())) {
c.setReason(nowIdCard.getReason()); c.setIsTrue(0);
} else { c.setReason("姓名含数字或空格,无法校验");
c.setIsTrue(CommonConstants.ZERO_INT);
c.setReason("姓名错误!");
}
} else { } else {
// 调用API校验 // 调用API校验
if (nowApiNum < canApiNum) { if (nowApiNum < canApiNum) {
...@@ -432,9 +432,9 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh ...@@ -432,9 +432,9 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
} }
} }
} }
// 将同身份证的结果存储下来备用,防止撞库
idCardMap.put(c.getIdCard(), c);
} }
// 将同身份证的结果存储下来备用,防止撞库
idCardMap.put(c.getIdCard(), c);
} else { } else {
c.setIsTrue(0); c.setIsTrue(0);
c.setReason("姓名身份证不可为空"); c.setReason("姓名身份证不可为空");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment