From 35d68acc02f14e61574e6ef2871cbf0b390147fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E9=BA=9F=20=E7=8E=8B?= Date: Thu, 27 Aug 2026 18:40:46 +0800 Subject: [PATCH] =?UTF-8?q?BugFix=20=E8=85=BF=E5=8A=A0=E4=B8=8A=E5=B8=81?= =?UTF-8?q?=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SwapModule/Margin/SwapAdditionalMarginLegTest.cs | 6 ++++++ .../SwapModule/Margin/SwapAdditionalMarginService.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UnitTestProject/Modules/SwapModule/Margin/SwapAdditionalMarginLegTest.cs b/UnitTestProject/Modules/SwapModule/Margin/SwapAdditionalMarginLegTest.cs index 60de9711..0c091bd1 100644 --- a/UnitTestProject/Modules/SwapModule/Margin/SwapAdditionalMarginLegTest.cs +++ b/UnitTestProject/Modules/SwapModule/Margin/SwapAdditionalMarginLegTest.cs @@ -54,6 +54,12 @@ namespace YLErp.Modules.SwapModule //两位 AwayFromZero 舍入 var rounded = SwapAdditionalMarginService.BuildEodMarginLeg(td, 1000.005, SettleDate, optId: 0); Assert.AreEqual(1000.01m, rounded.InterestPrincipalFix); + + //币种:取交易结算币种;交易未设置时回退系统默认 CNY(与存量手工腿口径一致,2026-08-27 修复空币种) + Assert.AreEqual("CNY", leg.Currency); + td.SettlementCurrency = null; + Assert.AreEqual(ConsGlobal.Currency.CNY, + SwapAdditionalMarginService.BuildEodMarginLeg(td, 100, SettleDate, optId: 0).Currency); } /// diff --git a/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs b/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs index 95bf5f32..02b31082 100644 --- a/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs +++ b/YLErpDAL/Modules/SwapModule/Margin/SwapAdditionalMarginService.cs @@ -69,7 +69,7 @@ namespace YLErp.Modules.SwapModule.Margin HappenDate = settleDate, PosiStartDate = td.StartDate ?? settleDate, PosiMatuirityDate = td.ExerciseDate, - Currency = td.SettlementCurrency, + Currency = td.SettlementCurrency ?? ConsGlobal.Currency.CNY, FundTag = null, OptId = optId, OptName = EodOptName,