update 修改结算

This commit is contained in:
2023-06-17 16:33:01 +08:00
parent d18b9a3c48
commit 276f843b98
4 changed files with 67 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.huifu.adapay.model.Member;
import com.huifu.adapay.model.SettleAccount;
import com.jsowell.adapay.dto.AdapayMemberInfoDTO;
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
import com.jsowell.adapay.response.QueryMemberResponse;
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
import com.jsowell.adapay.vo.AdapayMemberInfoVO;
@@ -38,6 +39,7 @@ public class AdapayMemberService {
/**
* 创建汇付会员
*
* @param dto
* @throws Exception
*/
@@ -121,6 +123,7 @@ public class AdapayMemberService {
/**
* 查询汇付会员信息
*
* @param merchantId
* @return
*/
@@ -244,4 +247,26 @@ public class AdapayMemberService {
return vo;
}
public void updateSettleAccountConfig(UpdateAccountConfigDTO dto) throws BaseAdaPayException {
// 通过merchantId 查询出汇付会员id 和 结算账户id用来查询余额
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
if (adapayMemberAccount == null) {
return;
}
// 修改账户配置
Map<String, Object> params = Maps.newHashMap();
params.put("app_id", ADAPAY_APP_ID);
params.put("member_id", adapayMemberAccount.getAdapayMemberId());
params.put("settle_account_id", adapayMemberAccount.getSettleAccountId());
if (StringUtils.isNotBlank(dto.getMinAmt())) {
params.put("min_amt", dto.getMinAmt());
}
if (StringUtils.isNotBlank(dto.getRemainedAmt())) {
params.put("remained_amt", dto.getRemainedAmt());
}
if (StringUtils.isNotBlank(dto.getChannelRemark())) {
params.put("channel_remark", dto.getChannelRemark());
}
Map<String, Object> settleCount = SettleAccount.update(params);
}
}