fix(swap): 修正平仓事件日期过滤条件

- 将平仓事件的日期过滤从 EventDate 改为 UnwindDate
- 确保正确识别结算日期后的平仓流程
- 修复平仓事件日期比较逻辑的一致性问题
This commit is contained in:
张名锐
2026-08-07 10:52:02 +08:00
parent aaeb4bddf8
commit a1cdb2cd19
@@ -688,7 +688,7 @@ namespace YLErp.Modules.SwapModule
{
realPositions ??= new List<swap_position>();
var futureFlows = (completedFlowEvents ?? Enumerable.Empty<swap_flow_event>())
.Where(x => x.EventType == (int)SwapEventTypeEnum. && x.EventDate > settleDate)
.Where(x => x.EventType == (int)SwapEventTypeEnum. && x.UnwindDate > settleDate)
.ToList();
var originalNotional = origPositions.Where(x => x.PosiDirection > 0)
.Sum(x => x.PosiNotionalValue);
@@ -701,7 +701,7 @@ namespace YLErp.Modules.SwapModule
.GroupBy(x => x.PositionId)
.ToDictionary(x => x.Key, x => x.Sum(v => v.InterestPrincipal));
var priorClosePositionIds = new HashSet<long>((completedFlowEvents ?? Enumerable.Empty<swap_flow_event>())
.Where(x => x.EventType == (int)SwapEventTypeEnum. && x.EventDate <= settleDate)
.Where(x => x.EventType == (int)SwapEventTypeEnum. && x.UnwindDate <= settleDate)
.Select(x => x.PositionId));
return origPositions.Where(x => x.PosiDirection == 0).Select(p =>