删除定义文件类型,删除所有判断山西固收的地方
This commit is contained in:
@@ -57,9 +57,6 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
|
||||
statusList.Add(ConsTrade.已到期);
|
||||
statusList.Add(ConsTrade.已平仓);
|
||||
statusList.Add(ConsTrade.已执行);
|
||||
}
|
||||
if (PS.Config.Is山西固收)
|
||||
{
|
||||
statusList.Add(ConsTrade.审批中);
|
||||
}
|
||||
TradeDalService service = new TradeDalService(this);
|
||||
@@ -75,47 +72,17 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
|
||||
//----------------------------------
|
||||
// 交易现金交割记录
|
||||
//----------------------------------
|
||||
List<trade> allTradeList = new List<trade>();
|
||||
if (PS.Config.Is山西固收)
|
||||
{
|
||||
allTradeList = DbContext.trade.Where(x=> tradeIds.Contains(x.id)).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
allTradeList = service.GetTradeOrEodTradeOfTidASid(tradeIds, SystemValueDate);
|
||||
}
|
||||
List<trade> allTradeList = allTradeList = DbContext.trade.Where(x => tradeIds.Contains(x.id)).ToList();
|
||||
if (allTradeList.Count < 1)
|
||||
{
|
||||
throw new ServiceException("没有已确认的记录信息!");
|
||||
}
|
||||
//只选中一笔子交易,按一笔子交易生成确认书
|
||||
if (PS.Config.Is光大光子 || PS.Config.Is兴业商贸)
|
||||
{
|
||||
allTradeList.RemoveAll(x => x.ParentTradeId != 0 && !tradeIds.Contains(x.id));
|
||||
}
|
||||
|
||||
var tradeDic = allTradeList.Where(O =>
|
||||
statusList.Contains(O.TradeStatus)
|
||||
&& O.ClientId != 0
|
||||
&& O.ParentTradeId == 0)
|
||||
.ToDictionary(n => n.id, n => new trade_contract_group { trade = n });
|
||||
if (PS.Config.Is长江)
|
||||
{
|
||||
foreach (var item in allTradeList)
|
||||
{
|
||||
if (item.ParentTradeId != 0)
|
||||
{
|
||||
if (item.StructureType != "牛市价差" && item.StructureType != "熊市价差")
|
||||
{
|
||||
if (tradeDic.ContainsKey(item.ParentTradeId))
|
||||
{
|
||||
tradeDic.Remove(item.ParentTradeId);
|
||||
}
|
||||
tradeDic.Add(item.id, new trade_contract_group { trade = item });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var cashQuery = from trade in allTradeList
|
||||
join tradeCash in DbContext.trade_cash on trade.id equals tradeCash.TradeId
|
||||
where tradeCash.ValidState != ConsGlobal.InValid && !tradeCash.IsDeleted
|
||||
|
||||
+4
-24
@@ -68,7 +68,6 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
|
||||
var resultList = new List<TradeDocGenerateResult>();
|
||||
AppManager.TryResolve(out ITradeSettleBillGenerator generatorV2);
|
||||
Dictionary<int, List<swap_flow_event>> noDMAFlows = new Dictionary<int, List<swap_flow_event>>();
|
||||
Dictionary<int, List<swap_flow_event>> DMAFlows = new Dictionary<int, List<swap_flow_event>>();
|
||||
List<trade_extend> extendList = null;
|
||||
if (flowEvents != null && flowEvents.Any())
|
||||
{
|
||||
@@ -105,33 +104,19 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
|
||||
}
|
||||
if (trade.ValidState!=ConsGlobal.InValid)
|
||||
{
|
||||
if (trade.StructureType == "多空组合"||trade.StructureType== "定义文件型债券收益互换")
|
||||
if (noDMAFlows.ContainsKey(trade.ClientId))
|
||||
{
|
||||
if (DMAFlows.ContainsKey(trade.ClientId))
|
||||
{
|
||||
DMAFlows[trade.ClientId].Add(flowEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
DMAFlows[trade.ClientId] = new List<swap_flow_event> { flowEvent };
|
||||
}
|
||||
noDMAFlows[trade.ClientId].Add(flowEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (noDMAFlows.ContainsKey(trade.ClientId))
|
||||
{
|
||||
noDMAFlows[trade.ClientId].Add(flowEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
noDMAFlows[trade.ClientId] = new List<swap_flow_event> { flowEvent };
|
||||
}
|
||||
noDMAFlows[trade.ClientId] = new List<swap_flow_event> { flowEvent };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (noDMAFlows.Count()==0&& DMAFlows.Count()==0)
|
||||
if (noDMAFlows.Count()==0)
|
||||
{
|
||||
throw new ServiceException("没有需要生成的确认书");
|
||||
}
|
||||
@@ -140,11 +125,6 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
|
||||
var noDMAResults = GenerateShanxiSwap(item.Key, item.Value, trades, swapPositions, allFlowEvents, generatorV2, docType);
|
||||
resultList.AddRange(noDMAResults);
|
||||
}
|
||||
foreach (var item in DMAFlows)
|
||||
{
|
||||
var DMAResults = GenerateShanxiSwap(item.Key, item.Value, trades, swapPositions, allFlowEvents, generatorV2, docType);
|
||||
resultList.AddRange(DMAResults);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user