修改分润逻辑
This commit is contained in:
@@ -400,6 +400,23 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
|
|||||||
|
|
||||||
|
|
||||||
BigDecimal profitAmt = profitRate.divide(BigDecimal.valueOf(100)).multiply(BigDecimal.valueOf(order.getConsumeFee())).setScale(4, BigDecimal.ROUND_DOWN);
|
BigDecimal profitAmt = profitRate.divide(BigDecimal.valueOf(100)).multiply(BigDecimal.valueOf(order.getConsumeFee())).setScale(4, BigDecimal.ROUND_DOWN);
|
||||||
|
|
||||||
|
|
||||||
|
UserAccount userAccount= userAccountService.initUserAccount(nowUserApp.getUserId().intValue());
|
||||||
|
userAccount.setBalance(userAccount.getBalance().add(profitAmt));
|
||||||
|
userAccount.setUpdateTime(new Date());
|
||||||
|
UserAccountFlow flow=new UserAccountFlow();
|
||||||
|
|
||||||
|
flow.setUserId(nowUserApp.getUserId().intValue());
|
||||||
|
flow.setBizCode("102");
|
||||||
|
flow.setBizName("收款收益");
|
||||||
|
flow.setAmount(profitAmt);
|
||||||
|
flow.setBalance(userAccount.getBalance());
|
||||||
|
flow.setCreateTime(new Date());
|
||||||
|
accounts.add(userAccount);
|
||||||
|
accountFlows.add(flow);
|
||||||
|
|
||||||
|
|
||||||
MerchantProfit profit = new MerchantProfit(nowUserApp, nowUserApp, order, profitAmt, profitRate, "5", "1");
|
MerchantProfit profit = new MerchantProfit(nowUserApp, nowUserApp, order, profitAmt, profitRate, "5", "1");
|
||||||
profits.add(profit);
|
profits.add(profit);
|
||||||
sendProfitMessage(nowUserApp, profitAmt, order.getOrderNumber());
|
sendProfitMessage(nowUserApp, profitAmt, order.getOrderNumber());
|
||||||
|
|||||||
Reference in New Issue
Block a user