Merge branch 'master' of https://gitee.com/op-souls/ghy-all
This commit is contained in:
commit
0aefc0cb95
|
|
@ -43,7 +43,7 @@ public class CustomerBankController {
|
||||||
private AjaxResult bindBankCard(@RequestBody BindBankCardRequest request) throws BaseAdaPayException {
|
private AjaxResult bindBankCard(@RequestBody BindBankCardRequest request) throws BaseAdaPayException {
|
||||||
Set<Merchant> merchants = AdapayConfig.getMerchants();
|
Set<Merchant> merchants = AdapayConfig.getMerchants();
|
||||||
for (Merchant merchant : merchants) {
|
for (Merchant merchant : merchants) {
|
||||||
String memberId = AdapayUtils.getMemberId(request.getCustomerId(), merchant.getDeptId());
|
String memberId = AdapayUtils.getCustomerMemberId(request.getCustomerId(), merchant.getDeptId());
|
||||||
// 先在Adapay创建实名用户
|
// 先在Adapay创建实名用户
|
||||||
Map<String, Object> result1 = adapayService.createMember(merchant.getDeptId(), memberId, request.getPhone(),
|
Map<String, Object> result1 = adapayService.createMember(merchant.getDeptId(), memberId, request.getPhone(),
|
||||||
request.getName(), request.getCertId(), null, null, null, null);
|
request.getName(), request.getCertId(), null, null, null, null);
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,23 @@ import org.springframework.util.Assert;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AdapayUtils {
|
public class AdapayUtils {
|
||||||
|
|
||||||
public static String getMemberId(Long memberId, Long deptId) {
|
/**
|
||||||
Assert.isTrue(Math.min(memberId, deptId) > 0, "Invalid [memberId] or [deptId]");
|
* 生成 Adapay member_id
|
||||||
return String.format("C%dD%d", memberId, deptId);
|
*
|
||||||
|
* @param customerId 消费者ID
|
||||||
|
* @param deptId 分平台id
|
||||||
|
* @return Adapay member_id
|
||||||
|
*/
|
||||||
|
public static String getCustomerMemberId(Long customerId, Long deptId) {
|
||||||
|
Assert.isTrue(Math.min(customerId, deptId) > 0, "Invalid [customerId] or [deptId]");
|
||||||
|
return String.format("C%dD%d", customerId, deptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 生成 Adapay member_id
|
||||||
|
*
|
||||||
* @param workerId 师傅id
|
* @param workerId 师傅id
|
||||||
* @param deptId 分平台id
|
* @param deptId 分平台id
|
||||||
* @return 生成的唯一id
|
* @return 生成的唯一id
|
||||||
*/
|
*/
|
||||||
public static String getWorkerMemberId(Long workerId, Long deptId) {
|
public static String getWorkerMemberId(Long workerId, Long deptId) {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class CustomerBankServiceImpl implements CustomerBankService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertCustomerBank(CustomerBank customerBank) {
|
public int insertCustomerBank(CustomerBank customerBank) {
|
||||||
customerBank.setAdapayMemberId(AdapayUtils.getMemberId(customerBank.getCustomerId(), customerBank.getDeptId()));
|
customerBank.setAdapayMemberId(AdapayUtils.getCustomerMemberId(customerBank.getCustomerId(), customerBank.getDeptId()));
|
||||||
return customerBankMapper.insertCustomerBank(customerBank);
|
return customerBankMapper.insertCustomerBank(customerBank);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue