Commit 1bb9f6eb by 吕明尚

修改充值支付回调

parent 285a39b2
......@@ -13,6 +13,7 @@ import share.system.mapper.ConsumerWalletMapper;
import share.system.service.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
......@@ -157,7 +158,9 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
consumerWallet.setBalance(balance);
BigDecimal duration = consumerWallet.getRemainingDuration().add(rechargeConf.getGiveDuration());
consumerWallet.setRemainingDuration(duration);
BigDecimal Integral = consumerWallet.getRemainingIntegral().add(rechargeConf.getGiveRatio().multiply(recharge.getRechargeAmount()));
BigDecimal divide = recharge.getRechargeAmount().multiply(rechargeConf.getGiveRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
BigDecimal Integral = consumerWallet.getRemainingIntegral().add(divide);
consumerWallet.setRemainingIntegral(Integral);
int i = updateConsumerWallet(consumerWallet);
BalanceLog balanceLog = new BalanceLog();
......@@ -179,7 +182,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
IntegralLog integralLog = new IntegralLog();
integralLog.setConsumerId(consumerWallet.getConsumerId());
integralLog.setCurrentIntegral(consumerWallet.getRemainingIntegral());
integralLog.setVariableIntegral(rechargeConf.getGiveRatio().multiply(recharge.getRechargeAmount()));
integralLog.setVariableIntegral(divide);
integralLog.setOperationTime(new Date());
integralLog.setOperationType(YesNoEnum.yes.getIndex());
integralLog.setCreateTime(new Date());
......
......@@ -22,6 +22,7 @@ import share.system.response.RechargePayResultResponse;
import share.system.service.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
......@@ -182,7 +183,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
BigDecimal balance = recharge.getRechargeAmount().add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance);
consumerWallet.setRemainingDuration(rechargeConf.getGiveDuration());
BigDecimal Integral = recharge.getRechargeAmount().multiply(rechargeConf.getGiveRatio());
BigDecimal Integral = recharge.getRechargeAmount().multiply(rechargeConf.getGiveRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
consumerWallet.setRemainingIntegral(Integral);
consumerWallet.setCreateTime(new Date());
consumerWalletService.addConsumerWallet(consumerWallet);
......
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