资金监控改成字节流导出

This commit is contained in:
吴方海
2025-06-03 13:25:44 +08:00
parent ee3321bc36
commit 1cc195cb78
4 changed files with 35 additions and 12 deletions
@@ -611,11 +611,13 @@ namespace YLErp.Modules.EodModule.SettlementModule
{
CurrChangeAmount += clientEntryexit.Money ?? 0.0;
SwapBalance += clientEntryexit.Money ?? 0.0;
WinLoss += clientEntryexit.Money ?? 0.0;
}
else if (ClientCashInCashOut._互换.Equals(clientEntryexit.Action))
{
CurrChangeAmount += clientEntryexit.Money ?? 0.0;
SwapBalance += clientEntryexit.Money ?? 0.0;
WinLoss += clientEntryexit.Money ?? 0.0;
}
if (ClientCashInCashOut..Equals(clientEntryexit.State))
@@ -804,11 +806,6 @@ namespace YLErp.Modules.EodModule.SettlementModule
var todaySwapFinishedTradeIds = todaySwapFinishedTrades.Select(s => s.id).ToList();
var todaySwapFinishedCash = clientEntryexits_swap.Where(x => todaySwapFinishedTradeIds.Contains(x.TradeId ?? 0)).ToList();
var list = todayFinishedTradeCash.ToList();
WinLoss = todayFinishedTrades.ToArray().Sum(t =>
t.TradeType != "远期" ?
-TradeCalcHelper.GetSign(t.BuySell) * (t.TradePrice ?? 0) * finishedTradeNotionalPercentDic[t.id] + (todayFinishedTradeCash.FirstOrDefault(x => x.tradeId == t.id)?.amountSum ?? 0)
// 远期客户角度的实现盈亏 = 开仓总费用+平仓总费用
: (t.TradePrice ?? 0) * finishedTradeNotionalPercentDic[t.id] + (todayFinishedTradeCash.FirstOrDefault(x => x.tradeId == t.id)?.amountSum ?? 0)) * -1;
//了结开仓费用
EndPremium = todayFinishedTrades.Sum(t => t.TradeType != "远期" ? -TradeCalcHelper.GetSign(t.BuySell) * (t.TradePrice ?? 0) * finishedTradeNotionalPercentDic[t.id] : (t.TradePrice ?? 0) * finishedTradeNotionalPercentDic[t.id]) * -1;
EndPremium = EndPremium + todaySwapFinishedCash.Sum(s => s.Money ?? 0);
@@ -850,7 +847,7 @@ namespace YLErp.Modules.EodModule.SettlementModule
var lastEodSwapPosition = eodSwapPosis.FirstOrDefault(t => t.SwapTradeId == item.SwapTradeId && t.ValueDate == preBalanceDate&&t.PosiStartDate<= preBalanceDate);
var eodSwapPosition = clientEodSwapPositionLast.FirstOrDefault(t => t.SwapTradeId == item.SwapTradeId && t.ValueDate == balanceDate && t.PosiStartDate <= balanceDate);
PotentialSurpluses += Convert.ToDouble(item.PostionValue) * (-1);
WinLoss += Convert.ToDouble(item.TdRealizedPnL) * (-1);
// WinLoss += Convert.ToDouble(item.TdRealizedPnL) * (-1);
var lastPv = lastEodSwap != null ? Convert.ToDouble(lastEodSwap.PostionValue- lastEodSwapPosition?.VTradingFee+lastEodSwapPosition?.PosiFeePending) * (-1) : 0;
eodPnlSum.LastPvSum = eodPnlSum.LastPvSum.HasValue ? eodPnlSum.LastPvSum + lastPv : lastPv;
var pnl = item.PostionValue- eodSwapPosition?.VTradingFee+ eodSwapPosition?.PosiFeePending;