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,