From 4cd368715cefb492ec9aec3a9bc58c2d74815152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E9=BA=9F=20=E7=8E=8B?= Date: Fri, 28 Aug 2026 13:34:10 +0800 Subject: [PATCH] =?UTF-8?q?#EQD-7215=20=E8=BF=BD=E5=8A=A0=E9=A2=84?= =?UTF-8?q?=E4=BB=98=E9=87=91=E8=85=BF=EF=BC=9A=E5=8F=91=E7=94=9F=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=94=99=E8=AF=AF=E5=B9=B6=E4=B8=94=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E4=BC=BC=E4=B9=8E=E4=B9=9F=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Margin/SwapAdditionalMarginService.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs b/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs index 84be8991..94e1effc 100644 --- a/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs +++ b/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs @@ -131,6 +131,21 @@ namespace YLErp.Modules.SwapModule.Margin return; } + //开始日门槛:未到交易开始日(未起息)的不参与追保——维持保证金引擎从成交日就产出 trade_span, + //初始预付金流水却到开始日才入账,不过滤会在 成交日~开始日 之间把未到期的初始预付金 + //误判成缺口、按维持全额追加(2026-08-28 交易2571实证:07-31成交/08-03起息,重刷07-31误追500000) + var notStartedTrades = trades.Where(t => (t.StartDate ?? t.TradeDate) > settleDate).ToList(); + if (notStartedTrades.Count > 0) + { + logger.Info($"EOD追保:{notStartedTrades.Count}笔交易未到开始日(id=[{string.Join(",", notStartedTrades.Select(t => t.id))}]),不参与追保结算"); + trades = trades.Except(notStartedTrades).ToList(); + if (trades.Count == 0) + { + logger.Info($"EOD追保:结算日{settleDate:yyyy-MM-dd} 交易均未到开始日,结束"); + return; + } + } + //规则15(区间追保结构)交易:R1 三层级解析(BUG-02 修正,与引擎/确认书同口径)—— //交易绑定→客户默认→全局默认 找到即停,只配客户/全局默认模板的交易同样纳入追保结算 var candidateCount = trades.Count;