diff --git a/src/main/java/com/yn/bftl/thirdparty/modules/chinaums/service/impl/AuthServiceImpl.java b/src/main/java/com/yn/bftl/thirdparty/modules/chinaums/service/impl/AuthServiceImpl.java index 45c3a47..c83726b 100644 --- a/src/main/java/com/yn/bftl/thirdparty/modules/chinaums/service/impl/AuthServiceImpl.java +++ b/src/main/java/com/yn/bftl/thirdparty/modules/chinaums/service/impl/AuthServiceImpl.java @@ -38,6 +38,7 @@ import com.yn.bftl.thirdparty.modules.chinaums.service.BaseElecBankService; import com.yn.bftl.thirdparty.modules.chinaums.util.ByxChinaumsUtil; import com.yn.bftl.thirdparty.modules.chinaums.vo.ChinaumsApplicationStatusVO; +import com.yn.bftl.thirdparty.modules.chinaums.vo.byx.ByxChinaumsMchRegInfoDetailVO; import com.yn.bftl.thirdparty.modules.chinaums.vo.byx.ByxChinaumsMchRegInfoVO; import com.yn.bftl.thirdparty.modules.chinaums.vo.byx.ByxMchCreateVO; import com.yn.bftl.thirdparty.modules.chinaums.vo.chinaums.ChinaumsMchStatus; @@ -363,8 +364,12 @@ JSONObject params = new JSONObject(); params.put("registerNo", registerNo); ByxChinaumsMchRegInfoVO chinaumsMchRegInfoVO = byxChinaumsUtil.execute(ByxRouteUtil.ROUTE_WALLET_APPLICATIONS_REG_INFO, params, ByxChinaumsMchRegInfoVO.class); + if (chinaumsMchRegInfoVO == null || chinaumsMchRegInfoVO.getList() == null || chinaumsMchRegInfoVO.getList().size() < 1) { + throw new RuntimeException("找不到商家认证信息."); + } + ByxChinaumsMchRegInfoDetailVO detailVO = chinaumsMchRegInfoVO.getList().get(0); // 查询完状态后需要将银联认证信息中的状态更新 - switch (chinaumsMchRegInfoVO.getRegStatus()) { + switch (detailVO.getRegStatus()) { case "01": // 01-已发送注册链接 email; case "02": // 02-已验证邮箱(已验证注册链接) @@ -392,26 +397,26 @@ chinaumsAuthInfo.setApplicationStatus(ApplicationStatus.SUCCEEDED); // 保存企业电子账簿ID if(StringUtils.isBlank(company.getWalletId())){ - company.setWalletId(chinaumsMchRegInfoVO.getBwalletId()); + company.setWalletId(detailVO.getBwalletId()); companyRepository.save(company); } // 保存相关信息到认证信息中 - chinaumsAuthInfo.setRelAcctNo(chinaumsMchRegInfoVO.getBwalletId()); - chinaumsAuthInfo.setBalanceAcctId(chinaumsMchRegInfoVO.getBwalletId()); - chinaumsAuthInfo.setBusinessLicenseNumber(chinaumsMchRegInfoVO.getBizLicNo()); - chinaumsAuthInfo.setBusinessLicenseCompanyName(chinaumsMchRegInfoVO.getCompanyName()); - chinaumsAuthInfo.setBusinessLicenseCompanyAddress(chinaumsMchRegInfoVO.getRegistAddr()); - chinaumsAuthInfo.setContactIdCardName(chinaumsMchRegInfoVO.getContactName()); - chinaumsAuthInfo.setContactMobileNumber(chinaumsMchRegInfoVO.getContactPhoneNum()); - chinaumsAuthInfo.setContactEmail(chinaumsMchRegInfoVO.getContactEmail()); - chinaumsAuthInfo.setLegalPersonIdCardName(chinaumsMchRegInfoVO.getLegalName()); - chinaumsAuthInfo.setLegalPersonIdCardType(chinaumsMchRegInfoVO.getLegalIdType()); - chinaumsAuthInfo.setLegalPersonMobileNumber(chinaumsMchRegInfoVO.getLegalPhoneNum()); - chinaumsAuthInfo.setSettleAcctBankBranchCode(chinaumsMchRegInfoVO.getBankNo()); - chinaumsAuthInfo.setSettleAcctBankName(chinaumsMchRegInfoVO.getBankName()); - chinaumsAuthInfo.setSettleAcctName(chinaumsMchRegInfoVO.getBwalletAcctName()); - chinaumsAuthInfo.setIdCardNumber(chinaumsMchRegInfoVO.getLegalIdCard()); - chinaumsAuthInfo.setSettleAcctBankAcctNo(chinaumsMchRegInfoVO.getSettAcctNo()); + chinaumsAuthInfo.setRelAcctNo(detailVO.getBwalletId()); + chinaumsAuthInfo.setBalanceAcctId(detailVO.getBwalletId()); + chinaumsAuthInfo.setBusinessLicenseNumber(detailVO.getBizLicNo()); + chinaumsAuthInfo.setBusinessLicenseCompanyName(detailVO.getCompanyName()); + chinaumsAuthInfo.setBusinessLicenseCompanyAddress(detailVO.getRegistAddr()); + chinaumsAuthInfo.setContactIdCardName(detailVO.getContactName()); + chinaumsAuthInfo.setContactMobileNumber(detailVO.getContactPhoneNum()); + chinaumsAuthInfo.setContactEmail(detailVO.getContactEmail()); + chinaumsAuthInfo.setLegalPersonIdCardName(detailVO.getLegalName()); + chinaumsAuthInfo.setLegalPersonIdCardType(detailVO.getLegalIdType()); + chinaumsAuthInfo.setLegalPersonMobileNumber(detailVO.getLegalPhoneNum()); + chinaumsAuthInfo.setSettleAcctBankBranchCode(detailVO.getBankNo()); + chinaumsAuthInfo.setSettleAcctBankName(detailVO.getBankName()); + chinaumsAuthInfo.setSettleAcctName(detailVO.getBwalletAcctName()); + chinaumsAuthInfo.setIdCardNumber(detailVO.getLegalIdCard()); + chinaumsAuthInfo.setSettleAcctBankAcctNo(detailVO.getSettAcctNo()); chinaumsAuthInfo.setElecBankNo(chinaumsAuthInfo.getElecBankNo()); chinaumsAuthInfoRepository.save(chinaumsAuthInfo);