|
|
|
@ -202,8 +202,10 @@ public class VirtualAccountApplicationService extends BaseApplicationService { |
|
|
|
revenueReward = RevenueReward.initUser(toUserId); |
|
|
|
} |
|
|
|
RewardConfig worthRewardConfig = rewardConfigQueryService.queryByRewardType(RewardTypeEnum.VIRTUAL_ACCOUNT_WORTH); |
|
|
|
RewardConfig giftRewardConfig = rewardConfigQueryService.queryByRewardType(RewardTypeEnum.CHAT_PROFIT_BY_GIFT); |
|
|
|
//营收额 |
|
|
|
BigDecimal revenue = BigDecimal.valueOf(costBalance).multiply(new BigDecimal(worthRewardConfig.getValue())).multiply(BigDecimal.valueOf(0.4)).setScale(2, RoundingMode.HALF_UP); |
|
|
|
BigDecimal revenue = BigDecimal.valueOf(costBalance).multiply(new BigDecimal(worthRewardConfig.getValue())); |
|
|
|
revenue = giftRewardConfig.calculateReward(revenue); |
|
|
|
|
|
|
|
RevenueRewardRecord revenueRewardRecord = RevenueRewardRecord.build(TradeTypeEnum.IM_GIFT_REWARD, TradeSceneEnum.ONLINE, |
|
|
|
revenue, BigDecimal.valueOf(100), BigDecimal.ZERO, revenue, BigDecimal.valueOf(costBalance)); |
|
|
|
@ -307,7 +309,7 @@ public class VirtualAccountApplicationService extends BaseApplicationService { |
|
|
|
anchorWalletAccount.setRecordList(Collections.singletonList(anchorWalletAccountRecord)); |
|
|
|
|
|
|
|
List<BaseDomainEvent> eventList = costGiftRewardDomainService.handle(order, virtualAccount, costBalance, toRevenueReward, toWalletAccount, anchorRevenueReward, anchorWalletAccount); |
|
|
|
eventList.add(new ChannelCostGiftEvent(anchorId,order.getSettlementAmount().intValue())); |
|
|
|
eventList.add(new ChannelCostGiftEvent(anchorId, order.getSettlementAmount().intValue())); |
|
|
|
vo.setSuccess(true); |
|
|
|
this.sendEvent(eventList); |
|
|
|
return vo; |
|
|
|
@ -357,7 +359,7 @@ public class VirtualAccountApplicationService extends BaseApplicationService { |
|
|
|
|
|
|
|
List<BaseDomainEvent> eventList = costGiftRewardDomainService.handle(order, virtualAccount, costBalance, revenueReward, walletAccount); |
|
|
|
//补充直播间礼物玫瑰数量时间 |
|
|
|
eventList.add(new ChannelCostGiftEvent(toUserId,order.getSettlementAmount().intValue())); |
|
|
|
eventList.add(new ChannelCostGiftEvent(toUserId, order.getSettlementAmount().intValue())); |
|
|
|
vo.setSuccess(true); |
|
|
|
this.sendEvent(eventList); |
|
|
|
return vo; |
|
|
|
@ -498,7 +500,12 @@ public class VirtualAccountApplicationService extends BaseApplicationService { |
|
|
|
WalletAccount walletAccount = null; |
|
|
|
if (dto.getHasProfit()) { |
|
|
|
walletAccount = walletAccountQueryService.queryByType(dto.getProfitUserId(), IdentityTypeEnum.INDIVIDUAL); |
|
|
|
BigDecimal income = BigDecimal.valueOf(1.05).multiply(BigDecimal.valueOf(dto.getConsumeCount())); |
|
|
|
RewardConfig worthRewardConfig = rewardConfigQueryService.queryByRewardType(RewardTypeEnum.VIRTUAL_ACCOUNT_WORTH); |
|
|
|
RewardConfig rtcRewardConfig = rewardConfigQueryService.queryByRewardType(RewardTypeEnum.RTC_PROFIT_BY_ONE_ON_ONE); |
|
|
|
|
|
|
|
BigDecimal income = BigDecimal.valueOf(dto.getConsumeBalance()).multiply(new BigDecimal(worthRewardConfig.getValue())); |
|
|
|
income = rtcRewardConfig.calculateReward(income); |
|
|
|
|
|
|
|
if (RtcChannelTypeEnum.ONE_ON_ONE_VOICE.equals(dto.getRtcChannelType())) { |
|
|
|
walletAccountAggregate.handleIncomeData(walletAccount, income, TradeTypeEnum.ONE_ON_ONE_VOICE, "与" + payerMarriageInformation.getNickName() + "1V1语音"); |
|
|
|
} else { |
|
|
|
|