| | |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input) |
| | | public async Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input) |
| | | { |
| | | var list = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false) |
| | | .WhereIf(input.KeyWord.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.KeyWord)) |
| | |
| | | .GetPageResult(input.PageModel); |
| | | |
| | | var total = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount); |
| | | LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput> result = new LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>(); |
| | | result.Data = list.Data; |
| | | result.TotalRechargeAmount = total; |
| | | return result; |
| | | LifePayRechargeReceiptsStatistics objectData = new LifePayRechargeReceiptsStatistics(); |
| | | objectData.TotalRechargeAmount = total; |
| | | list.ObjectData = objectData; |
| | | return list; |
| | | } |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<LifePayExpensesReceiptsPageOutput<LifePayExpensesReceiptsListOutput>> GetLifePayExpensesReceiptsPage(LifePayExpensesReceiptsPageInput input) |
| | | public async Task<PageOutput<LifePayExpensesReceiptsListOutput>> GetLifePayExpensesReceiptsPage(LifePayExpensesReceiptsPageInput input) |
| | | { |
| | | var list = await _lifePayExpensesReceiptsRepository.Where(x => x.IsDeleted == false) |
| | | .WhereIf(input.KeyWord.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.KeyWord) || x.OutOrderNo.Contains(input.KeyWord)) |
| | |
| | | var totalIncome = await _lifePayExpensesReceiptsRepository.Where(x => x.IsDeleted == false && x.ExpensesReceiptsType == ExpensesReceiptsTypeEnum.Expenses).SumAsync(x => x.Amount); |
| | | var totalRefund = await _lifePayExpensesReceiptsRepository.Where(x => x.IsDeleted == false && x.ExpensesReceiptsType == ExpensesReceiptsTypeEnum.Receipts).SumAsync(x => x.Amount); |
| | | |
| | | LifePayExpensesReceiptsPageOutput<LifePayExpensesReceiptsListOutput> result = new LifePayExpensesReceiptsPageOutput<LifePayExpensesReceiptsListOutput>(); |
| | | result.Data = list.Data; |
| | | result.TotalIncome = totalIncome; |
| | | result.TotalRefund = totalRefund; |
| | | result.RealIncome = totalIncome - totalRefund; |
| | | return result; |
| | | LifePayExpensesReceiptsStatistics objectData = new LifePayExpensesReceiptsStatistics(); |
| | | objectData.TotalIncome = totalIncome; |
| | | objectData.TotalRefund = totalRefund; |
| | | objectData.RealIncome = totalIncome - totalRefund; |
| | | list.ObjectData = objectData; |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (input.ExpensesReceiptsType == ExpensesReceiptsTypeEnum.Expenses) |
| | | { |
| | | var query = await _aliPayApi.OrderInQuiry(new OrderInQuiryInput() { OutTradeNo = input.OrderNo }); |
| | | if (query.Code == AlipayResultCode.Success && (query.TradeStatus == AlipayStatus.TRADESUCCESS |
| | | if (query.Code == AlipayResultCode.Success && (query.TradeStatus == AlipayStatus.TRADESUCCESS |
| | | || query.TradeStatus == AlipayStatus.TRADECLOSED)) |
| | | { |
| | | data.ExtraProperties = JsonConvert.SerializeObject(query); |
| | |
| | | if (query.Code == AlipayResultCode.Success && query.RefundStatus == AlipayRefundStatus.Success) |
| | | { |
| | | data.ExtraProperties = JsonConvert.SerializeObject(query); |
| | | //data.FinishTime = Convert.ToDateTime(query.SendPayDate); |
| | | data.FinishTime = Convert.ToDateTime(query.GmtRefundPay); |
| | | await _lifePayExpensesReceiptsRepository.InsertAsync(data); |
| | | } |
| | | } |