From aff6340db92f4801184db829eccfed93ff6fedb3 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期二, 01 四月 2025 16:41:30 +0800
Subject: [PATCH] fix:提交

---
 LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs |  164 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 156 insertions(+), 8 deletions(-)

diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
index d0f5172..3bfe783 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -1,6 +1,7 @@
 锘縰sing Alipay.AopSdk.F2FPay.Model;
 using LifePayment.Application.Contracts;
 using LifePayment.Application.LifePay;
+using LifePayment.Domain;
 using LifePayment.Domain.Common;
 using LifePayment.Domain.Shared;
 using Microsoft.AspNetCore.Authorization;
@@ -50,12 +51,39 @@
         /// <summary>
         /// 鑾峰彇椤堕儴缁熻鏁版嵁
         /// </summary>
+        /// <param name="input"></param>
         /// <returns></returns>
-        [HttpGet]
+        [HttpPost]
         [AllowAnonymous]
-        public async Task<TopStatisticsOutput> GetTopStatistics()
+        public async Task<TopStatisticsOutput> GetTopStatistics(TopStatisticsInput input)
         {
-            return await _statisticsService.GetTopStatistics();
+            return await _statisticsService.GetTopStatistics(input.ChannleList);
+        }
+
+        /// <summary>
+        /// 鑾峰彇30鏃ユ敹娆剧粺璁�
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<ReceiptsListOutPut> GetReceiptsList(TopStatisticsInput input)
+        {
+            return await _statisticsService.GetReceiptsList(input.ChannleList);
+        }
+
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<ChannelDataListOutPut> GetChannelDataList(TopStatisticsInput input)
+        {
+            return await _statisticsService.GetChannelDataList(input.ChannleList);
+        }
+
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<ChannlesRakeListOutPut> GetChannlesRakeList(TopStatisticsInput input)
+        {
+            return await _statisticsService.GetChannlesRakeList(input.ChannleList);
         }
 
         /// <summary>
@@ -432,14 +460,63 @@
             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>
         /// <returns></returns>
         [HttpPost]
-        public async Task<LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
+        public async Task<PageOutput<LifePayRechargeReceiptsListOutput>> GetLifePayRechargeReceiptsPage(LifePayRechargeReceiptsPageInput input)
         {
             return await _lifePayOrderService.GetLifePayRechargeReceiptsPage(input);
+        }
+
+        /// <summary>
+        /// 鑾峰彇娓犻亾鍒嗕剑鍒嗛〉鍒楄〃
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<PageOutput<LifePayChannlesRakeListOutput>> GetLifePayChannlesRakePage(LifePayChannlesRakePageInput input)
+        {
+            return await _lifePayOrderService.GetLifePayChannlesRakePage(input);
+        }
+
+        /// <summary>
+        /// 瀵煎嚭娓犻亾鍒嗕剑Excel
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<ActionResult> GetLifePayChannlesRakePageExport(LifePayChannlesRakePageInput input)
+        {
+            var data = await _lifePayOrderService.GetLifePayChannlesRakePageExport(input);
+            if (data.Any())
+            {
+                var bytes = ExcelHelper.ListToByteForExcel(data, "xlsx");
+                return File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "娓犻亾鍒嗕剑" + ".xlsx");
+            }
+            return Json(default);
+        }
+        /// <summary>
+        /// 鑾峰彇鏀舵敮娴佹按鍒嗛〉鏁版嵁
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<PageOutput<LifePayExpensesReceiptsListOutput>> GetLifePayExpensesReceiptsPage(LifePayExpensesReceiptsPageInput input)
+        {
+            return await _lifePayOrderService.GetLifePayExpensesReceiptsPage(input);
         }
 
         /// <summary>
@@ -451,7 +528,16 @@
         [AllowAnonymous]
         public async Task<Alipay.EasySDK.Payment.Common.Models.AlipayTradeQueryResponse> QueryAlipayTrade(OrderInQuiryInput input)
         {
-            return await _lifePayService.QueryAlipayTrade(input);
+            var res = await _lifePayService.QueryAlipayTrade(input);
+            //await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
+            //{
+            //    OrderNo = input.OutTradeNo,
+            //    OutOrderNo = res.TradeNo,
+            //    LifePayType = LifePayTypeEnum.AliPay,
+            //    ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses,
+            //    Amount = Convert.ToDecimal(res.ReceiptAmount)
+            //});
+            return res;
         }
 
         /// <summary>
@@ -466,14 +552,76 @@
             return await _lifePayService.QueryAlipayTradeRefund(input);
         }
 
-
+        /// <summary>
+        /// 鏌ヨ寰俊閫�娆句俊鎭�
+        /// </summary>
+        /// <param name="outTradeNo"></param>
+        /// <returns></returns>
         [HttpGet]
         [AllowAnonymous]
-        public async Task WxPayDomesticRefundsQuery(string outTradeNo)
+        public async Task<WxPayDomesticRefundsQueryReponse> WxPayDomesticRefundsQuery(string outTradeNo)
         {
-            await _lifePayService.WxPayDomesticRefundsQuery(outTradeNo);
+            var res = await _lifePayService.WxPayDomesticRefundsQuery(outTradeNo);
+            if (res.Code == WxpayResultCode.Success)
+            {
+                await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
+                {
+                    OrderNo = res.OutTradeNo,
+                    OutRefundNo = res.RefundId,
+                    OutOrderNo = res.TransactionId,
+                    LifePayType = LifePayTypeEnum.WxPay,
+                    ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses,
+                    Amount = Convert.ToDecimal(res.Amount.Total)
+                });
+            }
+            return res;
+
         }
 
+        /// <summary>
+        /// 鏌ヨ寰俊璁㈠崟淇℃伅
+        /// </summary>
+        /// <param name="outTradeNo"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<WxPayTradeQueryReponse> WxPayTradeQuery(string outTradeNo)
+        {
+            var res = await _lifePayService.WxPayTradeQuery(outTradeNo);
+            await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
+            {
+                OrderNo = res.OutTradeNo,
+                OutOrderNo = res.TransactionId,
+                LifePayType = LifePayTypeEnum.WxPay,
+                ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses,
+                Amount = Convert.ToDecimal(res.Amount.Total)
+            });
+            return res;
+        }
+
+        /// <summary>
+        /// 鍚屾璁㈠崟鏀舵敮淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task GetAllLifePayExpensesReceipts()
+        {
+            await _lifePayOrderService.GetAllLifePayExpensesReceipts();
+        }
+
+        /// <summary>
+        /// 鍚屾璁㈠崟
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task GetAllChannlesRake()
+        {
+            await _lifePayOrderService.GetAllChannlesRake();
+        }
+
+
         #endregion
 
         #region 鎿嶄綔

--
Gitblit v1.9.1