diff --git a/YLErpDAL/Modules/SwapModule/SwapRateService.cs b/YLErpDAL/Modules/SwapModule/SwapRateService.cs index c84a6e24..810db1c6 100644 --- a/YLErpDAL/Modules/SwapModule/SwapRateService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapRateService.cs @@ -307,6 +307,32 @@ namespace YLErp.Modules.SwapModule // swapRate.BackDeskCharge = rate * 0.0001m; //} swapRate.DiscountAccDown = reader.GetDecimal("优惠累计量下限"); + + // 处理线下费率 + var offlineRate = reader.GetString("线下费率"); + if (!string.IsNullOrEmpty(offlineRate)) + { + decimal rate = 0; + if (offlineRate.EndsWith("%")) + { + offlineRate = offlineRate.Replace("%", ""); + if (decimal.TryParse(offlineRate, out rate)) + { + rate = rate / 100; + } + } + else + { + // 如果不是百分比格式,直接尝试解析为小数 + if (!decimal.TryParse(offlineRate, out rate)) + { + // 解析失败时的处理 + rate = 0; + } + } + swapRate.OfflineRate = rate; + } + ValidateSwapRate(swapRate); swapRate.SetCreator(UserId, UserName); swapRate.SetOpt(UserId, UserName);