Commit 54b38569 by YG8429

修改充值金额写死测试返佣

parent 1b011181
...@@ -411,10 +411,13 @@ public class RedisTask { ...@@ -411,10 +411,13 @@ public class RedisTask {
ConsumerWallet consumerWallet = consumerWalletService.getOne(consumerWalletLambdaQueryWrapper); ConsumerWallet consumerWallet = consumerWalletService.getOne(consumerWalletLambdaQueryWrapper);
BigDecimal payPrice = sOrder.getPayPrice(); BigDecimal payPrice = sOrder.getPayPrice();
if (payPrice.signum() > 0) { if (payPrice.signum() > 0) {
String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund"); String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund");
consumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)))); // BigDecimal addEquityFund = payPrice.multiply(new BigDecimal(equityFund)).setScale(2, RoundingMode.HALF_UP);
BigDecimal addEquityFund = new BigDecimal(99).multiply(new BigDecimal(equityFund)).setScale(2, RoundingMode.HALF_UP);
consumerWallet.setEquityFund(consumerWallet.getEquityFund().add(addEquityFund));
consumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund(). consumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund().
add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)))); add(addEquityFund));
consumerWallet.setUpdateTime(DateUtils.getNowDate()); consumerWallet.setUpdateTime(DateUtils.getNowDate());
consumerWalletService.updateConsumerWallet(consumerWallet); consumerWalletService.updateConsumerWallet(consumerWallet);
//添加权益金日志记录 //添加权益金日志记录
...@@ -423,7 +426,7 @@ public class RedisTask { ...@@ -423,7 +426,7 @@ public class RedisTask {
//上级用户 //上级用户
SConsumer consumer = consumerService.getById(sharingActivities.getUid()); SConsumer consumer = consumerService.getById(sharingActivities.getUid());
EquityFundLog equityFundLog = new EquityFundLog(); EquityFundLog equityFundLog = new EquityFundLog();
equityFundLog.setEquityFund(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP))); equityFundLog.setEquityFund(addEquityFund);
equityFundLog.setEquityFundType("1"); equityFundLog.setEquityFundType("1");
equityFundLog.setOutTradeNo(sOrder.getOutTradeNo()); equityFundLog.setOutTradeNo(sOrder.getOutTradeNo());
equityFundLog.setTerminalTrace(sOrder.getOutTradeNo()); equityFundLog.setTerminalTrace(sOrder.getOutTradeNo());
......
...@@ -779,14 +779,18 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -779,14 +779,18 @@ public class CallbackServiceImpl implements CallbackService {
if (YesNoEnum.yes.getIndex().equals(consumerMember.getIsRights()) && new Date().getTime() < consumerMember.getExpirationDate().getTime()) { if (YesNoEnum.yes.getIndex().equals(consumerMember.getIsRights()) && new Date().getTime() < consumerMember.getExpirationDate().getTime()) {
Boolean aBoolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getUid().toString()); Boolean aBoolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getUid().toString());
if (aBoolean) { if (aBoolean) {
String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund"); String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund");
//计算返佣额度 写死 99 测试
BigDecimal addEquityFund = new BigDecimal(99).multiply(new BigDecimal(equityFund)).setScale(2,RoundingMode.HALF_UP);
// BigDecimal addEquityFund = payPrice.multiply(new BigDecimal(equityFund)).setScale(2,RoundingMode.HALF_UP);
//查询上级用户是否有钱包 //查询上级用户是否有钱包
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>() ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>()
.eq(ConsumerWallet::getConsumerId, sharingActivities.getUid())); .eq(ConsumerWallet::getConsumerId, sharingActivities.getUid()));
if (ObjectUtil.isNotEmpty(consumerWallet)) { if (ObjectUtil.isNotEmpty(consumerWallet)) {
consumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund)))); consumerWallet.setEquityFund(consumerWallet.getEquityFund().add(addEquityFund));
consumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund(). consumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund().
add(payPrice.multiply(new BigDecimal(equityFund)))); add(addEquityFund));
consumerWallet.setUpdateTime(DateUtils.getNowDate()); consumerWallet.setUpdateTime(DateUtils.getNowDate());
consumerWalletService.updateConsumerWallet(consumerWallet); consumerWalletService.updateConsumerWallet(consumerWallet);
} else { } else {
...@@ -797,9 +801,9 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -797,9 +801,9 @@ public class CallbackServiceImpl implements CallbackService {
newConsumerWallet.setBalance(defaultVlue); newConsumerWallet.setBalance(defaultVlue);
newConsumerWallet.setRemainingIntegral(defaultVlue); newConsumerWallet.setRemainingIntegral(defaultVlue);
newConsumerWallet.setRemainingDuration(defaultVlue); newConsumerWallet.setRemainingDuration(defaultVlue);
newConsumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)))); newConsumerWallet.setEquityFund(consumerWallet.getEquityFund()
newConsumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund() .add(addEquityFund));
.add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)))); newConsumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund().add(addEquityFund));
consumerWalletService.insertConsumerWallet(newConsumerWallet); consumerWalletService.insertConsumerWallet(newConsumerWallet);
} }
//添加权益金日志记录 //添加权益金日志记录
......
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