From 7a89586d7754d5ff1c38cbfdbda6c357507f5620 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期一, 09 六月 2025 13:34:15 +0800 Subject: [PATCH] feat:退款按比例自动计算 --- LifePayment/LifePayment.Host/appsettings.json | 8 ++++---- LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml | 20 ++++++++++++++++++++ LifePayment/LifePayment.Host/Properties/launchSettings.json | 1 - LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 6 +++++- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs index 0aef80f..48708f5 100644 --- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs +++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs @@ -353,6 +353,7 @@ RefundPrice = a.RefundPrice, ChannelName = b.ChannlesName, ActualRechargeAmount = a.RechargeAmount, + ActualReceivedAmount = a.ActualReceivedAmount, PlatformDeductionAmount = a.PlatformDeductionAmount, ACOOLYStatus = a.ACOOLYStatus, LifePayRefundStatus = a.LifePayRefundStatus, @@ -453,6 +454,7 @@ PremiumPrice = orderpirce.PremiumPrice, Profit = orderpirce.Profit, RefundOrderNo = order.RefundOrderNo, + ActualReceivedAmount = order.ActualReceivedAmount }; return result; @@ -1404,7 +1406,7 @@ || order.LifePayOrderStatus == LifePayOrderStatusEnum.宸查��娆�) { order.FinishTime = DateTime.Now; - order.PlatformDeductionAmount = order.ActualReceivedAmount * order.PlatformRate / 100; + order.PlatformDeductionAmount = Math.Round((order.ActualReceivedAmount ?? 0) * (order.PlatformRate ?? 0) / 100, 2); order.RefundPrice = Math.Round((1 - ((order.ActualReceivedAmount ?? 0) / (order.RechargeAmount ?? 0))) * (order.PayAmount ?? 0), 2); } @@ -1515,6 +1517,8 @@ order.RefundTime = DateTime.Now; order.RefundCheckUserId = CurrentUser.Id; order.RefundPrice = input.RefundPrice; + order.ActualReceivedAmount = Math.Round((1 - ((order.RefundPrice ?? 0) / (order.PayAmount ?? 0))) * (order.RechargeAmount ?? 0), 2); + order.PlatformDeductionAmount = Math.Round((order.ActualReceivedAmount ?? 0) * (order.PlatformRate ?? 0) / 100, 2); //await _lifePayOrderRepository.UpdateAsync(order); diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml index 57b40f2..ef23058 100644 --- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml +++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml @@ -1927,6 +1927,11 @@ 鐢ㄦ埛Id </summary> </member> + <member name="P:LifePayment.Application.Contracts.LifePayPhoneMesssageCodeLoginOutput.PromoterIdNumber"> + <summary> + 鎺ㄥ箍鍛業D + </summary> + </member> <member name="P:LifePayment.Application.Contracts.LifePayPhoneMesssageCodeLoginOutput.IsBackClientUser"> <summary> 鏄惁鏄悗鍙扮敤鎴� @@ -2342,6 +2347,21 @@ <param name="input"></param> <returns></returns> </member> + <member name="P:LifePayment.Application.Contracts.GetPromotersInput.StartDate"> + <summary> + 鍒涘缓鐨勫紑濮嬫椂闂� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.GetPromotersInput.EndDate"> + <summary> + 鍒涘缓鐨勭粨鏉熸椂闂� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.GetPromotersInput.SearchKey"> + <summary> + 鎼滅储鍏抽敭璇� + </summary> + </member> <member name="P:LifePayment.Application.Contracts.PromoterDto.Id"> <summary> Id diff --git a/LifePayment/LifePayment.Host/Properties/launchSettings.json b/LifePayment/LifePayment.Host/Properties/launchSettings.json index c33e6a4..c976b0b 100644 --- a/LifePayment/LifePayment.Host/Properties/launchSettings.json +++ b/LifePayment/LifePayment.Host/Properties/launchSettings.json @@ -2,7 +2,6 @@ "profiles": { "IIS Express": { "commandName": "IISExpress", - "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/LifePayment/LifePayment.Host/appsettings.json b/LifePayment/LifePayment.Host/appsettings.json index bcbf82b..735d874 100644 --- a/LifePayment/LifePayment.Host/appsettings.json +++ b/LifePayment/LifePayment.Host/appsettings.json @@ -19,10 +19,10 @@ "OssRoleRan": "acs:ram::1483797030072898:role/boleoss" }, "ConnectionStrings": { - "AbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589", - "LifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589", - //"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;", + //"AbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589", + //"LifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589", + "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;", "SyncAbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589", "SyncLifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589" -- Gitblit v1.9.1