From aff6340db92f4801184db829eccfed93ff6fedb3 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期二, 01 四月 2025 16:41:30 +0800
Subject: [PATCH] fix:提交
---
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs | 33 +++++++++--
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml | 29 ++++++++-
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs | 39 +++++++++++-
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs | 18 ++++++
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs | 2
LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs | 9 ++
LifePayment/LifePayment.Application.Contracts/LifePay/IStatisticsService.cs | 2
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml | 7 ++
LifePayment/LifePayment.Application/LifePay/StatisticsService.cs | 39 ++++++++++++-
9 files changed, 158 insertions(+), 20 deletions(-)
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs
index cc012f9..0b2b918 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs
+++ b/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);
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/IStatisticsService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/IStatisticsService.cs
index 4e37cda..bf9259c 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/IStatisticsService.cs
+++ b/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);
}
\ No newline at end of file
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
index 4c1531b..7970135 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1111,9 +1111,22 @@
/// </summary>
public string Link { get; set; }
}
+
+public class LifePayConsumptionStatistics
+{
+ /// <summary>
+ /// 绱鎵f
+ /// </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>
/// 鐢ㄦ埛鏁伴噺
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
index aa03716..fca55d3 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -58,7 +58,7 @@
{
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.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()
@@ -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.宸叉敮浠�)
diff --git a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs b/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
index 4998753..4b9a3c5 100644
--- a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
+++ b/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;
diff --git a/LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs b/LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs
index a5cb249..919e81b 100644
--- a/LifePayment/LifePayment.Domain/LifePay/DallyStatistics.cs
+++ b/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; }
}
\ No newline at end of file
diff --git a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
index fb8cfab..07b961e 100644
--- a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
+++ b/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>
鑾峰彇鍏呭�兼祦姘村垎椤垫暟鎹�
diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
index cde063b..84805de 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1744,6 +1744,16 @@
鍦ㄧ嚎瀹㈡湇閾炬帴
</summary>
</member>
+ <member name="P:LifePayment.Application.Contracts.LifePayConsumptionStatistics.TotalDeductionAmount">
+ <summary>
+ 绱鎵f
+ </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 @@
浣i噾
</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">
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
index 606efc1..3bfe783 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
+++ b/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>
--
Gitblit v1.9.1