fix(swap): 修正平仓事件日期过滤条件
- 将平仓事件的日期过滤从 EventDate 改为 UnwindDate - 确保正确识别结算日期后的平仓流程 - 修复平仓事件日期比较逻辑的一致性问题
This commit is contained in:
@@ -688,7 +688,7 @@ namespace YLErp.Modules.SwapModule
|
|||||||
{
|
{
|
||||||
realPositions ??= new List<swap_position>();
|
realPositions ??= new List<swap_position>();
|
||||||
var futureFlows = (completedFlowEvents ?? Enumerable.Empty<swap_flow_event>())
|
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();
|
.ToList();
|
||||||
var originalNotional = origPositions.Where(x => x.PosiDirection > 0)
|
var originalNotional = origPositions.Where(x => x.PosiDirection > 0)
|
||||||
.Sum(x => x.PosiNotionalValue);
|
.Sum(x => x.PosiNotionalValue);
|
||||||
@@ -701,7 +701,7 @@ namespace YLErp.Modules.SwapModule
|
|||||||
.GroupBy(x => x.PositionId)
|
.GroupBy(x => x.PositionId)
|
||||||
.ToDictionary(x => x.Key, x => x.Sum(v => v.InterestPrincipal));
|
.ToDictionary(x => x.Key, x => x.Sum(v => v.InterestPrincipal));
|
||||||
var priorClosePositionIds = new HashSet<long>((completedFlowEvents ?? Enumerable.Empty<swap_flow_event>())
|
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));
|
.Select(x => x.PositionId));
|
||||||
|
|
||||||
return origPositions.Where(x => x.PosiDirection == 0).Select(p =>
|
return origPositions.Where(x => x.PosiDirection == 0).Select(p =>
|
||||||
|
|||||||
Reference in New Issue
Block a user