Commit 787cc523 by 吕明尚

修改充值回调

parent cb524314
......@@ -193,11 +193,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
}
logger.debug("修改会员用户");
BigDecimal balance = consumerWallet.getBalance().add(recharge.getRechargeAmount());
consumerWallet.setBalance(balance);
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
balance = balance.add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance);
} else {
consumerWallet.setBalance(balance);
}
if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) {
BigDecimal duration = consumerWallet.getRemainingDuration().add(rechargeConf.getGiveDuration());
......
......@@ -219,11 +219,10 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
RechargeConf rechargeConf = rechargeConfService.selectRechargeConfById(recharge.getRechargeConfId());
ConsumerWallet consumerWallet = new ConsumerWallet();
consumerWallet.setConsumerId(recharge.getConsumerId());
consumerWallet.setBalance(recharge.getRechargeAmount());
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
BigDecimal balance = recharge.getRechargeAmount().add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance);
} else {
consumerWallet.setBalance(recharge.getRechargeAmount());
}
if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) {
consumerWallet.setRemainingDuration(rechargeConf.getGiveDuration());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment