TRS-ZS-566、TRS-ZS-568 客户保证金率需求完成
This commit is contained in:
@@ -6,12 +6,14 @@ using System.Text;
|
||||
using YieldChain.Helpers;
|
||||
using YLErp.BLL;
|
||||
using YLErp.BLL.Eod;
|
||||
using YLErp.DBModels;
|
||||
using YLErp.DBModels.Enums;
|
||||
using YLErp.Model.Enum;
|
||||
using YLErp.Modules.RiskModule;
|
||||
using YLErp.Modules.SalesModule;
|
||||
using YLErp.Modules.SwapModule;
|
||||
using YLErp.Modules.SystemModule;
|
||||
using YLErp.Modules.UnderlyingModule;
|
||||
|
||||
namespace YLErp.Modules.TradeModule.DealModule
|
||||
{
|
||||
@@ -391,18 +393,12 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
/// <param name="td"></param>
|
||||
private void InitTradeReport(trade td,int marginDiretion)
|
||||
{
|
||||
var clientMarginTemplates = DbContext.client_marginrate.Where(x => x.ValueDate <= td.TradeDate).OrderByDescending(o => o.ValueDate).AsNoTracking().ToList();
|
||||
var marinRate = clientMarginTemplates.Where(x => x.ClientId == td.ClientId).FirstOrDefault();
|
||||
var marinRate= UnderlyingHelper.GetApplicableMarginRate(td.ClientId, td.UnderlyingCode, td.TradeDate.Value);
|
||||
if (marinRate == null)
|
||||
{
|
||||
marinRate = clientMarginTemplates.Where(x => x.ClientId == 0).FirstOrDefault();
|
||||
}
|
||||
if (marinRate == null)
|
||||
{
|
||||
marinRate = new client_marginrate
|
||||
{
|
||||
InitMarginRate = 1,
|
||||
MaintenanceRate = 1,
|
||||
marinRate = new client_margin_detail() {
|
||||
init_rate = 1,
|
||||
maintain_rate = 1
|
||||
};
|
||||
}
|
||||
var trade_Report = DbContext.trade_Report.Where(x => x.TradeId == td.id).FirstOrDefault();
|
||||
@@ -420,8 +416,8 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
trade_Report.IsPerformanceCollInterest = "否";
|
||||
trade_Report.PerformanceCollType = "0";
|
||||
trade_Report.PerformanceCollRange = "0";
|
||||
trade_Report.InitialPerformanceColl = (decimal)marinRate.InitMarginRate*100;
|
||||
trade_Report.RecoveryPerformanceColl = (decimal)marinRate.MaintenanceRate * 100;
|
||||
trade_Report.InitialPerformanceColl = (decimal)marinRate.init_rate*100;
|
||||
trade_Report.RecoveryPerformanceColl = (decimal)marinRate.maintain_rate * 100;
|
||||
trade_Report.UnwindPerformanceColl = trade_Report.RecoveryPerformanceColl;
|
||||
trade_Report.EodPerformanceColl = trade_Report.RecoveryPerformanceColl;
|
||||
trade_Report.PerformanceRemark = "详见交易确认书及定义性文件";
|
||||
|
||||
Reference in New Issue
Block a user