From 69526bc960b4ceb8105e6da3a1bed991bd57caec Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 22 Jan 2026 17:04:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(swap):=20=E4=BF=AE=E6=AD=A3=E6=B1=87?= =?UTF-8?q?=E7=8E=87=E8=BD=AC=E6=8D=A2=E4=B8=AD=E7=9A=84=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94=E6=A0=87=E8=AF=86=E5=92=8C=E8=A7=A3=E6=9E=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 TempRateIsPercent、BaseRateIsPercent 和 DiscountRateIsPercent 设置为 true - 使用复合赋值运算符优化百分比计算 - 添加线下费率解析失败时的日志记录 --- YLErpDAL/Modules/SwapModule/SwapRateService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapRateService.cs b/YLErpDAL/Modules/SwapModule/SwapRateService.cs index 810db1c6..518644e6 100644 --- a/YLErpDAL/Modules/SwapModule/SwapRateService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapRateService.cs @@ -242,7 +242,7 @@ namespace YLErp.Modules.SwapModule } else { - swapRate.TempRateIsPercent = false; + swapRate.TempRateIsPercent = true; decimal.TryParse(tempRate, out rate); } swapRate.TempRate = rate; @@ -260,7 +260,7 @@ namespace YLErp.Modules.SwapModule } else { - swapRate.BaseRateIsPercent = false; + swapRate.BaseRateIsPercent = true; decimal.TryParse(baseRate, out rate); } swapRate.BaseRate = rate; @@ -278,7 +278,7 @@ namespace YLErp.Modules.SwapModule } else { - swapRate.DiscountRateIsPercent = false; + swapRate.DiscountRateIsPercent = true; decimal.TryParse(disAccRate, out rate); } swapRate.DiscountRate = rate; @@ -318,7 +318,7 @@ namespace YLErp.Modules.SwapModule offlineRate = offlineRate.Replace("%", ""); if (decimal.TryParse(offlineRate, out rate)) { - rate = rate / 100; + rate /= 100; } } else @@ -327,6 +327,7 @@ namespace YLErp.Modules.SwapModule if (!decimal.TryParse(offlineRate, out rate)) { // 解析失败时的处理 + LogFactory.GetLogger("导入阶梯费率").Error($"第{rowIndex}行,线下费率解析失败:{offlineRate}"); rate = 0; } }