diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerBankController.java b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerBankController.java index 926aca51..c7f98d5a 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerBankController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerBankController.java @@ -43,7 +43,7 @@ public class CustomerBankController { private AjaxResult bindBankCard(@RequestBody BindBankCardRequest request) throws BaseAdaPayException { Set merchants = AdapayConfig.getMerchants(); for (Merchant merchant : merchants) { - String memberId = AdapayUtils.getMemberId(request.getCustomerId(), merchant.getDeptId()); + String memberId = AdapayUtils.getCustomerMemberId(request.getCustomerId(), merchant.getDeptId()); // 先在Adapay创建实名用户 Map result1 = adapayService.createMember(merchant.getDeptId(), memberId, request.getPhone(), request.getName(), request.getCertId(), null, null, null, null); diff --git a/ghy-common/src/main/java/com/ghy/common/utils/AdapayUtils.java b/ghy-common/src/main/java/com/ghy/common/utils/AdapayUtils.java index 06249f5d..b09cfd76 100644 --- a/ghy-common/src/main/java/com/ghy/common/utils/AdapayUtils.java +++ b/ghy-common/src/main/java/com/ghy/common/utils/AdapayUtils.java @@ -9,14 +9,23 @@ import org.springframework.util.Assert; @Slf4j public class AdapayUtils { - public static String getMemberId(Long memberId, Long deptId) { - Assert.isTrue(Math.min(memberId, deptId) > 0, "Invalid [memberId] or [deptId]"); - return String.format("C%dD%d", memberId, deptId); + /** + * 生成 Adapay member_id + * + * @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 deptId 分平台id + * @param deptId 分平台id * @return 生成的唯一id */ public static String getWorkerMemberId(Long workerId, Long deptId) { diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerBankServiceImpl.java b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerBankServiceImpl.java index ea4f5203..e17355f5 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerBankServiceImpl.java +++ b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerBankServiceImpl.java @@ -45,7 +45,7 @@ public class CustomerBankServiceImpl implements CustomerBankService { @Override 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); }