This commit is contained in:
77
2024-04-26 23:48:20 +08:00
parent dd56b0e741
commit 8b8dde48a3
5 changed files with 10 additions and 17 deletions

View File

@@ -52,8 +52,6 @@ public class AccountCashServiceImpl extends ServiceImpl<AccountCashMapper, Accou
private WithdrawTotalCache withdrawTotalCache;
@Autowired
private RankAdminManager rankAdminManager;
@Autowired
private SystemConfigManager systemConfigManager;
@Override
public void withdraw(WithdrawReq res) {
AccountBankcard one = accountBankcardService.getOne(Wrappers.lambdaQuery(AccountBankcard.class)
@@ -65,7 +63,6 @@ public class AccountCashServiceImpl extends ServiceImpl<AccountCashMapper, Accou
if(withdrawExchange == null){
throw new ServiceException("参数不正确");
}
BigDecimal withdrawRate = systemConfigManager.getSystemConfigOfBigDecimal(SystemConfigEnum.WITHDRAW_RATE);
Long traceId = IdManager.nextId();
Long coinNum = withdrawExchange.getCoinNum();
accountService.withdraw(res.getUserId(), coinNum,traceId);
@@ -74,13 +71,7 @@ public class AccountCashServiceImpl extends ServiceImpl<AccountCashMapper, Accou
cash.setTraceId(traceId);
cash.setOrderNo(OrderNoUtil.createOrderNo(OrderTypeEnum.WITHDRAW_ORDER_SUB));
cash.setWithdrawCoin(coinNum);
cash.setCoinFees(0L);
cash.setCoinCallbackCoin(coinNum);
if(withdrawRate != null && !withdrawRate.equals(BigDecimal.ZERO)){
long coinFees = NumberUtil.mul(coinNum, withdrawRate).longValue();
cash.setCoinFees(coinFees);
cash.setCoinCallbackCoin(coinNum-coinFees);
}
cash.setCoinCallbackCoin(withdrawExchange.getCoinCallbackNum());
cash.setCashMoney(BigDecimal.valueOf(withdrawExchange.getMoney()));
cash.setRealCashMoney(BigDecimal.valueOf(withdrawExchange.getMoney()));
cash.setCashFees(BigDecimal.ZERO);