From 083ef091d15d227c8112b9b24819b2744c949a75 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 26 三月 2025 14:37:41 +0800
Subject: [PATCH] fix: bug

---
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 2606e26..a05844f 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -442,7 +442,8 @@
             ChannlesRakePrice = orderpirce.ChannlesRakePrice,
             PremiumRate = order.PremiumRate,
             PremiumPrice = orderpirce.PremiumPrice,
-            Profit = orderpirce.Profit
+            Profit = orderpirce.Profit,
+            RefundOrderNo = order.RefundOrderNo,
         };
 
         return result;
@@ -729,7 +730,7 @@
         {
             DiscountAmount = x.DiscountAmount,
             FinishTime = x.FinishTime,
-            //LifePayOrderStatus = x.LifePayOrderStatus,
+            LifePayOrderStatus = x.LifePayOrderStatus,
             LifePayOrderType = x.LifePayOrderType,
             LifePayType = x.LifePayType,
             OrderNo = x.OrderNo,
@@ -762,7 +763,7 @@
             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.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription();
             s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss);
         });
         return result;
@@ -1124,7 +1125,7 @@
 #endif
 
         CheckExtensions.IfTrueThrowUserFriendlyException(!result.Success || (result.Code != ACOOLYConstant.Code.SUCCESS && result.Code != ACOOLYConstant.Code.PROCESSING),
-                                                        "璋冪敤ACOOLY鎺ュ彛ConfirmElectricOrder杩斿洖閿欒:" + JsonConvert.SerializeObject(result));
+                                                        result.Message);
 
         return (result.Code, requestInput.RequestNo, result.PhoneChargeOrder.BusiOrderNo);
     }
@@ -1155,7 +1156,7 @@
 #endif
 
         CheckExtensions.IfTrueThrowUserFriendlyException(!result.Success || (result.Code != ACOOLYConstant.Code.SUCCESS && result.Code != ACOOLYConstant.Code.PROCESSING),
-                                                        "璋冪敤ACOOLY鎺ュ彛ConfirmElectricOrder杩斿洖閿欒:" + JsonConvert.SerializeObject(result));
+                                                        result.Message);
 
         return (result.Code, requestInput.RequestNo, result.ElectricChargeOrder.BusiOrderNo);
     }
@@ -1183,7 +1184,7 @@
 #endif
 
         CheckExtensions.IfTrueThrowUserFriendlyException(!result.Success || (result.Code != ACOOLYConstant.Code.SUCCESS && result.Code != ACOOLYConstant.Code.PROCESSING),
-                                                        "璋冪敤ACOOLY鎺ュ彛ConfirmElectricOrder杩斿洖閿欒:" + JsonConvert.SerializeObject(result));
+                                                        result.Message);
 
         return (result.Code, requestInput.RequestNo, result.GasChargeOrder.BusiOrderNo);
     }
@@ -1301,6 +1302,7 @@
             _logger.LogError(ex, "澶勭悊鐢熸椿缂磋垂鏀粯鎴愬姛鍥炶皟鏃跺紓甯�");
             order.LifePayOrderStatus = LifePayOrderStatusEnum.寰呴��娆�;
             order.LifePayRefundStatus = LifePayRefundStatusEnum.寰呴��娆�;
+            order.RefundApplyRemark = ex.Message;
         }
         _logger.LogError("鐢熸椿缂磋垂璁㈠崟鐘舵�侊細" + order.LifePayOrderStatus.ToString());
         await _lifePayOrderRepository.UpdateAsync(order);
@@ -1570,9 +1572,9 @@
         if (input.LifePayType == LifePayOrderTypeEnum.璇濊垂璁㈠崟)
         {
             var extraProperties = JsonConvert.DeserializeObject<Model_UserAccountExtraProperties>(input.ExtraProperties);
-            if (!string.IsNullOrEmpty(extraProperties.Name))
+            if (!string.IsNullOrEmpty(extraProperties.Name) && extraProperties.Phone == user.PhoneNumber)
             {
-                user.Name = extraProperties.Phone == user.PhoneNumber ? extraProperties.Name : string.Empty;
+                user.Name = extraProperties.Name;
             }
         }
 
@@ -1799,10 +1801,10 @@
     private (decimal PayAmont, decimal DiscountAmount, decimal RechargeAmount) CalculateAmount(decimal amount, decimal rate)
     {
         /// 姝e父鏀粯
-        //var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero);
+        var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero);
 
         /// 1鍒嗛挶鏀粯
-        decimal payAmount = 0.01m;
+        //decimal payAmount = 0.01m;
 
         CheckExtensions.IfTrueThrowUserFriendlyException(payAmount < 0.01m, "鏀粯閲戦閿欒");
 

--
Gitblit v1.9.1