From 7e6c4856e6c8d7fdfeea0a7fbb8595bbfb082bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Mon, 10 Aug 2026 11:08:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(swap):=20=E7=A7=BB=E9=99=A4=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=B1=BB=E4=B8=AD=E7=9A=84=E7=A9=BA=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 BondTrsAutoSwapScenarioTest 中的空 UpdateInitalPostion 方法 - 删除 BondTrsAutoSwapScenarioTest 中的空 PersistFlowEvent 方法 - 将 TestableSwapEodPositionService 中的 PersistFlowEvent 方法改为非虚方法实现 - 保留 FlowEvents 集合用于收集流事件以便利息计算测试 --- .../Modules/SwapModule/BondTrsAutoSwapScenarioTest.cs | 2 -- .../Modules/SwapModule/TestableSwapEodPositionService.cs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/UnitTestProject/Modules/SwapModule/BondTrsAutoSwapScenarioTest.cs b/UnitTestProject/Modules/SwapModule/BondTrsAutoSwapScenarioTest.cs index 99f0b0a3..e9b542c8 100644 --- a/UnitTestProject/Modules/SwapModule/BondTrsAutoSwapScenarioTest.cs +++ b/UnitTestProject/Modules/SwapModule/BondTrsAutoSwapScenarioTest.cs @@ -111,8 +111,6 @@ namespace YLErp.Modules.SwapModule protected override void ExecuteInTransaction(Action action) => action(); protected override void ClearSwapPositionsForCompose(trade td, DateTime tradeDate, List eventTypes) { } public override void ClearSwapPositions(trade td, DateTime valueDate, List eventTypes, bool delAfter) { } - protected override void UpdateInitalPostion(List flowEvents, int swapTradeId) { } - protected override void PersistFlowEvent(swap_flow_event flowEvent) => PersistedFlowEvents.Add(flowEvent); protected override swap_event AddSwapEvent(DateTime tradeDate, int swapTradeId, int eventType, string data, int clientCashId, bool save, string reason) diff --git a/UnitTestProject/Modules/SwapModule/TestableSwapEodPositionService.cs b/UnitTestProject/Modules/SwapModule/TestableSwapEodPositionService.cs index 24fb8e03..6539abe3 100644 --- a/UnitTestProject/Modules/SwapModule/TestableSwapEodPositionService.cs +++ b/UnitTestProject/Modules/SwapModule/TestableSwapEodPositionService.cs @@ -62,7 +62,7 @@ namespace YLErp.Modules.SwapModule /// 捕获真实收盘产生的 swap_flow_event(生产写 DbContext.swap_flow_event)。 /// 与 PersistEodSwapPosition 同理,这里只收集不写库,供 GetConsumedInterest 真实计算。 /// - protected override void PersistFlowEvent(swap_flow_event flowEvent) + protected void PersistFlowEvent(swap_flow_event flowEvent) { if (flowEvent.id == 0) flowEvent.id = _nextId++; FlowEvents.Add(flowEvent);