fixbug:提现申请充值业务问题处理

This commit is contained in:
Chopper711
2023-03-01 10:37:08 +08:00
parent 967852f84d
commit 61104b9cd3
10 changed files with 142 additions and 6 deletions

View File

@@ -221,7 +221,7 @@ public enum ResultCode {
PAY_POINT_ENOUGH(32010, "积分不足,不能兑换"),
PAY_NOT_EXIST_ORDER(32011, "支付订单不存在"),
CAN_NOT_RECHARGE_WALLET(32012, "不能使用余额进行充值"),
RECHARGE_PRICE_ERROR(32013, "充值金额错误"),
/**
* 售后
@@ -259,7 +259,7 @@ public enum ResultCode {
WALLET_REMARK_ERROR(34004, "请填写审核备注!"),
WALLET_EXIT_ERROR(34000, "钱包已存在,无法重复创建"),
WALLET_APPLY_ERROR(34005, "提现申请异常!"),
WALLET_WITHDRAWAL_AMOUNT_ERROR(34006, "申请提现金额异常!"),
/**
* 评价
*/
@@ -502,6 +502,7 @@ public enum ResultCode {
PURCHASE_ORDER_DEADLINE_ERROR(90004, "供求单,已超过报名截止时间"),
INDEX_BUILDING(90005, "索引正在生成");
private final Integer code;
private final String message;

View File

@@ -257,6 +257,11 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean applyWithdrawal(Double price) {
if (price == null || price <= 0 || price > 1000000) {
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_AMOUNT_ERROR);
}
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
AuthUser authUser = UserContext.getCurrentUser();
//构建审核参数
@@ -307,7 +312,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
//保存或者修改零钱提现
this.memberWithdrawApplyService.saveOrUpdate(memberWithdrawApply);
//TODO 做成配置项目
cashierSupport.transfer(PaymentMethodEnum.WECHAT,memberWithdrawApply);
cashierSupport.transfer(PaymentMethodEnum.WECHAT, memberWithdrawApply);
boolean result = true;
//如果微信提现失败 则抛出异常 回滚数据
if (!result) {

View File

@@ -42,6 +42,11 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
@Override
public Recharge recharge(Double price) {
if (price == null || price <= 0 || price > 1000000) {
throw new ServiceException(ResultCode.RECHARGE_PRICE_ERROR);
}
//获取当前登录的会员
AuthUser authUser = UserContext.getCurrentUser();
//构建sn