mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-09 14:36:00 +08:00
feat 商户钱包配置, 商户应用配置优化
This commit is contained in:
@@ -44,6 +44,10 @@ public class WalletConfig extends MpBaseEntity implements EntityBaseFunction<Wal
|
||||
@DbColumn(comment = "默认余额")
|
||||
private BigDecimal defaultBalance;
|
||||
|
||||
/** 状态 */
|
||||
@DbColumn(comment = "状态")
|
||||
private String state;
|
||||
|
||||
/** 备注 */
|
||||
@DbColumn(comment = "备注")
|
||||
private String remark;
|
||||
|
||||
@@ -2,8 +2,12 @@ package cn.bootx.platform.daxpay.core.channel.wallet.service;
|
||||
|
||||
import cn.bootx.platform.common.core.exception.BizException;
|
||||
import cn.bootx.platform.common.core.exception.DataNotExistException;
|
||||
import cn.bootx.platform.daxpay.code.MchAndAppCode;
|
||||
import cn.bootx.platform.daxpay.code.pay.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.core.channel.wallet.dao.WalletConfigManager;
|
||||
import cn.bootx.platform.daxpay.core.channel.wallet.entity.WalletConfig;
|
||||
import cn.bootx.platform.daxpay.core.merchant.entity.MchAppPayConfig;
|
||||
import cn.bootx.platform.daxpay.core.merchant.service.MchAppPayConfigService;
|
||||
import cn.bootx.platform.daxpay.core.merchant.service.MchAppService;
|
||||
import cn.bootx.platform.daxpay.dto.channel.wallet.WalletConfigDto;
|
||||
import cn.bootx.platform.daxpay.param.channel.wechat.WalletConfigParam;
|
||||
@@ -22,6 +26,7 @@ import org.springframework.stereotype.Service;
|
||||
@RequiredArgsConstructor
|
||||
public class WalletConfigService {
|
||||
private final WalletConfigManager walletConfigManager;
|
||||
private final MchAppPayConfigService mchAppPayConfigService;
|
||||
private final MchAppService mchAppService;
|
||||
|
||||
/**
|
||||
@@ -42,9 +47,19 @@ public class WalletConfigService {
|
||||
throw new BizException("应用信息与商户信息不匹配");
|
||||
}
|
||||
WalletConfig walletConfig = WalletConfig.init(param);
|
||||
walletConfig.setState(MchAndAppCode.PAY_CONFIG_STATE_NORMAL);
|
||||
walletConfigManager.save(walletConfig);
|
||||
// 保存关联关系
|
||||
MchAppPayConfig mchAppPayConfig = new MchAppPayConfig().setAppCode(walletConfig.getMchAppCode())
|
||||
.setConfigId(walletConfig.getId())
|
||||
.setChannel(PayChannelEnum.WALLET.getCode())
|
||||
.setState(walletConfig.getState());
|
||||
mchAppPayConfigService.add(mchAppPayConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
public void update(WalletConfigParam param){
|
||||
WalletConfig walletConfig = walletConfigManager.findById(param.getId())
|
||||
.orElseThrow(DataNotExistException::new);
|
||||
|
||||
@@ -28,6 +28,9 @@ public class WalletConfigDto extends BaseDto {
|
||||
@Schema(description = "默认余额")
|
||||
private BigDecimal defaultBalance;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ public class WalletConfigParam {
|
||||
@Schema(description = "默认余额")
|
||||
private BigDecimal defaultBalance;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user