diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs
index 1d685a0c..406ab09a 100644
--- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs
+++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs
@@ -135,6 +135,24 @@ namespace YLErp.Modules.SwapModule
}
}
+ /// 添加资金记录(生产: AddClientCashInCashOut;测试: 收集到计数器)
+ protected virtual int AddClientCash(trade td, double amount, string action, DateTime valueDate)
+ {
+ return AddClientCashInCashOut(td, amount, action, valueDate);
+ }
+
+ /// 保存框架合约日终汇总(生产: SaveEodSwap私有方法;测试: 收集到列表)
+ protected virtual void SaveEodSwapRecord(trade td, DateTime settleDate, DateTime preSettleDate)
+ {
+ SaveEodSwap(td, settleDate, preSettleDate);
+ }
+
+ /// 清理旧持仓事件(生产: ClearSwapPositions;测试: 空操作)
+ protected virtual void ClearSwapPositionsForCompose(trade td, DateTime tradeDate, List eventTypes)
+ {
+ ClearSwapPositions(td, tradeDate, eventTypes, false);
+ }
+
#endregion
///
@@ -708,7 +726,7 @@ namespace YLErp.Modules.SwapModule
var preSettleDate = GetPreValueDate(tradeDate);//上一交易日期
List eventTyps = new List() { (int)SwapEventTypeEnum.平仓, (int)SwapEventTypeEnum.互换, (int)SwapEventTypeEnum.自动互换 };
List removeEventTyps = new List() { (int)SwapEventTypeEnum.平仓, (int)SwapEventTypeEnum.互换, (int)SwapEventTypeEnum.自动互换 };
- ClearSwapPositions(td, tradeDate, removeEventTyps, false);
+ ClearSwapPositionsForCompose(td, tradeDate, removeEventTyps);
td.trade_extend = FindTradeExtend(swapTradeId);
var allEodPositions = FindEodSwapPositions(swapTradeId, preSettleDate);
var eodPositions = allEodPositions.Where(x => x.ValueDate == preSettleDate).ToList();//上一日终持仓信息
@@ -789,7 +807,7 @@ namespace YLErp.Modules.SwapModule
//记录资金记录
if (amount != 0)
{
- int clientCashId = AddClientCashInCashOut(td, Convert.ToDouble(x.MarkClosePnl), ClientCashInCashOut.系统操作_平仓费, x.UnwindDate.Value);
+ int clientCashId = AddClientCash(td, Convert.ToDouble(x.MarkClosePnl), ClientCashInCashOut.系统操作_平仓费, x.UnwindDate.Value);
x.ClientCashId = clientCashId;
}
payQty = payQty - x.Quantity;
@@ -847,7 +865,7 @@ namespace YLErp.Modules.SwapModule
unwindData.CloseNotionalValue = tdCloseNotionalValue;
swapEvent.EventData = JsonHelper.Serialize(unwindData);
SaveAllChanges();
- SaveEodSwap(td, tradeDate, preSettleDate);
+ SaveEodSwapRecord(td, tradeDate, preSettleDate);
SaveAllChanges();
trans?.Commit();
}