mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-13 14:30:08 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -24,6 +24,8 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -46,6 +48,7 @@ public class AdapayMemberService {
|
|||||||
* @param dto
|
* @param dto
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
|
||||||
public void createMember(AdapayMemberInfoDTO dto) throws Exception {
|
public void createMember(AdapayMemberInfoDTO dto) throws Exception {
|
||||||
AdapayMemberInfo adapayMemberInfo = adapayMemberInfoService.selectByMerchantId(dto.getMerchantId());
|
AdapayMemberInfo adapayMemberInfo = adapayMemberInfoService.selectByMerchantId(dto.getMerchantId());
|
||||||
if (adapayMemberInfo != null) {
|
if (adapayMemberInfo != null) {
|
||||||
@@ -78,7 +81,55 @@ public class AdapayMemberService {
|
|||||||
|
|
||||||
dto.setAdapayMemberId(adapayMemberInfo.getMemberId());
|
dto.setAdapayMemberId(adapayMemberInfo.getMemberId());
|
||||||
// 创建结算账户
|
// 创建结算账户
|
||||||
createSettleAccount(dto);
|
// createSettleAccount(dto);
|
||||||
|
Map<String, Object> accountInfo = Maps.newHashMap();
|
||||||
|
// 银行卡号
|
||||||
|
accountInfo.put("card_id", dto.getCardId());
|
||||||
|
// 银行卡对应的户名
|
||||||
|
accountInfo.put("card_name", dto.getCardName());
|
||||||
|
// 证件号,银行账户类型为对私时,必填
|
||||||
|
accountInfo.put("cert_id", dto.getCertId());
|
||||||
|
// 证件类型,仅支持:00-身份证,银行账户类型为对私时,必填
|
||||||
|
accountInfo.put("cert_type", "00");
|
||||||
|
// 手机号
|
||||||
|
accountInfo.put("tel_no", dto.getTelNo());
|
||||||
|
// 银行编码,详见附录 银行代码,银行账户类型对公时,必填
|
||||||
|
accountInfo.put("bank_code", dto.getBankCode());
|
||||||
|
// 银行账户类型:1-对公;2-对私
|
||||||
|
accountInfo.put("bank_acct_type", dto.getBankAcctType());
|
||||||
|
// 银行账户开户银行所在省份编码 (省市编码),银行账户类型为对公时,必填
|
||||||
|
accountInfo.put("prov_code", dto.getProvCode());
|
||||||
|
// 银行账户开户银行所在地区编码(省市编码),银行账户类型为对公时,必填
|
||||||
|
accountInfo.put("area_code", dto.getAreaCode());
|
||||||
|
|
||||||
|
Map<String, Object> settleCountParams = Maps.newHashMap();
|
||||||
|
settleCountParams.put("member_id", dto.getAdapayMemberId());
|
||||||
|
settleCountParams.put("app_id", ADAPAY_APP_ID);
|
||||||
|
// channel String Y 目前仅支持:bank_account(银行卡)
|
||||||
|
settleCountParams.put("channel", "bank_account");
|
||||||
|
settleCountParams.put("account_info", accountInfo);
|
||||||
|
Map<String, Object> settleCount = SettleAccount.create(settleCountParams);
|
||||||
|
log.info("创建汇付结算账户result:{}", settleCount);
|
||||||
|
|
||||||
|
if (settleCount == null || StringUtils.equals((String) settleCount.get("status"), "failed")) {
|
||||||
|
String errorMsg = settleCount == null ? "创建汇付结算账户失败" : (String) settleCount.get("error_msg");
|
||||||
|
throw new BusinessException("00500001", errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
AdapaySettleAccount adapaySettleAccount = new AdapaySettleAccount();
|
||||||
|
adapaySettleAccount.setSettleAccountId((String) settleCount.get("id"));
|
||||||
|
adapaySettleAccount.setMerchantId(dto.getMerchantId());
|
||||||
|
adapaySettleAccount.setAdapayMemberId(dto.getAdapayMemberId());
|
||||||
|
adapaySettleAccount.setCardId(dto.getCardId());
|
||||||
|
adapaySettleAccount.setCardName(dto.getCardName());
|
||||||
|
adapaySettleAccount.setCertId(dto.getCertId());
|
||||||
|
adapaySettleAccount.setCertType("00");
|
||||||
|
adapaySettleAccount.setTelNo(dto.getTelNo());
|
||||||
|
adapaySettleAccount.setBankCode(dto.getBankCode());
|
||||||
|
adapaySettleAccount.setBankAcctType(dto.getBankAcctType());
|
||||||
|
adapaySettleAccount.setProvCode(dto.getProvCode());
|
||||||
|
adapaySettleAccount.setAreaCode(dto.getAreaCode());
|
||||||
|
adapaySettleAccountService.insertAdapaySettleAccount(adapaySettleAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user