| | |
| | | { |
| | | private readonly IRepository<LifePayRechargeReceipts, Guid> _lifePayRechargeReceiptsRepository; |
| | | private readonly IRepository<LifePayExpensesReceipts, Guid> _lifePayExpensesReceiptsRepository; |
| | | private readonly IRepository<LifePayConsumption, Guid> _lifePayConsumption; |
| | | private readonly IRepository<LifePayChannlesRake, Guid> _lifePayChannlesRakeRepository; |
| | | private readonly IRepository<LifePayOrder, Guid> _lifePayOrderRepository; |
| | | private readonly IAliPayApi _aliPayApi; |
| | |
| | | public LifePayOrderService( |
| | | IRepository<LifePayRechargeReceipts, Guid> lifePayRechargeReceiptsRepository, |
| | | IRepository<LifePayExpensesReceipts, Guid> lifePayExpensesReceiptsRepository, |
| | | IRepository<LifePayConsumption, Guid> lifePayConsumptionRepository, |
| | | IRepository<LifePayChannlesRake, Guid> lifePayChannlesRakeRepository, |
| | | IRepository<LifePayOrder, Guid> lifePayOrderRepository, |
| | | IAliPayApi aliPayApi, |
| | |
| | | { |
| | | _lifePayRechargeReceiptsRepository = lifePayRechargeReceiptsRepository; |
| | | _lifePayExpensesReceiptsRepository = lifePayExpensesReceiptsRepository; |
| | | _lifePayConsumption = lifePayConsumptionRepository; |
| | | _lifePayChannlesRakeRepository = lifePayChannlesRakeRepository; |
| | | _lifePayOrderRepository = lifePayOrderRepository; |
| | | _aliPayApi = aliPayApi; |
| | |
| | | } |
| | | |
| | | #region 查询 |
| | | |
| | | /// <summary> |
| | | /// 获取消费流水 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<PageOutput<LifePayConsumptionListOutput>> GetLifePayConsumptionPage(LifePayConsumptionPageInput input) |
| | | { |
| | | var list = await _lifePayConsumption.Where(x => x.IsDeleted == false) |
| | | .WhereIf(input.KeyWord.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.KeyWord) || x.OutOrderNo.Contains(input.KeyWord) || x.ChannelId.Contains(input.KeyWord)) |
| | | .WhereIf(input.Flow.HasValue,x => x.Flow == input.Flow) |
| | | .WhereIf(input.TimeBegin.HasValue, x => x.FinishTime >= input.TimeBegin) |
| | | .WhereIf(input.TimeEnd.HasValue, x => x.FinishTime <= input.TimeEnd) |
| | | .Select(x => new LifePayConsumptionListOutput() |
| | | { |
| | | Id = x.Id, |
| | | OrderNo = x.OrderNo, |
| | | OutOrderNo = x.OutOrderNo, |
| | | Amount = x.Amount, |
| | | FinishTime = x.FinishTime, |
| | | FrozenStatus = x.FrozenStatus, |
| | | Flow = x.Flow, |
| | | DeductionAmount = x.DeductionAmount, |
| | | }) |
| | | .GetPageResult(input.PageModel); |
| | | |
| | | var total = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount); |
| | | LifePayRechargeReceiptsStatistics objectData = new LifePayRechargeReceiptsStatistics(); |
| | | objectData.TotalRechargeAmount = total; |
| | | list.ObjectData = objectData; |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取充值流水 |
| | | /// </summary> |