zhengyuxuan
2025-03-31 394393e91e51dea4ae5b689cc471fa62f2913da3
提交
3个文件已修改
32 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1238,8 +1238,8 @@
    /// 合计佣金
    /// </summary>
    public decimal TotalRakePrice { get; set; }
}
public class ReceiptsListOutPut
{
    /// <summary>
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -324,7 +324,11 @@
                        FinishTime = item.FinishTime.Value,
                        ChannelId = item.ChannelId,
                    };
                    await _lifePayChannlesRakeRepository.InsertAsync(lifePayChannlesRake);
                    var repeat = _lifePayChannlesRakeRepository.Where(x => x.OrderNo == item.OrderNo).FirstOrDefaultAsync();
                    if (repeat != null)
                    {
                        await _lifePayChannlesRakeRepository.InsertAsync(lifePayChannlesRake);
                    }
                }
            }
        }
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -46,6 +46,7 @@
    private readonly IRepository<LifePayChannles, Guid> _lifePayChannlesRep;
    private readonly IRepository<LifePayAccount, Guid> _lifePayAccount;
    private readonly IRepository<OperateHistory, Guid> _operateHistory;
    private readonly IRepository<LifePayChannlesRake, Guid> _lifePayChannlesRakeRepository;
    private readonly IDataFilter dataFilter;
    private readonly IChannelFilter _channelFilter;
    private readonly IAliPayApi _aliPayApi;
@@ -64,6 +65,7 @@
                          IRepository<LifePayUser, Guid> lifePayUserRepository,
                          IRepository<LifePayPremium, Guid> lifePayPremiumRepository,
                          IRepository<LifePayIntroInfo, Guid> lifePayIntroInfoRepository,
                          IRepository<LifePayChannlesRake, Guid> lifePayChannlesRakeRepository,
                          IRepository<OperateHistory, Guid> operateHistory,
                          IAliPayApi aliPayApi,
                          IAlipayInterfaceManager aliPayInterfaceManager,
@@ -80,6 +82,7 @@
        _lifePayRateRepository = lifePayRateRepository;
        _lifePayOrderRepository = lifePayOrderRepository;
        _lifePayUserRepository = lifePayUserRepository;
        _lifePayChannlesRakeRepository = lifePayChannlesRakeRepository;
        _lifePayPremiumRepository = lifePayPremiumRepository;
        _lifePayIntroInfoRepository = lifePayIntroInfoRepository;
        _aliPayApi = aliPayApi;
@@ -1372,6 +1375,27 @@
        order.ACOOLYStatus = acoolyStatus;
        order.FinishTime = DateTime.Now;
        await _lifePayOrderRepository.UpdateAsync(order);
        if (order.LifePayOrderStatus == LifePayOrderStatusEnum.已完成)
        {
            /// 毛利
            var grossProfit = order.RechargeAmount * (order.ChannleRate - order.PlatformRate) / 100;
            /// 渠道佣金  ((充值面额 * 渠道折扣比例)-(充值面额 * 平台折扣比例))* 佣金比例
            var channlesRakePrice = grossProfit * (order.ChannlesRakeRate) / 100;
            if (channlesRakePrice.HasValue)
            {
                LifePayChannlesRake lifePayChannlesRake = new LifePayChannlesRake()
                {
                    OrderNo = order.OrderNo,
                    PayAmount = order.PayAmount.Value,
                    ChannlesRakeRate = order.ChannlesRakeRate.Value,
                    ChannlesRakePrice = channlesRakePrice.Value,
                    FinishTime = order.FinishTime.Value,
                    ChannelId = order.ChannelId,
                };
                await _lifePayChannlesRakeRepository.InsertAsync(lifePayChannlesRake);
            }
        }
    }
    /// <summary>