From 89d279f63222827d54c7c1ad52ddf6782e7f9a9b Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 02 四月 2025 16:27:32 +0800
Subject: [PATCH] fix: bug

---
 LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs |  381 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 377 insertions(+), 4 deletions(-)

diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
index 58b03bb..16b0491 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -1,7 +1,12 @@
-锘縰sing LifePayment.Application.Contracts;
+锘縰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;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -19,17 +24,77 @@
     public class LifePayController : AbpController
     {
         private readonly ILifePayService _lifePayService;
+        private readonly IStatisticsService _statisticsService;
         private readonly IWebClientInfoProvider _webClientInfoProvider;
+        private readonly ICommonService _commonService;
+        private readonly ILifePayOrderService _lifePayOrderService;
+        private readonly ILogger<LifePayController> _logger;
         public LifePayController(
               ILifePayService lifePayService,
-              IWebClientInfoProvider webClientInfoProvider
+              IStatisticsService statisticsService,
+              IWebClientInfoProvider webClientInfoProvider,
+              ICommonService commonService,
+              ILifePayOrderService lifePayOrderService,
+              ILogger<LifePayController> logger
               )
         {
             _lifePayService = lifePayService;
+            _statisticsService = statisticsService;
             _webClientInfoProvider = webClientInfoProvider;
+            _commonService = commonService;
+            _lifePayOrderService = lifePayOrderService;
+            _logger = logger;
         }
 
         #region 鏌ヨ
+
+        /// <summary>
+        /// 鑾峰彇椤堕儴缁熻鏁版嵁
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<TopStatisticsOutput> GetTopStatistics(TopStatisticsInput input)
+        {
+            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);
+        }
+
+        /// <summary>
+        /// 娓犻亾鏁版嵁
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<ChannelDataListOutPut> GetChannelDataList(TopStatisticsInput input)
+        {
+            return await _statisticsService.GetChannelDataList(input.ChannleList);
+        }
+
+        /// <summary>
+        /// 30鏃ヤ剑閲戝垪琛�
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<ChannlesRakeListOutPut> GetChannlesRakeList(TopStatisticsInput input)
+        {
+            return await _statisticsService.GetChannlesRakeList(input.ChannleList);
+        }
 
         /// <summary>
         /// 鑾峰彇鐢佃垂闈㈠��
@@ -107,6 +172,20 @@
         }
 
         /// <summary>
+        /// 娣诲姞鏃ュ織
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+
+        public async Task<int> AddLogger(LogErrorInput input)
+        {
+            Logger.LogError("鍓嶇閿欒锛�" + input.Error);
+            return Constant.SUCCESS;
+        }
+
+
+        /// <summary>
         /// 鑾峰彇鎶樻墸
         /// </summary>
         /// <returns></returns>
@@ -115,6 +194,17 @@
         public async Task<List<LifePayRateListOutput>> GetRate()
         {
             return await _lifePayService.GetRate();
+        }
+
+        /// <summary>
+        /// 鑾峰彇娓犻亾鎶樻墸
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<ChannelRateOutput> GetChannelRate(ChannelsBaseInput input)
+        {
+            return await _lifePayService.GetChannelRate(input);
         }
 
         /// <summary>
@@ -139,6 +229,16 @@
             return await _lifePayService.GetIntroInfo(type);
         }
 
+        /// <summary>
+        /// 鑾峰彇鍦ㄧ嚎瀹㈡湇
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<string> GetOnlineService()
+        {
+            return await _commonService.GetOnlineService();
+        }
 
         /// <summary>
         /// 鑾峰彇鐢ㄦ埛鍒嗛〉鏁版嵁
@@ -146,7 +246,7 @@
         /// <param name="input"></param>
         /// <returns></returns>
         [HttpPost]
-        public async Task<PageOutput<UserListOutput>> GetUserPage(PageInput input)
+        public async Task<PageOutput<UserListOutput>> GetUserPage(QueryUserPageInput input)
         {
             return await _lifePayService.GetUserPage(input);
         }
@@ -160,6 +260,39 @@
         public async Task<PageOutput<LifePayOrderListOutput>> GetLifePayOrderPage(QueryLifePayOrderListInput input)
         {
             return await _lifePayService.GetLifePayOrderPage(input);
+        }
+
+        /// <summary>
+        /// 鑾峰彇閫�娆捐鍗曞垎椤垫暟鎹�
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<PageOutput<LifePayOrderListOutput>> GetLifePayRefundOrderPage(QueryLifePayRefundOrderListInput input)
+        {
+            return await _lifePayService.GetLifePayRefundOrderPage(input);
+        }
+
+        /// <summary>
+        /// 鑾峰彇璁㈠崟璇︽儏
+        /// </summary>
+        /// <param name="orderNo"></param>
+        /// <returns></returns>
+        [HttpGet]
+        public async Task<LifePayOrderOutput> GetLifePayOrderDetail(string orderNo)
+        {
+            return await _lifePayService.GetLifePayOrderDetail(orderNo);
+        }
+
+        /// <summary>
+        /// 鑾峰彇閫�娆捐鍗曡鎯�
+        /// </summary>
+        /// <param name="orderNo"></param>
+        /// <returns></returns>
+        [HttpGet]
+        public async Task<LifePayRefundOrderOutput> GetLifePayRefundOrderDetail(string orderNo)
+        {
+            return await _lifePayService.GetLifePayRefundOrderDetail(orderNo);
         }
 
         /// <summary>
@@ -210,6 +343,15 @@
         public async Task<PageOutput<CreateEditPayChannelsInput>> GetLifePayChannlesPage(PageInput input)
         {
             return await _lifePayService.GetLifePayChannlesPage(input);
+        }
+
+        /// <summary>
+        /// 鑾峰彇鍏ㄩ儴缂磋垂娓犻亾
+        /// </summary>
+        [HttpPost]
+        public async Task<List<CreateEditPayChannelsInput>> GetLifePayChannlesAllList(QueryLifePayChannlesInput input)
+        {
+            return await _lifePayService.GetLifePayChannlesAllList(input);
         }
 
         /// <summary>
@@ -299,10 +441,206 @@
                 var bytes = ExcelHelper.ListToByteForExcel(data, "xlsx");
                 return File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "璁㈠崟绠$悊" + ".xlsx");
             }
-
             return Json(default);
         }
 
+        /// <summary>
+        /// 瀵煎嚭閫�娆捐鍗旹xcel
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<ActionResult> GetLifePayRefudOrderPageExport(QueryLifePayRefundOrderListInput input)
+        {
+            var data = await _lifePayService.GetLifePayRefudOrderPageExport(input);
+            if (data.Any())
+            {
+                var bytes = ExcelHelper.ListToByteForExcel(data, "xlsx");
+                return File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "閫�娆剧鐞�" + ".xlsx");
+            }
+            return Json(default);
+        }
+
+
+        [HttpGet]
+        public async Task<string> GetBillErceiptExport(string orderNo)
+        {
+            var data = await _lifePayService.GetBillErceiptExport(orderNo);
+
+            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<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>
+        /// 鏌ヨ鏀粯瀹濇敮浠樿鍗曚俊鎭�
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<Alipay.EasySDK.Payment.Common.Models.AlipayTradeQueryResponse> QueryAlipayTrade(OrderInQuiryInput 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>
+        /// 鏌ヨ鏀粯瀹濋��娆捐鍗曚俊鎭�
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<Alipay.EasySDK.Payment.Common.Models.AlipayTradeFastpayRefundQueryResponse> QueryAlipayTradeRefund(OrderInQuiryInput input)
+        {
+            return await _lifePayService.QueryAlipayTradeRefund(input);
+        }
+
+        /// <summary>
+        /// 鏌ヨ寰俊閫�娆句俊鎭�
+        /// </summary>
+        /// <param name="outTradeNo"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<WxPayDomesticRefundsQueryReponse> WxPayDomesticRefundsQuery(string 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();
+        }
+
+        /// <summary>
+        /// 缁熻浜ゆ槗娴佹按
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task GetAllLifePayConsumption()
+        {
+            await _lifePayOrderService.GetAllLifePayConsumption();
+        }
         #endregion
 
         #region 鎿嶄綔
@@ -344,6 +682,17 @@
         public async Task<CreateLifePayOrderOutput> CreateLifePayGasOrder(CreateLifePayOrderInput<LifeGasData> input)
         {
             return await _lifePayService.CreateLifePayGasOrder(input);
+        }
+
+        /// <summary>
+        /// 淇敼瀹為檯鍒拌处閲戦
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<int> UpdateLifePayOrderActualReceivedAmount(UpdateLifePayOrderInput input)
+        {
+            return await _lifePayService.UpdateLifePayOrderActualReceivedAmount(input);
         }
 
         /// <summary>
@@ -475,6 +824,30 @@
         }
 
         /// <summary>
+        /// 鍦ㄧ嚎瀹㈡湇閰嶇疆
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<int> UpdateOnlineService(OnlineServiceInput input)
+        {
+            await _commonService.UpdateOnlineService(input);
+            return Constant.SUCCESS;
+        }
+
+        /// <summary>
+        /// 涓婁紶鍏呭�兼祦姘�
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<int> AddUpdatePayRechargeReceipts(AddUpdatePayRechargeReceiptsInput input)
+        {
+            await _lifePayOrderService.AddUpdatePayRechargeReceipts(input);
+            return Constant.SUCCESS;
+        }
+
+        /// <summary>
         /// 璁剧疆鐢熸椿缂磋垂鏀粯绫诲瀷
         /// </summary>
         /// <param name="input"></param>

--
Gitblit v1.9.1