#TRS-ZS-58 收盘操作:删除从衡泰获取数据等等功能
This commit is contained in:
@@ -757,21 +757,6 @@ namespace YLErp.Modules.SwapModule
|
||||
td.StockEqvNotional -= Convert.ToDouble(unwindData.CloseNotionalValue);
|
||||
td.TradeAmount -= Convert.ToDouble(unwindData.CloseQty);
|
||||
DbContext.SaveChanges();
|
||||
new PushLogService(UserInfo).AddLog(eventId, SwapPushDataEnum.合约终止, td.TradeNumber);
|
||||
var positions = DbContext.swap_position.Where(x => x.IsInitial && x.SwapTradeId == unwindData.SwapTradeId && !x.Invalid);
|
||||
foreach (var f in flowList)
|
||||
{
|
||||
var position = positions.FirstOrDefault(x => x.id == f.PositionId);
|
||||
if (f.PositionType > 0)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换资产平仓, position.PosiNumber);
|
||||
}
|
||||
else if (f.InterestMode == (int)InterestModeEnum.初始预付金 || f.InterestMode == (int)InterestModeEnum.追加预付金)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换预付金平仓, position.PosiNumber);
|
||||
}
|
||||
|
||||
}
|
||||
trans.Commit();
|
||||
cofirm = true;
|
||||
}
|
||||
@@ -1058,27 +1043,6 @@ namespace YLErp.Modules.SwapModule
|
||||
td.TradeAmount -= Convert.ToDouble(unwindData.CloseQty);
|
||||
td.Notional = td.TradeAmount;
|
||||
DbContext.SaveChanges();
|
||||
if (addLog)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(eventId, SwapPushDataEnum.合约终止, td.TradeNumber);
|
||||
var positions = DbContext.swap_position.Where(x => x.IsInitial && x.SwapTradeId == unwindData.SwapTradeId && !x.Invalid);
|
||||
foreach (var f in flowList)
|
||||
{
|
||||
var position = positions.FirstOrDefault(x => x.id == f.PositionId);
|
||||
if (position != null)
|
||||
{
|
||||
if (f.PositionType > 0)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换资产平仓, position.PosiNumber);
|
||||
}
|
||||
else if (f.InterestMode == (int)InterestModeEnum.初始预付金 || f.InterestMode == (int)InterestModeEnum.追加预付金)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换预付金平仓, position.PosiNumber);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 计算平仓总额
|
||||
@@ -1281,21 +1245,7 @@ namespace YLErp.Modules.SwapModule
|
||||
td.TradeAmount -= Convert.ToDouble(swapEvent.unwindData.CloseQty);
|
||||
}
|
||||
td.StockEqvNotional -= Convert.ToDouble(swapEvent.unwindData.CloseNotionalValue);
|
||||
new PushLogService(UserInfo).AddLog(swapEvent.id, SwapPushDataEnum.合约终止, td.TradeNumber);
|
||||
var positions = DbContext.swap_position.Where(x => x.IsInitial && x.SwapTradeId == td.id && !x.Invalid);
|
||||
foreach (var f in flowList)
|
||||
{
|
||||
var position = positions.FirstOrDefault(x => x.id == f.PositionId);
|
||||
if (f.PositionType > 0)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换资产平仓, position.PosiNumber);
|
||||
}
|
||||
else if (f.InterestMode == (int)InterestModeEnum.初始预付金 || f.InterestMode == (int)InterestModeEnum.追加预付金)
|
||||
{
|
||||
new PushLogService(UserInfo).AddLog(f.id, SwapPushDataEnum.互换预付金平仓, position.PosiNumber);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
td.UnWindDate = swapEvent.unwindData.UnwindDate;
|
||||
UpdateInitalPosition(flowList, swapEvent.unwindData, eventType);
|
||||
|
||||
Reference in New Issue
Block a user