From fc85a3382990bcfb5f4d1a77f1525328343b3c8c Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 25 三月 2025 18:20:47 +0800
Subject: [PATCH] fix: 新增修改实际到账金额接口

---
 LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml |   12 ++++++
 LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs               |   11 +++++
 LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs   |    7 +++
 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs      |   10 +++++
 LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml                |    7 +++
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs              |   36 ++++++++++++++----
 6 files changed, 75 insertions(+), 8 deletions(-)

diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
index ae63d78..81e6737 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
@@ -84,6 +84,13 @@
     Task<CreateLifePayOrderOutput> CreateLifePayGasOrder(CreateLifePayOrderInput<LifeGasData> input);
 
     /// <summary>
+    /// 淇敼瀹為檯鍒拌处閲戦
+    /// </summary>
+    /// <param name="input"></param>
+    /// <returns></returns>
+    Task<int> UpdateLifePayOrderActualReceivedAmount(UpdateLifePayOrderInput input);
+
+    /// <summary>
     /// 閫�娆剧敓娲荤即璐硅鍗�
     /// </summary>
     /// <param name="input"></param>
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
index 2202231..cfce3b1 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
@@ -246,6 +246,16 @@
 
 }
 
+public class UpdateLifePayOrderInput
+{
+    public Guid Id { get; set; }
+
+    /// <summary>
+    /// 瀹為檯鍒拌处閲戦
+    /// </summary>
+    public decimal ActualReceivedAmount { get; set; }
+}
+
 //public class ChannelsBaseInput : PageInput
 //{
 //    public string CheckChannelId { get; set; }
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index a142921..a6519a5 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -27,6 +27,7 @@
 using Volo.Abp.ObjectMapping;
 using NPOI.SS.Formula.Functions;
 using StackExchange.Redis;
+using static Volo.Abp.Identity.Settings.IdentitySettingNames;
 
 namespace LifePayment.Application;
 
@@ -157,7 +158,7 @@
     /// <returns></returns>
     public async Task<ChannelRateOutput> GetChannelRate(ChannelsBaseInput input)
     {
-        return  _lifePayChannlesRep.Where(x => x.IsDeleted == false && x.ChannlesNum == input.CheckChannelId).Select(x => new ChannelRateOutput() { ChannlesRate = x.ChannlesRate })
+        return _lifePayChannlesRep.Where(x => x.IsDeleted == false && x.ChannlesNum == input.CheckChannelId).Select(x => new ChannelRateOutput() { ChannlesRate = x.ChannlesRate })
                                            .FirstOrDefault();
     }
 
@@ -388,7 +389,7 @@
             s.PayAmountStr = s.PayAmount.ToString("F2");
             s.LifePayTypeStr = s.LifePayType.GetDescription();
             s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmm);
-            s.RefundApplyTimeStr = !s.RefundApplyTime.HasValue? string.Empty:s.RefundApplyTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmm);
+            s.RefundApplyTimeStr = !s.RefundApplyTime.HasValue ? string.Empty : s.RefundApplyTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmm);
         });
         return result;
     }
@@ -398,14 +399,14 @@
     {
         var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync();
         var channle = await _lifePayChannlesRep.FirstOrDefaultAsync(r => r.ChannlesNum == order.ChannelId);
-         CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�");
+        CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�");
         var user = await _lifePayUserRepository.FirstOrDefaultAsync(x => x.Id == order.UserId);
         var channlesRakePrice = (order.PayAmount - (order.PlatformDeductionAmount == null ? 0 : order.PlatformDeductionAmount)) * channle.ChannlesRakeRate / 100;
-        var orderpirce = await GetOrderPrice(order.RechargeAmount, order.PayAmount,order.PlatformRate, order.ChannleRate, order.ChannlesRakeRate,order.PremiumRate);
+        var orderpirce = await GetOrderPrice(order.RechargeAmount, order.PayAmount, order.PlatformRate, order.ChannleRate, order.ChannlesRakeRate, order.PremiumRate);
 
 
         var result = new LifePayOrderOutput()
-                {
+        {
             UserName = user.Name,
             UserPhoneNumber = user.PhoneNumber,
             DiscountAmount = order.DiscountAmount,
@@ -732,7 +733,7 @@
             LifePayType = x.LifePayType,
             OrderNo = x.OrderNo,
             PayAmount = x.PayAmount,
-            ActualRechargeAmount = x.ActualRechargeAmount.HasValue?x.ActualRechargeAmount.Value:0,
+            ActualRechargeAmount = x.ActualRechargeAmount.HasValue ? x.ActualRechargeAmount.Value : 0,
             PhoneNumber = x.PhoneNumber,
             RechargeAmount = x.RechargeAmount,
             OutOrderNo = x.OutOrderNo,
@@ -841,7 +842,7 @@
         var amount = CalculateAmount(input.ProductData.ParValue, rate.FirstOrDefault(x => x.RateType == LifePayRateTypeEnum.榛樿璇濊垂鎶樻墸).Rate);
 
         var platformRate = await _lifePayRateRepository.FirstOrDefaultAsync(r => r.RateType == LifePayRateTypeEnum.渚涘簲鍟嗘姌鎵d环);
-        
+
 
         var orderInput = new CreateLifePayOrderInput
         {
@@ -858,7 +859,7 @@
             RechargeAmount = amount.RechargeAmount,
             ChannelId = channle.ChannlesNum,
             PlatformRate = platformRate.Rate,
-            PlatformDeductionAmount = amount.RechargeAmount * platformRate.Rate /100,
+            PlatformDeductionAmount = amount.RechargeAmount * platformRate.Rate / 100,
             ChannleRate = channle.ChannlesRate,
             ChannlesRakeRate = channle.ChannlesRakeRate,
             //ChannlesRakePrice = amount.RechargeAmount * (channle.ChannlesRate - platformRate.Rate) / 100 * channle.ChannlesRakeRate / 100
@@ -1057,6 +1058,25 @@
     }
 
     /// <summary>
+    /// 淇敼瀹為檯鍒拌处閲戦
+    /// </summary>
+    /// <param name="input"></param>
+    /// <returns></returns>
+    public async Task<int> UpdateLifePayOrderActualReceivedAmount(UpdateLifePayOrderInput input)
+    {
+        var order = await _lifePayOrderRepository.Where(x => x.Id == input.Id).FirstOrDefaultAsync();
+
+        CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�");
+        CheckExtensions.IfTrueThrowUserFriendlyException(order.ACOOLYStatus != ACOOLYStatusEnum.閮ㄥ垎鍏呭�兼垚鍔�, "璇ヨ鍗曟棤娉曚慨鏀瑰埌璐﹂噾棰�");
+
+        order.ActualReceivedAmount = input.ActualReceivedAmount;
+
+        await _lifePayOrderRepository.UpdateAsync(order);
+
+        return Constant.SUCCESS;
+    }
+
+    /// <summary>
     /// 鍒涘缓鐢熸椿缂磋垂璁㈠崟
     /// </summary>
     /// <param name="input"></param>
diff --git a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
index 44eb421..5af6b0a 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.UpdateLifePayOrderActualReceivedAmount(LifePayment.Application.Contracts.UpdateLifePayOrderInput)">
+            <summary>
+            淇敼瀹為檯鍒拌处閲戦
+            </summary>
+            <param name="input"></param>
+            <returns></returns>
+        </member>
         <member name="M:LifePayment.HttpApi.LifePayController.RefundLifePayOrder(LifePayment.Application.Contracts.RefundLifePayOrderInput)">
             <summary>
             閫�娆剧敓娲荤即璐硅鍗�
diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
index ae42fc0..e3465f2 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -74,6 +74,13 @@
             <param name="input"></param>
             <returns></returns>
         </member>
+        <member name="M:LifePayment.Application.Contracts.ILifePayService.UpdateLifePayOrderActualReceivedAmount(LifePayment.Application.Contracts.UpdateLifePayOrderInput)">
+            <summary>
+            淇敼瀹為檯鍒拌处閲戦
+            </summary>
+            <param name="input"></param>
+            <returns></returns>
+        </member>
         <member name="M:LifePayment.Application.Contracts.ILifePayService.RefundLifePayOrder(LifePayment.Application.Contracts.RefundLifePayOrderInput)">
             <summary>
             閫�娆剧敓娲荤即璐硅鍗�
@@ -426,6 +433,11 @@
             鎵嬬画璐规瘮渚�
             </summary>
         </member>
+        <member name="P:LifePayment.Application.Contracts.UpdateLifePayOrderInput.ActualReceivedAmount">
+            <summary>
+            瀹為檯鍒拌处閲戦
+            </summary>
+        </member>
         <member name="P:LifePayment.Application.Contracts.QueryLifePayOrderListInput.LifePayOrderType">
             <summary>
             璁㈠崟绫诲瀷
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
index 3758621..ce05b3d 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -457,6 +457,17 @@
         }
 
         /// <summary>
+        /// 淇敼瀹為檯鍒拌处閲戦
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<int> UpdateLifePayOrderActualReceivedAmount(UpdateLifePayOrderInput input)
+        {
+            return await _lifePayService.UpdateLifePayOrderActualReceivedAmount(input);
+        }
+
+        /// <summary>
         /// 閫�娆剧敓娲荤即璐硅鍗�
         /// </summary>
         /// <param name="input"></param>

--
Gitblit v1.9.1