Commit ed1ba425 by tang

添加卡片bug修改

parent 037b4942
......@@ -871,7 +871,7 @@ public class PayApiService {
throw new MyException("结算暂不支持该银行卡片");
}
//贷记卡不支持银行 农业银行,中信银行,招商银行
if(checkCardIsCanUse(cardEntity.getCardNo())){
if(!checkCardIsCanUse(cardEntity.getCardNo())){
throw new MyException("贷记卡暂不支持该银行");
}
JuhezhongDto dto = new JuhezhongDto();
......@@ -1544,6 +1544,7 @@ public class PayApiService {
//获取银行卡银行,是否可用
private boolean checkCardIsCanUse(String cardNum){
logger.debug("校验的银行卡号:{}",cardNum);
boolean flag = true;
String cardDetail = getCardDetailByAli(cardNum);
JSONObject parse = (JSONObject) JSONObject.parse(cardDetail);
......
......@@ -369,7 +369,7 @@ public class UserApiController {
} catch (MyException e) {
resp.setStatus(ComCode.STATUS_CODE_5001);
if(e.getMessage().equals("输入银行卡号有误") || e.getMessage().equals("银行卡类别不正确")
|| e.getMessage().equals("手机号码格式不正确")|| e.getMessage().equals("信用卡信息需补全")){
|| e.getMessage().equals("手机号码格式不正确")|| e.getMessage().equals("信用卡信息需补全") || e.getMessage().equals("不能重复添加卡片")){
resp.setMessage(e.getMessage());
}else{
resp.setMessage(ComCode.STATUS_CODE_5001_DESC);
......
......@@ -232,6 +232,10 @@ public class UserApiService {
logger.debug("输入银行卡号有误");
throw new MyException("输入银行卡号有误");
}
CardEntity cardEntity1 = userDao.getCardEntity(request);
if(cardEntity1 != null){
throw new MyException("不能重复添加卡片");
}
// CC信用卡,DC储蓄卡
String cardType = checkCardNum.equals("CC")?"C":"D";
if (!request.getCardType().equals(cardType)){
......
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