Commit 7c947ddf by tang

身份证校验

parent 8ce4d01c
...@@ -446,6 +446,8 @@ public class UserApiController { ...@@ -446,6 +446,8 @@ public class UserApiController {
|| StringUtils.isBlank(request.getBelongBank()) || StringUtils.isBlank(request.getBelongBank())
|| StringUtils.isBlank(request.getCardBank()) || StringUtils.isBlank(request.getCardBank())
) { ) {
logger.debug("业务参数就异常了");
logger.debug(request.toString());
// || StringUtils.isBlank(request.getIdCardPlace())|| StringUtils.isBlank(request.getIdCardFront())|| StringUtils.isBlank(request.getIdCardBack())|| StringUtils.isBlank(request.getIdCardBack()) // || StringUtils.isBlank(request.getIdCardPlace())|| StringUtils.isBlank(request.getIdCardFront())|| StringUtils.isBlank(request.getIdCardBack())|| StringUtils.isBlank(request.getIdCardBack())
// || StringUtils.isBlank(request.getIdCardHold())|| StringUtils.isBlank(request.getDebitCard())|| StringUtils.isBlank(request.getCardSrc())|| StringUtils.isBlank(request.getCardPlace()) // || StringUtils.isBlank(request.getIdCardHold())|| StringUtils.isBlank(request.getDebitCard())|| StringUtils.isBlank(request.getCardSrc())|| StringUtils.isBlank(request.getCardPlace())
resp.setStatus(ComCode.STATUS_CODE_4001); resp.setStatus(ComCode.STATUS_CODE_4001);
...@@ -453,15 +455,16 @@ public class UserApiController { ...@@ -453,15 +455,16 @@ public class UserApiController {
return resp; return resp;
} }
//身份证参数格式校验 //身份证参数格式校验
if(!verifyIdentityCard(request.getIdCard())){ if(!verifyIdentityCard(request.getIdCard().trim())){
logger.debug("身份证这里校验出问题了");
throw new MyException("身份证号码格式不正确"); throw new MyException("身份证号码格式不正确");
} }
//进行卡片校验 //进行卡片校验
if(!NumberUtils.isNumber(request.getCardNo())){ if(!NumberUtils.isNumber(request.getCardNo().trim())){
throw new MyException("卡号格式不正确"); throw new MyException("卡号格式不正确");
} }
//手机号码校验 //手机号码校验
if(!regex.matcher(request.getCardMobile()).matches()){ if(!regex.matcher(request.getCardMobile().trim()).matches()){
throw new MyException("手机号码格式不正确"); throw new MyException("手机号码格式不正确");
} }
......
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