Commit 54b38569 by YG8429

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

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