Merge branch 'glms/feature/1.4.2' of http://git.yiliantech.com/gitlab/otc-dev/zszq-trs into glms/feature/1.4.2

This commit is contained in:
锦麟 王
2026-05-19 10:01:06 +08:00
5 changed files with 33 additions and 25 deletions
@@ -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
/// </summary>
/// <param name="tcId"></param>
/// <returns></returns>
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);
/// <summary>
/// 获取交易关联的协议信息
/// </summary>
@@ -431,15 +432,17 @@ namespace YLErp.Plugins.TradeDocGenerator.Abstracts
List<swap_event> GetSwapEvents(int tradeId);
List<swap_position> GetSwapPositions(int tradeId,bool? IsInitial);
List<swap_position> GetSwapPositions(int tradeId, bool? IsInitial);
List<swap_position> GetSwapPositions(List<int> tradeId, bool? IsInitial);
List<ClientDuty> GetClientDuties();
List<contactype> GetContractTypes();
client_marginrate GetClientMarginRate(int clientId);
int GetDMASelttementCount(int clientId,DateTime valueDate);
int GetDMASelttementCount(int clientId, DateTime valueDate);
List<swap_flow> GetSwapFlows(int tradeId);
List<underlying_manager> GetUnderlyings(List<string> underlyingCodes);
@@ -451,14 +454,14 @@ namespace YLErp.Plugins.TradeDocGenerator.Abstracts
/// <param name="tradeId"></param>
/// <param name="eventType"></param>
/// <returns></returns>
List<swap_flow_event> GetFlowEvents(int tradeId,List<int> eventTypes);
List<swap_flow_event> GetFlowEvents(int tradeId, List<int> eventTypes);
/// <summary>
/// 获取日终估值
/// </summary>
/// <param name="tradeId"></param>
/// <param name="valueDate"></param>
/// <returns></returns>
List<eod_swap_position> GetEodPositions(int tradeId,DateTime valueDate);
List<eod_swap_position> GetEodPositions(int tradeId, DateTime valueDate);
/// <summary>
/// 获取定义文件类型流水拆分明细
/// </summary>
@@ -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();
@@ -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;
@@ -970,6 +970,12 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
return result;
}
public List<contactype> GetContractTypes()
{
var result = DbContextFactory.GetClientDbContext(OptUser).contactype.ToList();
return result;
}
/// <summary>
/// 获取工作日天数
/// </summary>
@@ -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<swap_position> GetSwapPositions(int tradeId,bool? IsInitial)
public List<swap_position> 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<swap_flow> GetSwapFlows(int tradeId)
public List<swap_flow> 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<underlying_manager> GetUnderlyings(List<string> underlyingCodes)
@@ -2857,16 +2863,16 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
}
public List<swap_flow_event> GetFlowEvents(int tradeId, List<int> 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<eod_swap_position> 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<SwapFlowDeal> 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)
+1 -1
View File
@@ -515,7 +515,7 @@
<div class="col-6 mb-2" v-show="observationType==1">
<span>交易日历</span>
<select id="ObservationCalendar" style="width: 126px;margin-left:10px" v-model="observation.ObservationCalendar">
<option value="Chn">系统日历</option>
<option value="Chn">交易所日历</option>
<option value="IB">银行间日历</option>
</select>
</div>