Commit 841fef8b by 吕明尚

Merge branch 'refs/heads/dev' into test

parents 8cc32ce2 787cc523
...@@ -193,11 +193,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -193,11 +193,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
} }
logger.debug("修改会员用户"); logger.debug("修改会员用户");
BigDecimal balance = consumerWallet.getBalance().add(recharge.getRechargeAmount()); BigDecimal balance = consumerWallet.getBalance().add(recharge.getRechargeAmount());
consumerWallet.setBalance(balance);
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) { if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
balance = balance.add(rechargeConf.getGiveAmount()); balance = balance.add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance); consumerWallet.setBalance(balance);
} else {
consumerWallet.setBalance(balance);
} }
if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) { if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) {
BigDecimal duration = consumerWallet.getRemainingDuration().add(rechargeConf.getGiveDuration()); BigDecimal duration = consumerWallet.getRemainingDuration().add(rechargeConf.getGiveDuration());
......
...@@ -219,11 +219,10 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i ...@@ -219,11 +219,10 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
RechargeConf rechargeConf = rechargeConfService.selectRechargeConfById(recharge.getRechargeConfId()); RechargeConf rechargeConf = rechargeConfService.selectRechargeConfById(recharge.getRechargeConfId());
ConsumerWallet consumerWallet = new ConsumerWallet(); ConsumerWallet consumerWallet = new ConsumerWallet();
consumerWallet.setConsumerId(recharge.getConsumerId()); consumerWallet.setConsumerId(recharge.getConsumerId());
consumerWallet.setBalance(recharge.getRechargeAmount());
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) { if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
BigDecimal balance = recharge.getRechargeAmount().add(rechargeConf.getGiveAmount()); BigDecimal balance = recharge.getRechargeAmount().add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance); consumerWallet.setBalance(balance);
} else {
consumerWallet.setBalance(recharge.getRechargeAmount());
} }
if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) { if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) {
consumerWallet.setRemainingDuration(rechargeConf.getGiveDuration()); 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