Commit a7225eca by Java-聂换换

修改支付得bug

parent d9a1fe75
......@@ -108,27 +108,27 @@ public class JuHeZhongPayJFenService {
// subMchId = B105244442
//
// 聂换换 B105247024
// dto.put("serviceType",1);
// dto.put("subMerchantName","kklsubMerchantName32");
// dto.put("subMerchantType","PERSON");
// dto.put("businessLicense","businessLicense23");
// dto.put("legalPersonName","聂换换");
// dto.put("legalPersonID","130434199212214429");
// dto.put("subMerchantPersonName","聂换换");
// dto.put("subMerchantPersonPhone","13722537737");
// dto.put("bankType","TOPRIVATE");
//
// dto.put("accountName","聂换换");
// dto.put("accountNo","6217000060031684713");
// dto.put("bankName","中国建设银行");
// dto.put("bankProv","天津");
// dto.put("bankCity","天津市");
// dto.put("bankBranch","开户地址new");
// dto.put("bankCode","105100000017");
//
// dto.put("timestamp",System.currentTimeMillis());
//
// juHeZhongPayJFenService.merchantIn(dto);
dto.put("serviceType",1);
dto.put("subMerchantName","kklsubMerchantName32");
dto.put("subMerchantType","PERSON");
dto.put("businessLicense","businessLicense23");
dto.put("legalPersonName","聂换换");
dto.put("legalPersonID","130434199212214429");
dto.put("subMerchantPersonName","聂换换");
dto.put("subMerchantPersonPhone","13722537737");
dto.put("bankType","TOPRIVATE");
dto.put("accountName","聂换换");
dto.put("accountNo","6217000060031684713");
dto.put("bankName","中国建设银行");
dto.put("bankProv","天津");
dto.put("bankCity","天津市");
dto.put("bankBranch","开户地址new");
dto.put("bankCode","105100000017");
dto.put("timestamp",System.currentTimeMillis());
juHeZhongPayJFenService.merchantIn(dto);
......
......@@ -408,9 +408,13 @@ public class PayApiService {
dto.put("accountName",userDetailEntity.getRealName());
dto.put("accountNo",cardEntityDebit.getCardNo());
dto.put("bankName",cardEntityDebit.getBankName());
dto.put("bankProv",cardEntityDebit.getCity());
dto.put("bankCity",cardEntityDebit.getCity());
dto.put("bankBranch",cardEntityDebit.getCardPlace());
dto.put("bankProv","天津市");
dto.put("bankCity","天津市");
dto.put("bankBranch","天津市职场");
// dto.put("bankProv",cardEntityDebit.getCity());
// dto.put("bankCity",cardEntityDebit.getCity());
// dto.put("bankBranch",cardEntityDebit.getCardPlace());
dto.put("bankCode",cardEntityDebit.getBelongBank());
dto.put("timestamp",System.currentTimeMillis());
......@@ -605,51 +609,55 @@ public class PayApiService {
userSubMchId = userService.getUserSubmchid(userSubMchId);
// 如果没有注册 则先注册
if(userSubMchId == null){
UserEntity userEntity = userService.getUserInfo(request);
UserDetailEntity userDetailEntity = userService.getUserDetailByCode(request.getSubMerchantCode());
CardEntity cardEntityDebit = userService.getCardInfoByCode(userEntity);
JSONObject dto = new JSONObject();
String orderId = MakeOrderNum.makeOrderNum();
dto.put("orderId", MakeOrderNum.makeOrderNum());
dto.put("serviceType",1);
dto.put("subMerchantName",userDetailEntity.getRealName()+orderId);
dto.put("subMerchantType","PERSON");
dto.put("businessLicense",userDetailEntity.getRealName()+orderId);
dto.put("legalPersonName",userDetailEntity.getRealName());
dto.put("legalPersonID",userDetailEntity.getIdCard());
dto.put("subMerchantPersonName",userDetailEntity.getRealName());
dto.put("subMerchantPersonPhone",userEntity.getMobile());
dto.put("bankType","TOPRIVATE");
dto.put("accountName",userDetailEntity.getRealName());
dto.put("accountNo",cardEntityDebit.getCardNo());
dto.put("bankName",cardEntityDebit.getBankName());
dto.put("bankProv",cardEntityDebit.getProvince());
dto.put("bankCity",cardEntityDebit.getCity());
dto.put("bankBranch",cardEntityDebit.getCardPlace());
dto.put("bankCode",cardEntityDebit.getBelongBank());
dto.put("timestamp",System.currentTimeMillis());
JSONObject jsonObject = null;
try {
jsonObject = juHeZhongPayJFenService.merchantIn(dto);
} catch (Exception e) {
}
if (!"0000".equals(jsonObject.getString("code"))) {
new MyException(jsonObject.getString("msg"));
}
String subMchId = jsonObject.getString("subMchId");
userSubMchId = new UserSubMchId();
userSubMchId.setUserCode(request.getSubMerchantCode());
userSubMchId.setPayChannel(ComCode.PAYCHANNEL_HL2);
userSubMchId.setSubmchid(subMchId);
userService.addUserSubmchid(userSubMchId);
throw new MyException("未开卡,请先开卡");
// UserEntity userEntity = userService.getUserInfo(request);
// UserDetailEntity userDetailEntity = userService.getUserDetailByCode(request.getSubMerchantCode());
// CardEntity cardEntityDebit = userService.getCardInfoByCode(userEntity);
// JSONObject dto = new JSONObject();
//
// String orderId = MakeOrderNum.makeOrderNum();
//
// dto.put("orderId", MakeOrderNum.makeOrderNum());
//
// dto.put("serviceType",1);
// dto.put("subMerchantName",userDetailEntity.getRealName()+orderId);
// dto.put("subMerchantType","PERSON");
// dto.put("businessLicense",userDetailEntity.getRealName()+orderId);
// dto.put("legalPersonName",userDetailEntity.getRealName());
// dto.put("legalPersonID",userDetailEntity.getIdCard());
// dto.put("subMerchantPersonName",userDetailEntity.getRealName());
// dto.put("subMerchantPersonPhone",userEntity.getMobile());
// dto.put("bankType","TOPRIVATE");
//
// dto.put("accountName",userDetailEntity.getRealName());
// dto.put("accountNo",cardEntityDebit.getCardNo());
// dto.put("bankName",cardEntityDebit.getBankName());
// dto.put("bankProv",cardEntityDebit.getProvince());
// dto.put("bankCity",cardEntityDebit.getCity());
// dto.put("bankBranch",cardEntityDebit.getCardPlace());
// dto.put("bankCode",cardEntityDebit.getBelongBank());
//
// dto.put("timestamp",System.currentTimeMillis());
//
// JSONObject jsonObject = null;
// try {
// jsonObject = juHeZhongPayJFenService.merchantIn(dto);
// } catch (Exception e) {
//
// }
// if (!"0000".equals(jsonObject.getString("code"))) {
// new MyException(jsonObject.getString("msg"));
// }
// String subMchId = jsonObject.getString("subMchId");
// userSubMchId = new UserSubMchId();
// userSubMchId.setUserCode(request.getSubMerchantCode());
// userSubMchId.setPayChannel(ComCode.PAYCHANNEL_HL2);
// userSubMchId.setSubmchid(subMchId);
// userService.addUserSubmchid(userSubMchId);
}
// if(){
//
// }
OrderEntity orderEntity = this.getOrder(request.getPayNo());
PayBackDto payBackDto = new PayBackDto();
......
......@@ -316,28 +316,28 @@ public class UserApiController {
Response resp = new Response();
try {
// 判断业务入参是否为空
if (StringUtils.isBlank(request.getSubMerchantCode()) || StringUtils.isBlank(request.getIdentityCode()) || StringUtils.isBlank(request.getFunction()) || StringUtils.isBlank(request.getCardType()) || StringUtils.isBlank(request.getCardNo()) || StringUtils.isBlank(request.getCardMobile()) || StringUtils.isBlank(request.getBelongBank()) || StringUtils.isBlank(request.getCardBank()) || StringUtils.isBlank(request.getCardPlace())) {
if (StringUtils.isBlank(request.getSubMerchantCode()) || StringUtils.isBlank(request.getIdentityCode()) || StringUtils.isBlank(request.getFunction()) || StringUtils.isBlank(request.getCardType()) || StringUtils.isBlank(request.getCardNo()) || StringUtils.isBlank(request.getCardMobile()) || StringUtils.isBlank(request.getBelongBank()) || StringUtils.isBlank(request.getCardBank())) {
resp.setStatus(ComCode.STATUS_CODE_4001);
resp.setMessage(ComCode.STATUS_CODE_4001_DESC);
return resp;
}
// 根据手机号 + 使用场景 + 验证码查询
request.setMobile(request.getCardMobile());
IdentityCodeEntity identityCodeEntity = userService.getIdentifyCode(request);
// 验证码使用场景
if (identityCodeEntity == null // 未查询到
|| ("5".equals(request.getFunction()) && !"D".equals(request.getCardType())) // function = 储蓄卡,但cardType = 信用卡
|| ("6".equals(request.getFunction()) && !"C".equals(request.getCardType()))) { // function = 信用卡,但cardType = 储蓄卡
resp.setStatus(ComCode.STATUS_CODE_4010);
resp.setMessage(ComCode.STATUS_CODE_4010_DESC);
return resp;
}
// 验证码是否过期
if (!userService.checkIdentifyCodeExpired(identityCodeEntity)) {
resp.setStatus(ComCode.STATUS_CODE_4009);
resp.setMessage(ComCode.STATUS_CODE_4009_DESC);
return resp;
}
// IdentityCodeEntity identityCodeEntity = userService.getIdentifyCode(request);
// // 验证码使用场景
// if (identityCodeEntity == null // 未查询到
// || ("5".equals(request.getFunction()) && !"D".equals(request.getCardType())) // function = 储蓄卡,但cardType = 信用卡
// || ("6".equals(request.getFunction()) && !"C".equals(request.getCardType()))) { // function = 信用卡,但cardType = 储蓄卡
// resp.setStatus(ComCode.STATUS_CODE_4010);
// resp.setMessage(ComCode.STATUS_CODE_4010_DESC);
// return resp;
// }
// // 验证码是否过期
// if (!userService.checkIdentifyCodeExpired(identityCodeEntity)) {
// resp.setStatus(ComCode.STATUS_CODE_4009);
// resp.setMessage(ComCode.STATUS_CODE_4009_DESC);
// return resp;
// }
userService.addNewCard(request);
resp.setStatus(ComCode.STATUS_CODE_2000);
resp.setMessage(ComCode.STATUS_CODE_2000_DESC);
......
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