LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs
@@ -10,6 +10,8 @@ public interface ILifePayOrderService : IApplicationService { Task<PageOutput<LifePayConsumptionListOutput>> GetLifePayConsumptionPage(LifePayConsumptionPageInput input); Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input); Task<PageOutput<LifePayExpensesReceiptsListOutput>> GetLifePayExpensesReceiptsPage(LifePayExpensesReceiptsPageInput input); LifePayment/LifePayment.Application.Contracts/LifePay/IStatisticsService.cs
@@ -15,4 +15,6 @@ Task<ReceiptsListOutPut> GetReceiptsList(List<string>? channleList = null); Task<ChannelDataListOutPut> GetChannelDataList(List<string>? channleList = null); Task<ChannlesRakeListOutPut> GetChannlesRakeList(List<string>? channleList = null); } LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1111,9 +1111,22 @@ /// </summary> public string Link { get; set; } } public class LifePayConsumptionStatistics { /// <summary> /// 累计扣款 /// </summary> public decimal TotalDeductionAmount { get; set; } /// <summary> /// 冻结中 /// </summary> public decimal TotalFrozenAmount { get; set; } } public class LifePayRechargeReceiptsStatistics { /// <summary> /// 累计充值 /// </summary> @@ -1160,7 +1173,7 @@ /// </summary> public Guid Id { get; set; } // <summary> /// <summary> /// 平台订单号 /// </summary> public string OrderNo { get; set; } @@ -1332,6 +1345,14 @@ public decimal Amount { get; set; } } public class ChannlesRakeListOutPut { /// <summary> /// 30天佣金 /// </summary> public List<ReceiptsDetail> ChannlesRakeList { get; set; } = new List<ReceiptsDetail> { }; } public class ChannelDataListOutPut { /// <summary> @@ -1349,9 +1370,9 @@ public class ChannelDataReceive { /// <summary> /// 渠道编号 /// 渠道名称 /// </summary> public string ChannelId { get; set; } public string ChannelName { get; set; } /// <summary> /// 收款 @@ -1368,9 +1389,9 @@ public class ChannelDataUserNumber { /// <summary> /// 渠道编号 /// 渠道名称 /// </summary> public string ChannelId { get; set; } public string ChannelName { get; set; } /// <summary> /// 用户数量 LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -71,12 +71,15 @@ FrozenStatus = x.FrozenStatus, Flow = x.Flow, DeductionAmount = x.DeductionAmount, FrozenAmount = x.FrozenAmount.Value }) .GetPageResult(input.PageModel); var total = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount); LifePayRechargeReceiptsStatistics objectData = new LifePayRechargeReceiptsStatistics(); objectData.TotalRechargeAmount = total; var totalDeductionAmount = await _lifePayConsumption.Where(x => x.IsDeleted == false).SumAsync(x => x.DeductionAmount); var totalFrozenAmount = await _lifePayConsumption.Where(x => x.IsDeleted == false).SumAsync(x => x.FrozenAmount); LifePayConsumptionStatistics objectData = new LifePayConsumptionStatistics(); objectData.TotalDeductionAmount = totalDeductionAmount; objectData.TotalFrozenAmount = totalFrozenAmount.Value; list.ObjectData = objectData; return list; } @@ -244,7 +247,6 @@ } } /// <summary> /// 插入收支流水 /// </summary> @@ -322,6 +324,33 @@ } } /// <summary> /// 统计所有消费流水 /// </summary> /// <returns></returns> public async Task GetAllLifePayConsumption() { var orderList = await _lifePayOrderRepository.Where(x => x.PayStatus == LifePayStatusEnum.已支付).ToListAsync(); foreach (var item in orderList) { LifePayConsumption lifePayConsumption = new LifePayConsumption() { OrderNo = item.OrderNo, OutOrderNo = item.OutOrderNo, //Amount = item.PayAmount, }; //switch (item.ACOOLYStatus) //{ // case ACOOLYStatusEnum.充值中: // break; // default:break; //} } } public async Task GetAllLifePayExpensesReceipts() { var orderlist = await (from a in _lifePayOrderRepository.Where(x => x.PayStatus >= LifePayStatusEnum.已支付) LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
@@ -138,6 +138,38 @@ } return receiptsListOutPut; } public async Task<ChannlesRakeListOutPut> GetChannlesRakeList(List<string> channleList) { var today = DateTime.Now.Date; var statistics = await _lifePayChannlesRakeRepository.Where(x => x.IsDeleted == false) .WhereIf(channleList.Count() > 0, x => channleList.Contains(x.ChannelId)) .ToListAsync(); var groupedStatistics = statistics .GroupBy(x => x.CreationTime) .Select(g => new { CreationTime = g.Key, ChannlesRakePrice = g.Sum(x => x.ChannlesRakePrice), }) .ToList(); ChannlesRakeListOutPut channlesRakeListOutPut = new ChannlesRakeListOutPut(); foreach (var item in groupedStatistics) { ReceiptsDetail receive = new ReceiptsDetail() { CreationTime = item.CreationTime.ToString("yyyy-MM-dd"), Amount = item.ChannlesRakePrice }; channlesRakeListOutPut.ChannlesRakeList.Add(receive); } return channlesRakeListOutPut; } @@ -164,7 +196,7 @@ { ChannelDataReceive receive = new ChannelDataReceive() { ChannelId = item.ChannelId, ChannelName = _lifePayChannlesRep.Where(x => x.ChannlesNum == item.ChannelId).FirstOrDefault().ChannlesName, ReceivePrice = item.ReceivePrice, ChannlesRakePrice = item.ChannlesRakePrice, }; @@ -190,7 +222,7 @@ { ChannelDataUserNumber usernumber = new ChannelDataUserNumber() { ChannelId = item.ChannelId, ChannelName = _lifePayChannlesRep.Where(x => x.ChannlesNum == item.ChannelId).FirstOrDefault().ChannlesName, Number = item.Number, }; if (channelDataList.UserNumberList.Count() < 5) @@ -256,7 +288,8 @@ YesterdayFail = yesterdayFail, AccumulatedUsers = accumulatedUsers, YesterdayActiveUsers = yesterdayActiveUsers, ChannelId = channleId ChannelId = channleId, Date = today.AddDays(-1) }; await _dallyStatisticsRepository.InsertAsync(entity); return entity; LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs
@@ -9,7 +9,9 @@ public class DallyStatistics : Entity<Guid> { /// <summary> /// 创建时间 /// </summary> public DateTime CreationTime { get; set; } /// <summary> @@ -72,4 +74,9 @@ /// 统计渠道 /// </summary> public string ChannelId { get; set; } /// <summary> /// 统计日期 /// </summary> public DateTime Date { get; set; } } LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -268,6 +268,13 @@ <param name="input"></param> <returns></returns> </member> <member name="M:LifePayment.HttpApi.LifePayController.GetLifePayConsumptionPage(LifePayment.Application.Contracts.LifePayConsumptionPageInput)"> <summary> 获取消费流水分页数据 </summary> <param name="input"></param> <returns></returns> </member> <member name="M:LifePayment.HttpApi.LifePayController.GetLifePayRechargeReceiptsPage(LifePayment.Application.Contracts.LifePayRechargeReceiptsPageInput)"> <summary> 获取充值流水分页数据 LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1744,6 +1744,16 @@ 在线客服链接 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayConsumptionStatistics.TotalDeductionAmount"> <summary> 累计扣款 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayConsumptionStatistics.TotalFrozenAmount"> <summary> 冻结中 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayRechargeReceiptsStatistics.TotalRechargeAmount"> <summary> 累计充值 @@ -1784,7 +1794,11 @@ 编号 </summary> </member> <!-- Badly formed XML comment ignored for member "P:LifePayment.Application.Contracts.LifePayConsumptionListOutput.OrderNo" --> <member name="P:LifePayment.Application.Contracts.LifePayConsumptionListOutput.OrderNo"> <summary> 平台订单号 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayConsumptionListOutput.OutOrderNo"> <summary> 渠道流水号 @@ -1920,6 +1934,11 @@ 金额 </summary> </member> <member name="P:LifePayment.Application.Contracts.ChannlesRakeListOutPut.ChannlesRakeList"> <summary> 30天佣金 </summary> </member> <member name="P:LifePayment.Application.Contracts.ChannelDataListOutPut.ReceiveList"> <summary> Top5渠道收款 @@ -1930,9 +1949,9 @@ Top5渠道用户 </summary> </member> <member name="P:LifePayment.Application.Contracts.ChannelDataReceive.ChannelId"> <member name="P:LifePayment.Application.Contracts.ChannelDataReceive.ChannelName"> <summary> 渠道编号 渠道名称 </summary> </member> <member name="P:LifePayment.Application.Contracts.ChannelDataReceive.ReceivePrice"> @@ -1945,9 +1964,9 @@ 佣金 </summary> </member> <member name="P:LifePayment.Application.Contracts.ChannelDataUserNumber.ChannelId"> <member name="P:LifePayment.Application.Contracts.ChannelDataUserNumber.ChannelName"> <summary> 渠道编号 渠道名称 </summary> </member> <member name="P:LifePayment.Application.Contracts.ChannelDataUserNumber.Number"> LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -79,6 +79,13 @@ return await _statisticsService.GetChannelDataList(input.ChannleList); } [HttpPost] [AllowAnonymous] public async Task<ChannlesRakeListOutPut> GetChannlesRakeList(TopStatisticsInput input) { return await _statisticsService.GetChannlesRakeList(input.ChannleList); } /// <summary> /// 获取电费面值 /// </summary> @@ -453,6 +460,17 @@ return data; } /// <summary> /// 获取消费流水分页数据 /// </summary> /// <param name="input"></param> /// <returns></returns> [HttpPost] public async Task<PageOutput<LifePayConsumptionListOutput>> GetLifePayConsumptionPage(LifePayConsumptionPageInput input) { return await _lifePayOrderService.GetLifePayConsumptionPage(input); } /// <summary> /// 获取充值流水分页数据 /// </summary> /// <param name="input"></param>