#EQD-6947 国联民生-保证金计算整体改造-实现第一版盯市规则(不支持同一客户多部门)(1)保证金规则的设置 阶段3

This commit is contained in:
锦麟 王
2026-08-20 14:20:29 +08:00
parent 2e58ca2498
commit febd0ce02e
19 changed files with 1378 additions and 772 deletions
@@ -1658,6 +1658,19 @@ namespace YLErp.Modules.SwapModule
}
}
}
// 合约维度盯市+无预付金腿:重建交易级(positionId=0)初始预付金记录(与 SwapTradeConfirm 一致,回退重补场景)。
// 有预付金腿的互换由上面 foreach 按腿重建,不在此重复生成。
var resetWatchClient = DataCacheProvider.GetClientDataSource().GetData(td.ClientId);
var hasPrepayLeg = swapPositions != null && swapPositions.Any(x => x.InterestMode == (int)InterestModeEnum. || x.InterestMode == (int)InterestModeEnum.);
if (resetWatchClient != null && resetWatchClient.MarginWatchRule == 0 && !hasPrepayLeg)
{
var cashSvc = new ClientCashInCashOutService(this);
var initMargin = cashSvc.GetInitialMarginAmount(td);
if (initMargin > 0)
{
cashSvc.SaveSwapTradeClientCash(td, initMargin, happenDate, 0, ClientCashInCashOut._应付预付金);
}
}
}
/// <summary>
/// 获取持仓腿信息