From 03ee9cca261ad498630ead93954af9c47ed942e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Tue, 4 Aug 2026 13:12:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(settlement):=20=E4=BF=AE=E5=A4=8D=E9=A2=84?= =?UTF-8?q?=E4=BB=98=E9=87=91=E8=AE=A1=E7=AE=97=E4=B8=AD=E7=9A=84=E7=B2=BE?= =?UTF-8?q?=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 对保证金比率进行四舍五入到小数点后两位处理 - 将硬编码的保证金最大比率计算改为基于调整后的保证金比率 - 修复可取预付金计算中的类型转换问题 - 确保计算过程中数值精度的一致性 - 移除多余的文件末尾大括号以符合代码规范 --- .../EodModule/SettlementModule/EodClientBalanceCalc.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs b/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs index afe7d581..927b2157 100644 --- a/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs +++ b/YLErpDAL/Modules/EodModule/SettlementModule/EodClientBalanceCalc.cs @@ -42,8 +42,8 @@ namespace YLErp.Modules.EodModule.SettlementModule var currencyProvider = _context.EodCurrencyProvider; List marginTypes = new List() { (int)InterestModeEnum.追加预付金, (int)InterestModeEnum.初始预付金 }; //预付金可取上浮比率 - var marginRatio = _context.SystemValue.MarginRatio ?? 0.15; - var marginMaxRatio = marginRatio + 0.02; + var marginRatio = Math.Round((decimal)(_context.SystemValue.MarginRatio ?? 0.15), 2, MidpointRounding.AwayFromZero); + var marginMaxRatio = marginRatio + 0.02m; var preBalanceDate = _context.PreSettleDate; var preClientbalancedailys = DbContext.ClientBalanceDaily.Where(t => t.BalanceDate == preBalanceDate).ToList(); if (reqClientIds != null && reqClientIds.Any()) @@ -946,7 +946,7 @@ namespace YLErp.Modules.EodModule.SettlementModule } } //可取预付金为预付金余额 - 应缴预付金(上浮2%) 20220207新增减去互换预付金容忍额 - AdvisableMargin = Math.Max(MarginBalance + (PayableMargin - SwapUnPayableMargin) * marginMaxRatio / marginRatio, 0); + AdvisableMargin = Math.Max(MarginBalance + (PayableMargin - SwapUnPayableMargin) * (double)(marginMaxRatio / marginRatio), 0); //计算追保金额 维持预付金带方向 所以计算追保金额是 为相加 var IsTradeCredit = (client.IsTradeCredit ?? 0) == 1; @@ -1378,4 +1378,4 @@ namespace YLErp.Modules.EodModule.SettlementModule } } } -} \ No newline at end of file +}