update 创建提现请求 提取方法

This commit is contained in:
Guoqs
2025-06-09 15:17:03 +08:00
parent 2221dc8667
commit 4e32d2bcf8
2 changed files with 134 additions and 99 deletions

View File

@@ -830,17 +830,17 @@ public class AdapayService {
}
// 发送提现申请
Map<String, Object> settleCountParams = Maps.newHashMap();
// Map<String, Object> settleCountParams = Maps.newHashMap();
String orderNo = "drawcash_" + dto.getMerchantId() + "_" + System.currentTimeMillis();
settleCountParams.put("order_no", orderNo);
settleCountParams.put("cash_amt", AdapayUtil.formatAmount(cashAmt));
settleCountParams.put("member_id", adapayAccountBalanceVO.getAdapayMemberId());
settleCountParams.put("app_id", config.getAdapayAppId());
settleCountParams.put("settle_account_id", adapayAccountBalanceVO.getSettleAccountId());
settleCountParams.put("cash_type", "T1");
settleCountParams.put("notify_url", ADAPAY_CALLBACK_URL);
Map<String, Object> settleCount = Drawcash.create(settleCountParams, config.getWechatAppId());
log.info("申请取现接口,请求参数:{}, 返回参数:{}", JSON.toJSONString(settleCountParams), JSON.toJSONString(settleCount));
// settleCountParams.put("order_no", orderNo);
// settleCountParams.put("cash_amt", AdapayUtil.formatAmount(cashAmt));
// settleCountParams.put("member_id", adapayAccountBalanceVO.getAdapayMemberId());
// settleCountParams.put("app_id", config.getAdapayAppId());
// settleCountParams.put("settle_account_id", adapayAccountBalanceVO.getSettleAccountId());
// settleCountParams.put("cash_type", "T1");
// settleCountParams.put("notify_url", ADAPAY_CALLBACK_URL);
Map<String, Object> settleCount = createDrawcashRequest(orderNo, cashAmt, adapayAccountBalanceVO.getAdapayMemberId(), config.getAdapayAppId(), adapayAccountBalanceVO.getSettleAccountId(), config.getWechatAppId());
// log.info("申请取现接口,请求参数:{}, 返回参数:{}", JSON.toJSONString(settleCountParams), JSON.toJSONString(settleCount));
if (settleCount == null) {
throw new BusinessException("", "申请取现接口发生异常");
@@ -878,6 +878,24 @@ public class AdapayService {
clearingBillInfoService.updateStatus(clearingBillIds, billStatus, id);
}
/**
* 创建提现请求
*/
public Map<String, Object> createDrawcashRequest(String orderNo, BigDecimal cashAmt, String adapayMemberId, String adapayAppId, String settleAccountId, String wechatAppId) throws BaseAdaPayException {
Map<String, Object> settleCountParams = Maps.newHashMap();
settleCountParams.put("order_no", orderNo);
settleCountParams.put("cash_amt", AdapayUtil.formatAmount(cashAmt));
settleCountParams.put("member_id", adapayMemberId);
settleCountParams.put("app_id", adapayAppId);
settleCountParams.put("settle_account_id", settleAccountId);
settleCountParams.put("cash_type", "T1");
settleCountParams.put("notify_url", ADAPAY_CALLBACK_URL);
Map<String, Object> settleCount = Drawcash.create(settleCountParams, wechatAppId);
log.info("申请取现接口,请求参数:{}, 返回参数:{}", JSON.toJSONString(settleCountParams), JSON.toJSONString(settleCount));
return settleCount;
}
/**
* 查询取现对象
*