Commit b4c74d81 authored by hongguangwu's avatar hongguangwu

优化身份证校验格式

parent afdeef55
......@@ -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("姓名身份证不可为空");
......
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