Browse Source

红娘直播任务

master
张彭杰 1 month ago
parent
commit
c7cdc29ca6
2 changed files with 15 additions and 4 deletions
  1. 4
      dating-agency-mall-constant/src/main/java/com/qniao/dam/domian/aggregate/rewardconfig/constant/RewardTypeEnum.java
  2. 15
      dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/virtualaccount/VirtualAccountApplicationService.java

4
dating-agency-mall-constant/src/main/java/com/qniao/dam/domian/aggregate/rewardconfig/constant/RewardTypeEnum.java

@ -154,6 +154,10 @@ public enum RewardTypeEnum {
CHAT_PROFIT_PCT_50(604, "聊天收益百分比-50"),
CHAT_PROFIT_BY_GIFT(605, "聊天礼物收益"),
RTC_PROFIT_BY_ONE_ON_ONE(606, "一对一RTC收益"),
//红娘礼物收益
CONTRACT_MATCHMAKER_GIFT_PCT(701, "签约红娘直播礼物收益百分比"),

15
dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/virtualaccount/VirtualAccountApplicationService.java

@ -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 {

Loading…
Cancel
Save