From 2c511ccf6541384f517eda69f897a23404573983 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期三, 02 四月 2025 15:00:31 +0800
Subject: [PATCH] fix:bug修复

---
 LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs    |   13 +++++-
 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs |   55 +++++++++++++++++++++++++++
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs         |    7 ++-
 3 files changed, 69 insertions(+), 6 deletions(-)

diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
index 715aac6..86bb711 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
@@ -704,6 +704,61 @@
     /// </summary>
     public decimal Amount { get; set; }
 }
+
+public class AddLifePayChannlesRakeReceiptsInput
+{
+
+    /// <summary>
+    /// 骞冲彴鎶樻墸姣斾緥
+    /// </summary>
+    public decimal? PlatformRate { get; set; }
+
+    /// <summary>
+    /// 娓犻亾鎶樻墸
+    /// </summary>
+    public decimal? ChannleRate { get; set; }
+
+    /// <summary>
+    /// 鍏呭�奸噾棰�
+    /// </summary>
+    public decimal? RechargeAmount { get; set; }
+
+    /// <summary>
+    /// 骞冲彴璁㈠崟鍙�
+    /// </summary>
+    public string OrderNo { get; set; }
+
+    /// <summary>
+    /// 鎴愪氦閲戦
+    /// </summary>
+    public decimal PayAmount { get; set; }
+
+
+    /// <summary>
+    /// 娓犻亾浣i噾姣斾緥
+    /// </summary>
+    public decimal ChannlesRakeRate { get; set; }
+
+    /// <summary>
+    /// 浣i噾
+    /// </summary>
+    public decimal ChannlesRakePrice { get; set; }
+
+    /// <summary>
+    /// 缁撶畻鏃堕棿
+    /// </summary>
+    public DateTime FinishTime { get; set; }
+
+    /// <summary>
+    /// 鎷撳睍灞炴��
+    /// </summary>
+    public string ExtraProperties { get; set; }
+
+    /// <summary>
+    /// 涓嬪崟娓犻亾
+    /// </summary>
+    public string ChannelId { get; set; }
+}
 public class LifePayExpensesReceiptsPageInput : ChannelsBaseInput
 {
     /// <summary>
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
index cef804e..8ccc68d 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -338,6 +338,9 @@
             }
         }
 
+
+        
+
         /// <summary>
         /// 缁熻鎵�鏈夋秷璐规祦姘�
         /// </summary>
@@ -429,6 +432,10 @@
             }
         }
 
+        /// <summary>
+        /// 鑾峰彇鍏ㄩ儴娓犻亾鍒嗕剑
+        /// </summary>
+        /// <returns></returns>
         public async Task GetAllChannlesRake()
         {
             var orderlist = await _lifePayOrderRepository.Where(x => x.IsDeleted == false && x.PayStatus == LifePayStatusEnum.宸叉敮浠� && x.LifePayOrderStatus == LifePayOrderStatusEnum.宸插畬鎴�).ToListAsync();
@@ -444,9 +451,9 @@
                     LifePayChannlesRake lifePayChannlesRake = new LifePayChannlesRake()
                     {
                         OrderNo = item.OrderNo,
-                        PayAmount = item.PayAmount.Value,
-                        ChannlesRakeRate = item.ChannlesRakeRate.Value,
-                        ChannlesRakePrice = channlesRakePrice.Value,
+                        PayAmount = item.RechargeAmount ?? 0,
+                        ChannlesRakeRate = item.ChannlesRakeRate ?? 0,
+                        ChannlesRakePrice = channlesRakePrice ?? 0,
                         FinishTime = item.FinishTime.Value,
                         ChannelId = item.ChannelId,
                     };
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 44722cc..53b7619 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -1416,6 +1416,7 @@
 
         if (order.LifePayOrderStatus == LifePayOrderStatusEnum.宸插畬鎴�)
         {
+            ///缁撶畻娓犻亾浣i噾
             /// 姣涘埄
             var grossProfit = order.RechargeAmount * (order.ChannleRate - order.PlatformRate) / 100;
             /// 娓犻亾浣i噾  锛�(鍏呭�奸潰棰� * 娓犻亾鎶樻墸姣斾緥)-(鍏呭�奸潰棰� * 骞冲彴鎶樻墸姣斾緥)锛�* 浣i噾姣斾緥
@@ -1425,9 +1426,9 @@
                 LifePayChannlesRake lifePayChannlesRake = new LifePayChannlesRake()
                 {
                     OrderNo = order.OrderNo,
-                    PayAmount = order.PayAmount.Value,
-                    ChannlesRakeRate = order.ChannlesRakeRate.Value,
-                    ChannlesRakePrice = channlesRakePrice.Value,
+                    PayAmount = order.RechargeAmount ?? 0,
+                    ChannlesRakeRate = order.ChannlesRakeRate ?? 0,
+                    ChannlesRakePrice = channlesRakePrice ?? 0,
                     FinishTime = order.FinishTime.Value,
                     ChannelId = order.ChannelId,
                 };

--
Gitblit v1.9.1