|  |  | 
 |  |  | using LifePayment.Domain; | 
 |  |  | using static LifePayment.Domain.Shared.LifePaymentConstant; | 
 |  |  | using Newtonsoft.Json; | 
 |  |  | using LifePayment.Domain.Common; | 
 |  |  | using Spire.Pdf.Exporting.XPS.Schema; | 
 |  |  |  | 
 |  |  | namespace LifePayment.Application.LifePay | 
 |  |  | { | 
 |  |  | 
 |  |  |  | 
 |  |  |         public async Task<List<LifePayChannlesRakeListTemplate>> GetLifePayChannlesRakePageExport(LifePayChannlesRakePageInput input) | 
 |  |  |         { | 
 |  |  |             //var result = await (await GetLifePayOrderListFilter(input)).Select(x => new LifePayOrderListTemplate | 
 |  |  |             //{ | 
 |  |  |             //    DiscountAmount = x.DiscountAmount, | 
 |  |  |             //    FinishTime = x.FinishTime, | 
 |  |  |             //    LifePayOrderStatus = x.LifePayOrderStatus, | 
 |  |  |             //    LifePayOrderType = x.LifePayOrderType, | 
 |  |  |             //    LifePayType = x.LifePayType, | 
 |  |  |             //    OrderNo = x.OrderNo, | 
 |  |  |             //    PayAmount = x.PayAmount, | 
 |  |  |             //    ActualRechargeAmount = x.RechargeAmount, | 
 |  |  |             //    PhoneNumber = x.PhoneNumber, | 
 |  |  |             //    RechargeAmount = x.RechargeAmount, | 
 |  |  |             //    OutOrderNo = x.OutOrderNo, | 
 |  |  |             //    PayStatus = x.PayStatus, | 
 |  |  |             //    PayTime = x.PayTime, | 
 |  |  |             //    ACOOLYOrderNo = x.ACOOLYOrderNo, | 
 |  |  |             //    CreationTime = x.CreationTime, | 
 |  |  |             //    LifePayRefundStatus = x.LifePayRefundStatus, | 
 |  |  |             //    ACOOLYStatus = x.ACOOLYStatus, | 
 |  |  |             //    //RefundApplyRemark = x.RefundApplyRemark, | 
 |  |  |             //    ChannelName = x.ChannelName, | 
 |  |  |             //    PlatformPrice = x.PlatformDeductionAmount.HasValue ? x.PlatformDeductionAmount.Value : 0.00m | 
 |  |  |             //}).OrderByDescending(r => r.CreationTime).ToListAsync(); | 
 |  |  |             //var i = 0; | 
 |  |  |             //result.ForEach(s => | 
 |  |  |             //{ | 
 |  |  |             //    s.SerialNumber = ++i; | 
 |  |  |             //    s.LifePayOrderTypeStr = s.LifePayOrderType.GetDescription(); | 
 |  |  |             //    s.CreationTimeStr = s.CreationTime.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); | 
 |  |  |             //    s.RechargeAmountStr = s.RechargeAmount.ToString("F2"); | 
 |  |  |             //    s.PayAmountStr = s.PayAmount.ToString("F2"); | 
 |  |  |             //    s.PayTimeStr = !s.PayTime.HasValue ? string.Empty : s.PayTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); | 
 |  |  |             //    s.LifePayTypeStr = s.LifePayType.GetDescription(); | 
 |  |  |             //    s.PayStatusStr = s.PayStatus.GetDescription(); | 
 |  |  |             //    s.ActualRechargeAmountStr = s.ActualRechargeAmount.ToString("F2"); | 
 |  |  |             //    s.LifePayRefundStatusStr = s.LifePayRefundStatus == LifePayRefundStatusEnum.无需退款 ? "" : s.LifePayRefundStatus.GetDescription(); | 
 |  |  |             //    s.ACOOLYStatusStr = s.ACOOLYStatus.GetDescription(); | 
 |  |  |             //    s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription(); | 
 |  |  |             //    s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); | 
 |  |  |             //}); | 
 |  |  |             return null; | 
 |  |  |             var result = await (await GetLifePayChannlesRakeListFilter(input)).Select(x => new LifePayChannlesRakeListTemplate | 
 |  |  |             { | 
 |  |  |                 CreationTime = x.CreationTime, | 
 |  |  |                 FinishTime = x.FinishTime, | 
 |  |  |                 OrderNo = x.OrderNo, | 
 |  |  |                 PayAmount = x.PayAmount, | 
 |  |  |                 ChannlesRakeRate = x.ChannlesRakeRate, | 
 |  |  |                 ChannlesRakePrice = x.ChannlesRakePrice | 
 |  |  |             }).OrderByDescending(r => r.CreationTime).ToListAsync(); | 
 |  |  |             var i = 0; | 
 |  |  |             result.ForEach(s => | 
 |  |  |             { | 
 |  |  |                 s.SerialNumber = ++i; | 
 |  |  |                 s.CreationTimeStr = s.CreationTime.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); | 
 |  |  |                 s.PayAmountStr = s.PayAmount.ToString("F2"); | 
 |  |  |                 s.ChannlesRakeRateStr = s.ChannlesRakeRate.ToString("F2"); | 
 |  |  |                 s.ChannlesRakePriceStr = s.ChannlesRakePrice.ToString("F2"); | 
 |  |  |                 s.FinishTimeStr = s.FinishTime.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss); | 
 |  |  |             }); | 
 |  |  |             return result; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         #region 操作 | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// 编辑充值流水 | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |          | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// 插入收支流水 | 
 |  |  |         /// </summary> | 
 |  |  | 
 |  |  |                         input.ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Receipts; | 
 |  |  |                         await AddLifePayExpensesReceipts(input); | 
 |  |  |                     } | 
 |  |  |                      | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 私有 | 
 |  |  |         private async Task<IQueryable<LifePayChannlesRakeListOutput>> GetLifePayChannlesRakeListFilter(LifePayChannlesRakePageInput input) | 
 |  |  |         { | 
 |  |  |             var list = _lifePayChannlesRakeRepository.Where(x => x.IsDeleted == false) | 
 |  |  |                 .WhereIf(input.ChannelId.IsNotNullOrEmpty(), x => x.ChannelId == input.ChannelId) | 
 |  |  |                 .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin) | 
 |  |  |                 .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd) | 
 |  |  |                 .WhereIf(input.FinishTimeBegin.HasValue, x => x.FinishTime >= input.FinishTimeBegin) | 
 |  |  |                 .WhereIf(input.FinishTimeEnd.HasValue, x => x.FinishTime <= input.FinishTimeEnd) | 
 |  |  |  | 
 |  |  |                 .Select(x => new LifePayChannlesRakeListOutput() | 
 |  |  |                 { | 
 |  |  |                     Id = x.Id, | 
 |  |  |                     OrderNo = x.OrderNo, | 
 |  |  |                     PayAmount = x.PayAmount, | 
 |  |  |                     ChannlesRakeRate = x.ChannlesRakeRate, | 
 |  |  |                     ChannlesRakePrice = x.ChannlesRakePrice, | 
 |  |  |                     ChannelId = x.ChannelId, | 
 |  |  |                     FinishTime = x.FinishTime, | 
 |  |  |                     CreationTime = x.CreationTime, | 
 |  |  |                 }); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             return list; | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | } |