|
|
|
@ -13,6 +13,7 @@ import com.qniao.dam.domain.aggregate.order.entity.OrderItem; |
|
|
|
import com.qniao.dam.domain.aggregate.product.entity.Product; |
|
|
|
import com.qniao.dam.domain.aggregate.productspec.entity.ProductSpec; |
|
|
|
import com.qniao.dam.domain.aggregate.productspec.valueobj.ProductSpecTerm; |
|
|
|
import com.qniao.dam.domain.aggregate.revenuereward.RevenueRewardAggregate; |
|
|
|
import com.qniao.dam.domain.aggregate.revenuereward.entity.RevenueReward; |
|
|
|
import com.qniao.dam.domain.aggregate.revenuereward.valueobj.RevenueRewardRecord; |
|
|
|
import com.qniao.dam.domain.aggregate.rewardconfig.entity.RewardConfig; |
|
|
|
@ -73,6 +74,8 @@ public class VirtualAccountApplicationService extends BaseApplicationService { |
|
|
|
@Resource |
|
|
|
private RevenueRewardQueryService revenueRewardQueryService; |
|
|
|
@Resource |
|
|
|
private RevenueRewardAggregate revenueRewardAggregate; |
|
|
|
@Resource |
|
|
|
private ProductDao productDao; |
|
|
|
@Resource |
|
|
|
private ProductSpecDao productSpecDao; |
|
|
|
@ -482,9 +485,20 @@ public class VirtualAccountApplicationService extends BaseApplicationService { |
|
|
|
BigDecimal income = BigDecimal.valueOf(dto.getConsumeBalance()).multiply(new BigDecimal(worthRewardConfig.getValue())); |
|
|
|
income = rtcRewardConfig.calculateReward(income); |
|
|
|
|
|
|
|
//收益信息 |
|
|
|
RevenueReward revenueReward = revenueRewardQueryService.queryByUserId(dto.getAppId(), dto.getProfitUserId()); |
|
|
|
if (Objects.isNull(revenueReward)) { |
|
|
|
revenueReward = RevenueReward.initUser(dto.getAppId(), dto.getProfitUserId()); |
|
|
|
} |
|
|
|
RevenueRewardRecord revenueRewardRecord = RevenueRewardRecord.build(TradeTypeEnum.IM_GIFT_REWARD, TradeSceneEnum.ONLINE, |
|
|
|
income, BigDecimal.valueOf(100), BigDecimal.ZERO, income, income); |
|
|
|
revenueReward.setRecordList(Collections.singletonList(revenueRewardRecord)); |
|
|
|
|
|
|
|
if (RtcChannelTypeEnum.ONE_ON_ONE_VOICE.equals(dto.getRtcChannelType())) { |
|
|
|
revenueRewardRecord.setContent("与" + payerMarriageInformation.getNickName() + "1V1语音"); |
|
|
|
walletAccountAggregate.handleIncomeData(walletAccount, income, TradeTypeEnum.ONE_ON_ONE_VOICE, "与" + payerMarriageInformation.getNickName() + "1V1语音"); |
|
|
|
} else { |
|
|
|
revenueRewardRecord.setContent("与" + payerMarriageInformation.getNickName() + "1V1视频"); |
|
|
|
walletAccountAggregate.handleIncomeData(walletAccount, income, TradeTypeEnum.ONE_ON_ONE_VIDEO, "与" + payerMarriageInformation.getNickName() + "1V1视频"); |
|
|
|
} |
|
|
|
} |
|
|
|
|