diff --git a/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs b/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs index 76e98cf8..f74110c6 100644 --- a/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs +++ b/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs @@ -4,6 +4,7 @@ using YLErp.Abstract; using YLErp.Configuration; using YLErp.DBModels; using YLErp.DBModels.Abstract; +using YLErp.DBModels.Consts; using YLErp.Models; namespace YLErp.Plugins.TradeDocGenerator.Abstracts @@ -78,7 +79,7 @@ namespace YLErp.Plugins.TradeDocGenerator.Abstracts string Gettrade_contract_r(); string Gettrade_contract_r(string type); - string Gettrade_contract_r(int tradeId,string type); + string Gettrade_contract_r(int tradeId, string type); string Gettrade_contract_r(string type, int tradeCashId); @@ -258,10 +259,10 @@ namespace YLErp.Plugins.TradeDocGenerator.Abstracts /// /// /// - string GenerateWCZDChildrenContractNo(int tId,int tcId); + string GenerateWCZDChildrenContractNo(int tId, int tcId); - string GetWCZDConfirmNumber(int tId, int tcId,string type); + string GetWCZDConfirmNumber(int tId, int tcId, string type); /// /// 获取交易关联的协议信息 /// @@ -431,15 +432,17 @@ namespace YLErp.Plugins.TradeDocGenerator.Abstracts List GetSwapEvents(int tradeId); - List GetSwapPositions(int tradeId,bool? IsInitial); + List GetSwapPositions(int tradeId, bool? IsInitial); List GetSwapPositions(List tradeId, bool? IsInitial); List GetClientDuties(); + List GetContractTypes(); + client_marginrate GetClientMarginRate(int clientId); - int GetDMASelttementCount(int clientId,DateTime valueDate); + int GetDMASelttementCount(int clientId, DateTime valueDate); List GetSwapFlows(int tradeId); List GetUnderlyings(List underlyingCodes); @@ -451,14 +454,14 @@ namespace YLErp.Plugins.TradeDocGenerator.Abstracts /// /// /// - List GetFlowEvents(int tradeId,List eventTypes); + List GetFlowEvents(int tradeId, List eventTypes); /// /// 获取日终估值 /// /// /// /// - List GetEodPositions(int tradeId,DateTime valueDate); + List GetEodPositions(int tradeId, DateTime valueDate); /// /// 获取定义文件类型流水拆分明细 /// diff --git a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs index 5edf5907..c0cd3c47 100644 --- a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs +++ b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs @@ -393,13 +393,12 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator ? ((double)swapPosition.PosiQuantity).ToString("N2") : "0.00"; dic["参考标的基金管理人"] = ""; - + var contractTypeId = (Context.GetContractTypes().FirstOrDefault(O => O.ContactType == "交易确认书接收")?.id) ?? 0; // 乙方联系人信息 - var clientDuties = Context.GetClientDuties(); - var contact = clientDuties.FirstOrDefault(); - dic["联系人"] = contact?.ContactName ?? ""; - dic["电子邮件"] = contact?.Email ?? ""; - dic["电话"] = contact?.PhoneNumber ?? ""; + var clientDuties = Context.GetClientDuties().Where(O => O.ContactTypeIdsInt.Contains(contractTypeId)).ToList(); + dic["联系人"] = string.Join(",", clientDuties.Select(O => O.ContactName)).Trim(','); + dic["电子邮件"] = string.Join(";", clientDuties.Select(O => O.Email)).Trim(';'); + dic["电话"] = string.Join(";", clientDuties.Select(O => O.PhoneNumber)).Trim(';'); // 表格数据示例 var table1 = new JArray(); diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index deb84211..848e42d2 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -854,7 +854,7 @@ namespace YLErp.Modules.SwapModule newEodPayPosition.FloatRateUnderlyingCode = position.FloatRateUnderlyingCode; newEodPayPosition.InterestFeePending = 0; //利息端估值用信息 - eodPayPosition.TdInterestPrincipal = interestModes.Contains(position.InterestMode) ? eodPayPosition.InterestPrincipalFix : posiNotionalValue; + newEodPayPosition.TdInterestPrincipal = interestModes.Contains(position.InterestMode) ? eodPayPosition.InterestPrincipalFix : posiNotionalValue; newEodPayPosition.TdInterestRate = interval.Rate; //当日已实现 //newEodPayPosition.TdInterestFee = 0; diff --git a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs index fbc8eb50..7894e15b 100644 --- a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs +++ b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs @@ -970,6 +970,12 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule return result; } + public List GetContractTypes() + { + var result = DbContextFactory.GetClientDbContext(OptUser).contactype.ToList(); + return result; + } + /// /// 获取工作日天数 /// @@ -1310,7 +1316,7 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule join t in DbContext.trade on r.TradeId equals t.id where r.Type == ContractTypeEnum.Trade && r.ContractCode.StartsWith(prefix) select r; - var codeList = query.Select(s=>s.ContractCode).ToList(); + var codeList = query.Select(s => s.ContractCode).ToList(); var count = codeList.Count; do { @@ -1336,7 +1342,7 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule var posi = GetSwapPositions(Trade.id, true).FirstOrDefault(p => p.PositionType > 0); var isLong = posi?.PositionType == (int)PositionTypeFlag.Short ? false : true; - return "GLMS-" + _client.Number + "-" + Trade.TradeDate?.ToString("yyyyMMdd") + (isLong ? "-L" : "-S"); + return "GLMS-" + _client.Number + "-" + Trade.TradeDate?.ToString("yyyyMMdd") + (isLong ? "-L" : "-S"); } return Trade.TradeNumber; } @@ -2788,12 +2794,12 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule return DbContext.swap_event.Where(x => x.SwapTradeId == tradeId && x.Invalid == true).ToList(); } - public List GetSwapPositions(int tradeId,bool? IsInitial) + public List GetSwapPositions(int tradeId, bool? IsInitial) { - var query = DbContext.swap_position.Where(x => x.SwapTradeId == tradeId&&!x.Invalid); + var query = DbContext.swap_position.Where(x => x.SwapTradeId == tradeId && !x.Invalid); if (IsInitial.HasValue) { - query = query.Where(x=>x.IsInitial== IsInitial); + query = query.Where(x => x.IsInitial == IsInitial); } return query.ToList(); } @@ -2842,9 +2848,9 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule return query.Distinct().Count(); } - public List GetSwapFlows(int tradeId) + public List GetSwapFlows(int tradeId) { - return DbContext.swap_flow.Where(x=>x.SwapTradeId==tradeId&&x.DataState==(int)SwapFlowDateStateEnum.完成).AsNoTracking().ToList(); + return DbContext.swap_flow.Where(x => x.SwapTradeId == tradeId && x.DataState == (int)SwapFlowDateStateEnum.完成).AsNoTracking().ToList(); } public List GetUnderlyings(List underlyingCodes) @@ -2857,16 +2863,16 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule } public List GetFlowEvents(int tradeId, List eventTypes) { - return DbContext.swap_flow_event.Where(x => eventTypes.Contains(x.EventType)&&x.SwapTradeId==tradeId&&x.DataState==(int)SwapFlowDateStateEnum.完成).AsNoTracking().ToList(); + return DbContext.swap_flow_event.Where(x => eventTypes.Contains(x.EventType) && x.SwapTradeId == tradeId && x.DataState == (int)SwapFlowDateStateEnum.完成).AsNoTracking().ToList(); } public List GetEodPositions(int tradeId, DateTime valueDate) { - return DbContext.eod_swap_position.Where(x=> x.SwapTradeId==tradeId && !x.Invalid&&x.ValueDate==valueDate).AsNoTracking().ToList(); + return DbContext.eod_swap_position.Where(x => x.SwapTradeId == tradeId && !x.Invalid && x.ValueDate == valueDate).AsNoTracking().ToList(); } public List GetSwapFlowDeals(int tradeId) { - return DbContext.swap_flow_deal.Where(x => x.SwapTradeId == tradeId).AsNoTracking().ToList(); + return DbContext.swap_flow_deal.Where(x => x.SwapTradeId == tradeId).AsNoTracking().ToList(); } public swap_event GetEvent(long eventId) diff --git a/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml b/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml index 00b0d748..6a395497 100644 --- a/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml +++ b/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml @@ -515,7 +515,7 @@
交易日历