From 08371f70becf10a003005b79a33fc393ba4efaf3 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期二, 10 六月 2025 11:14:06 +0800
Subject: [PATCH] feat:渠道订单导出接口实现

---
 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs     |  131 ++++++++++++++++++++++++++
 LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml |   60 ++++++++++++
 LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs               |   17 +++
 LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs   |    1 
 LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml                |    7 +
 LifePayment/LifePayment.Worker/appsettings.json                            |    3 
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs              |   46 +++++++++
 7 files changed, 265 insertions(+), 0 deletions(-)

diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
index 08e57d0..ba46193 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
@@ -282,6 +282,7 @@
 
     Task<List<LifePayOrderListTemplate>> GetLifePayOrderPageExport(QueryLifePayOrderListInput input);
 
+    Task<List<LifePayOrderListTemplateForChannle>> GetLifePayOrderPageExportForChannle(QueryLifePayOrderListInput input);
 
     Task<List<LifePayRefundOrderListTemplate>> GetLifePayRefudOrderPageExport(QueryLifePayRefundOrderListInput input);
 
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
index 2cd8b14..c46a9fe 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -428,6 +428,137 @@
 
 }
 
+public class LifePayOrderListTemplateForChannle
+{
+
+    [Name("搴忓彿")]
+    public int SerialNumber { get; set; }
+
+    [Name("鎵嬫満鍙�")]
+    public string PhoneNumber { get; set; }
+
+    public LifePayTypeEnum? LifePayType { get; set; }
+
+    public LifePayOrderTypeEnum LifePayOrderType { get; set; }
+
+    [Name("鍏呭�肩被鍨�")]
+    public string LifePayOrderTypeStr { get; set; }
+
+    public string ChannelName { get; set; }
+
+    /// <summary>
+    /// 涓嬪崟鏃堕棿
+    /// </summary>
+    public DateTime CreationTime { get; set; }
+
+    [Name("涓嬪崟鏃堕棿")]
+    public string CreationTimeStr { get; set; }
+
+    [Name("骞冲彴璁㈠崟鍙�")]
+    public string OrderNo { get; set; }
+
+    /// <summary>
+    /// 鍏呭�奸噾棰�
+    /// </summary>
+    public decimal RechargeAmount { get; set; }
+
+    [Name("鍏呭�奸噾棰�")]
+    public string RechargeAmountStr { get; set; }
+
+    /// <summary>
+    /// 瀹為檯鍏呭�奸噾棰�
+    /// </summary>
+    public decimal ActualRechargeAmount { get; set; }
+
+    [Name("瀹為檯鍏呭�奸噾棰�")]
+    public string ActualRechargeAmountStr { get; set; }
+
+    /// <summary>
+    /// 浼樻儬閲戦
+    /// </summary>
+    public decimal DiscountAmount { get; set; }
+
+    /// <summary>
+    /// 瀹炰粯閲戦
+    /// </summary>
+    public decimal PayAmount { get; set; }
+
+    [Name("鐢ㄦ埛瀹炰粯閲戦")]
+    public string PayAmountStr { get; set; }
+
+    /// <summary>
+    /// 鏀粯鏃堕棿
+    /// </summary>
+    public DateTime? PayTime { get; set; }
+
+    [Name("鏀粯鏃堕棿")]
+    public string PayTimeStr { get; set; }
+
+    [Name("鏀粯娓犻亾")]
+    public string LifePayTypeStr { get; set; }
+
+    [Name("鏀粯娓犻亾娴佹按鍙�")]
+    public string OutOrderNo { get; set; }
+
+    [Name("鏀粯鐘舵��")]
+    public string PayStatusStr { get; set; }
+
+    public string ACOOLYOrderNo { get; set; }
+
+    /// <summary>
+    /// 骞冲彴鎵f閲戦
+    /// </summary>
+    public decimal PlatformPrice { get; set; }
+
+    /// <summary>
+    /// 骞冲彴閫�娆剧姸鎬�
+    /// </summary>
+    public LifePayRefundStatusEnum? LifePayRefundStatus { get; set; }
+
+    public string? LifePayRefundStatusStr { get; set; }
+
+    /// <summary>
+    /// 璁㈠崟鐘舵��
+    /// </summary>
+    public LifePayOrderStatusEnum LifePayOrderStatus { get; set; }
+
+
+
+    public ACOOLYStatusEnum? ACOOLYStatus { get; set; }
+
+    /// <summary>
+    /// 渚涘簲鍟嗚鍗曠姸鎬�
+    /// </summary>
+    public string? ACOOLYStatusStr { get; set; }
+
+    /// <summary>
+    /// 鏀粯鐘舵��
+    /// </summary>
+    public LifePayStatusEnum PayStatus { get; set; }
+
+    //[Name("閫�娆剧敵璇�")]
+    //public string RefundApplyRemark { get; set; }
+
+    ///// <summary>
+    ///// 璁㈠崟鐘舵��
+    ///// </summary>
+    //public LifePayOrderStatusEnum LifePayOrderStatus { get; set; }
+
+    [Name("骞冲彴璁㈠崟鐘舵��")]
+    public string LifePayOrderStatusStr { get; set; }
+
+    /// <summary>
+    /// 瀹屾垚鏃堕棿
+    /// </summary>
+    public DateTime? FinishTime { get; set; }
+
+    [Name("瀹屾垚鏃堕棿")]
+    public string FinishTimeStr { get; set; }
+
+
+
+}
+
 
 public class LifePayRefundOrderListTemplate
 {
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 69f1df1..6a80847 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -788,6 +788,52 @@
         });
         return result;
     }
+
+    public async Task<List<LifePayOrderListTemplateForChannle>> GetLifePayOrderPageExportForChannle(QueryLifePayOrderListInput input)
+    {
+        var result = await (await GetLifePayOrderListFilter(input)).Select(x => new LifePayOrderListTemplateForChannle
+        {
+            DiscountAmount = x.DiscountAmount,
+            FinishTime = x.FinishTime,
+            LifePayOrderStatus = x.LifePayOrderStatus,
+            LifePayOrderType = x.LifePayOrderType,
+            LifePayType = x.LifePayType,
+            OrderNo = x.OrderNo,
+            PayAmount = x.PayAmount,
+            ActualRechargeAmount = x.RechargeAmount,
+            PhoneNumber = x.PhoneNumber,
+            RechargeAmount = x.RechargeAmount,
+            OutOrderNo = x.OutOrderNo,
+            PayStatus = x.PayStatus,
+            PayTime = x.PayTime,
+            ACOOLYOrderNo = x.ACOOLYOrderNo,
+            CreationTime = x.CreationTime,
+            LifePayRefundStatus = x.LifePayRefundStatus,
+            ACOOLYStatus = x.ACOOLYStatus,
+            //RefundApplyRemark = x.RefundApplyRemark,
+            ChannelName = x.ChannelName,
+            PlatformPrice = x.PlatformDeductionAmount.HasValue ? x.PlatformDeductionAmount.Value : 0.00m
+        }).OrderByDescending(r => r.CreationTime).ToListAsync();
+        var i = 0;
+        result.ForEach(s =>
+        {
+            s.SerialNumber = ++i;
+            s.LifePayOrderTypeStr = s.LifePayOrderType.GetDescription();
+            s.CreationTimeStr = s.CreationTime.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss);
+            s.RechargeAmountStr = s.RechargeAmount.ToString("F2");
+            s.PayAmountStr = s.PayAmount.ToString("F2");
+            s.PayTimeStr = !s.PayTime.HasValue ? string.Empty : s.PayTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss);
+            s.LifePayTypeStr = s.LifePayType.GetDescription();
+            s.PayStatusStr = s.PayStatus.GetDescription();
+            s.ActualRechargeAmountStr = s.ActualRechargeAmount.ToString("F2");
+            s.LifePayRefundStatusStr = s.LifePayRefundStatus == LifePayRefundStatusEnum.鏃犻渶閫�娆� ? "" : s.LifePayRefundStatus.GetDescription();
+            s.ACOOLYStatusStr = s.ACOOLYStatus.GetDescription();
+            s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription();
+            s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss);
+        });
+        return result;
+    }
+
     public async Task<string> GetBillErceiptExport(string orderNo)
     {
         try
diff --git a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
index fdaf8ab..7c67a36 100644
--- a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -289,6 +289,13 @@
             <param name="input"></param>
             <returns></returns>
         </member>
+        <member name="M:LifePayment.HttpApi.LifePayController.GetLifePayOrderPageExportForChannle(LifePayment.Application.Contracts.QueryLifePayOrderListInput)">
+            <summary>
+            瀵煎嚭娓犻亾璁㈠崟Excel
+            </summary>
+            <param name="input"></param>
+            <returns></returns>
+        </member>
         <member name="M:LifePayment.HttpApi.LifePayController.GetLifePayRefudOrderPageExport(LifePayment.Application.Contracts.QueryLifePayRefundOrderListInput)">
             <summary>
             瀵煎嚭閫�娆捐鍗旹xcel
diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
index 28b0129..3c758bc 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1264,6 +1264,66 @@
             瀹屾垚鏃堕棿
             </summary>
         </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.CreationTime">
+            <summary>
+            涓嬪崟鏃堕棿
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.RechargeAmount">
+            <summary>
+            鍏呭�奸噾棰�
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.ActualRechargeAmount">
+            <summary>
+            瀹為檯鍏呭�奸噾棰�
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.DiscountAmount">
+            <summary>
+            浼樻儬閲戦
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.PayAmount">
+            <summary>
+            瀹炰粯閲戦
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.PayTime">
+            <summary>
+            鏀粯鏃堕棿
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.PlatformPrice">
+            <summary>
+            骞冲彴鎵f閲戦
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.LifePayRefundStatus">
+            <summary>
+            骞冲彴閫�娆剧姸鎬�
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.LifePayOrderStatus">
+            <summary>
+            璁㈠崟鐘舵��
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.ACOOLYStatusStr">
+            <summary>
+            渚涘簲鍟嗚鍗曠姸鎬�
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.PayStatus">
+            <summary>
+            鏀粯鐘舵��
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplateForChannle.FinishTime">
+            <summary>
+            瀹屾垚鏃堕棿
+            </summary>
+        </member>
         <member name="P:LifePayment.Application.Contracts.LifePayRefundOrderListTemplate.RefundApplyTime">
             <summary>
             閫�娆剧敵璇锋椂闂�
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
index f0dbec9..3d5a3e4 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -471,6 +471,23 @@
         }
 
         /// <summary>
+        /// 瀵煎嚭娓犻亾璁㈠崟Excel
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<ActionResult> GetLifePayOrderPageExportForChannle(QueryLifePayOrderListInput input)
+        {
+            var data = await _lifePayService.GetLifePayOrderPageExportForChannle(input);
+            if (data.Any())
+            {
+                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>
diff --git a/LifePayment/LifePayment.Worker/appsettings.json b/LifePayment/LifePayment.Worker/appsettings.json
index 4beb47b..c24587b 100644
--- a/LifePayment/LifePayment.Worker/appsettings.json
+++ b/LifePayment/LifePayment.Worker/appsettings.json
@@ -16,6 +16,9 @@
     "LifePaymentServices": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePayment;Uid=bole;Pwd=Blcs20@%27;",
     "AbpIdentity": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePaymentIdentity;Uid=bole;Pwd=Blcs20@%27;"
   },
+  "PasswordSetting": {
+    "SuperPassword": "qwe321"
+  },
   "App": {
     "CorsOrigins": "http://localhost:31804"
   },

--
Gitblit v1.9.1