山证bug修复迁移

This commit is contained in:
吴方海
2024-06-21 13:45:43 +08:00
parent 7fece8679a
commit 1684bae60d
6 changed files with 55 additions and 23 deletions
@@ -157,7 +157,7 @@ namespace YLErp.Modules.CalculationModule
eodSwap.NotionalValueLong = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Long).Sum(s => s.PosiNotionalValue);
eodSwap.NotionalValueShort = positions.Where(x => x.PositionType == (int)PositionTypeFlag.Short).Sum(s => s.PosiNotionalValue);
eodSwap.NotionalValue = eodSwap.NotionalValueLong + eodSwap.NotionalValueShort;
var lastEod = db.eod_swap.Where(x => x.SwapTradeId == trade.id).OrderByDescending(o => o.ValueDate).FirstOrDefault();
var lastEod = db.eod_swap.Where(x => x.SwapTradeId == trade.id && x.ValueDate <= valuedateBLL.ValueDate).OrderByDescending(o => o.ValueDate).FirstOrDefault();
eodSwap.RealizedPnL = lastEod?.RealizedPnL ?? 0;
eodSwap.InterestPnL = lastEod?.InterestPnL ?? 0;
foreach (var item in positions)
@@ -186,7 +186,7 @@ namespace YLErp.Modules.CalculationModule
}
eodSwap.NotionalValue += pvNoPrice;
}
eodSwap.PostionValue = eodSwap.InterestPnL + eodSwap.FloatingPnL;
eodSwap.PostionValue = lastEod?.PostionValue ?? 0;
return eodSwap;
}