250 lines
8.6 KiB
C#
250 lines
8.6 KiB
C#
|
|
namespace YLErp.Configuration
|
|
{
|
|
/// <summary>
|
|
/// PS.Config
|
|
/// </summary>
|
|
public class ProjectConfig
|
|
{
|
|
public IErpConfig ErpElement { get; }
|
|
|
|
public IErpConfig TradeElement => ErpElement;
|
|
|
|
public IErpConfig ClientElement => ErpElement;
|
|
|
|
public ProjectConfig(IErpConfig erpElementinfo)
|
|
{
|
|
ErpElement = erpElementinfo ?? throw new System.ArgumentNullException(nameof(erpElementinfo));
|
|
}
|
|
|
|
//----------冗余字段-------------------
|
|
|
|
/// <summary>
|
|
/// 公司枚举
|
|
/// </summary>
|
|
public CompanyEnum Company => ErpElement.Company;
|
|
|
|
/// <summary>
|
|
/// 公司ID(由镒链分配)
|
|
/// </summary>
|
|
public string CompanyID => ErpElement.CompanyID;
|
|
|
|
/// <summary>
|
|
/// 公司名称缩写,如:GTJA
|
|
/// </summary>
|
|
public string CompanyAbbreviation => ErpElement.CompanyAbbreviation;
|
|
|
|
/// <summary>
|
|
/// 公司名称
|
|
/// </summary>
|
|
public string CompanyName => ErpElement.CompanyName;
|
|
|
|
/// <summary>
|
|
/// 公司英文名称
|
|
/// </summary>
|
|
public string CompanyEnName => ErpElement.CompanyEnName;
|
|
|
|
/// <summary>
|
|
/// 公司简称,如:国泰君安
|
|
/// </summary>
|
|
public string CompanyShortName => ErpElement.CompanyShortName;
|
|
|
|
/// <summary>
|
|
/// 公司名称
|
|
/// </summary>
|
|
public string CompanyFullName => ErpElement.CompanyFullName;
|
|
|
|
/// <summary>
|
|
/// 客户上传文件审核记录
|
|
/// </summary>
|
|
public string ClientFileAuditItems => ErpElement.ClientFileAuditItems;
|
|
|
|
/// <summary>
|
|
/// 客户上传文件审核是否启用
|
|
/// </summary>
|
|
public bool ClientFileAudit => ErpElement.ClientFileAudit;
|
|
|
|
/// <summary>
|
|
/// 是否在风险对冲页面采用自动对冲策略
|
|
/// </summary>
|
|
public bool IsUseHedgingRule => ErpElement.IsUseHedgingRule;
|
|
|
|
/// <summary>
|
|
/// 部署组件版本
|
|
/// </summary>
|
|
public ComponentVersion ComponentVersion => ErpElement.ComponentVersion;
|
|
|
|
public bool IsAutoGenerateContracts => ErpElement.IsAutoGenerateContracts;
|
|
|
|
public bool IsShowOtherClientCash => ErpElement.IsShowOtherClientCash;
|
|
|
|
public bool IsEodSendMaturityEmail => ErpElement.IsEodSendMaturityEmail;
|
|
|
|
public bool UseOldGenerateBook => ErpElement.UseOldGenerateBook;
|
|
|
|
/// <summary>
|
|
/// 持仓市值是否进行四舍五入处理
|
|
/// </summary>
|
|
public bool IsPVRounded => ErpElement.IsPVRounded;
|
|
|
|
/// <summary>
|
|
/// 自定义交易收盘时是否跳过验证自定义风险指标
|
|
/// </summary>
|
|
public bool IsMustRiskManual => ErpElement.IsMustRiskManual;
|
|
|
|
public bool IsAvailableForClient => ErpElement.IsAvailableForClient;
|
|
|
|
public bool IsAutoDelaySettlement => ErpElement.IsAutoDelaySettlement;
|
|
|
|
/// <summary>
|
|
/// 持仓使用固定预付金比例计算是否使用期初价格
|
|
/// </summary>
|
|
public bool EodFixedMarginUseSpotPrice => ErpElement.EodFixedMarginUseSpotPrice;
|
|
|
|
public bool ShowAccruedTotalPnL => ErpElement.ShowAccruedTotalPnL;
|
|
|
|
/// <summary>
|
|
/// 是否导出出金单
|
|
/// </summary>
|
|
public bool IsExportEntryexit => ErpElement.IsExportEntryexit;
|
|
|
|
/// <summary>
|
|
/// 销售提成计算方式
|
|
/// </summary>
|
|
public string SalesCommissionCalculation => ErpElement.SalesCommissionCalculation;
|
|
/// <summary>
|
|
/// 是否用户登录会相互排斥登录状态
|
|
/// </summary>
|
|
public bool UseSingleLogin => ErpElement.UseSingleLogin;
|
|
|
|
public bool IsUseDisplayNotional => ErpElement.UseDisplayNotional;
|
|
|
|
/// <summary>
|
|
/// 产业客户累计转远期多空反向固定为多头,默认象屿为 true
|
|
/// 若 期权:买入看涨 --> 远期:买入多头;
|
|
/// 期权:卖出看跌 --> 远期:买入多头;
|
|
/// 期权:买入看跌 --> 远期:卖出多头;
|
|
/// 期权:卖出看涨 --> 远期:卖出多头;
|
|
/// </summary>
|
|
public bool IsForwardTradeToBuy => ErpElement.IsForwardTradeToBuy;
|
|
|
|
public bool IsCalcRealtimeWarning => ErpElement.IsCalcRealtimeWarning;
|
|
|
|
/// <summary>
|
|
/// 自定义报送结构类型
|
|
/// </summary>
|
|
public string CustomStructureTypeSm => ErpElement.CustomStructureTypeSm;
|
|
|
|
/// <summary>
|
|
/// 文件上传大小限制(单位KB)
|
|
/// </summary>
|
|
public int UploadFileSizeLimit => ErpElement.UploadFileSizeLimit;
|
|
|
|
#region-----is-----
|
|
|
|
/// <summary>
|
|
/// 是否平仓开仓波动率支持
|
|
/// </summary>
|
|
public bool IsTradeVol => ErpElement.VolMode == VolModeEnum.TradeVol;
|
|
|
|
public bool Is国泰君安 => ErpElement.Company == CompanyEnum.国泰君安;
|
|
|
|
/// <summary>
|
|
/// Is国泰君安
|
|
/// </summary>
|
|
public bool IsGuoJun => ErpElement.Company == CompanyEnum.国泰君安;
|
|
|
|
public bool Is申万 => ErpElement.Company == CompanyEnum.申万;
|
|
|
|
public bool Is国海 => ErpElement.Company == CompanyEnum.国海;
|
|
/// <summary>
|
|
/// Is申万
|
|
/// </summary>
|
|
public bool IsShenWan => ErpElement.Company == CompanyEnum.申万;
|
|
|
|
public bool Is渤海 => ErpElement.Company == CompanyEnum.渤海;
|
|
|
|
public bool Is格林大华 => ErpElement.Company == CompanyEnum.格林大华;
|
|
|
|
public bool Is安粮 => ErpElement.Company == CompanyEnum.安粮;
|
|
|
|
public bool Is方顿 => ErpElement.Company == CompanyEnum.方顿;
|
|
|
|
public bool Is东兴 => ErpElement.Company == CompanyEnum.东兴;
|
|
|
|
public bool Is光大光子 => ErpElement.Company == CompanyEnum.光大光子;
|
|
|
|
public bool Is长江 => ErpElement.Company == CompanyEnum.长江;
|
|
|
|
public bool Is广期资本 => ErpElement.Company == CompanyEnum.广期资本;
|
|
|
|
public bool Is海通 => ErpElement.Company == CompanyEnum.海通;
|
|
|
|
public bool Is茂川资本 => ErpElement.Company == CompanyEnum.茂川资本;
|
|
|
|
public bool Is伴兴 => ErpElement.Company == CompanyEnum.伴兴;
|
|
|
|
public bool Is宏源 => ErpElement.Company == CompanyEnum.宏源;
|
|
|
|
public bool Is瑞达 => ErpElement.Company == CompanyEnum.瑞达;
|
|
|
|
public bool Is兴证 => ErpElement.Company == CompanyEnum.兴证;
|
|
|
|
public bool Is中财 => ErpElement.Company == CompanyEnum.中财资本;
|
|
|
|
public bool Is上期资本 => ErpElement.Company == CompanyEnum.上期资本;
|
|
|
|
public bool Is厦门象屿 => ErpElement.Company == CompanyEnum.厦门象屿;
|
|
|
|
public bool Is润和 => ErpElement.Company == CompanyEnum.润和;
|
|
|
|
public bool Is兴业商贸 => ErpElement.Company == CompanyEnum.兴业商贸;
|
|
|
|
public bool Is浙期 => ErpElement.Company == CompanyEnum.浙期;
|
|
|
|
public bool Is天示 => ErpElement.Company == CompanyEnum.天示;
|
|
|
|
public bool Is国投 => ErpElement.Company == CompanyEnum.国投;
|
|
|
|
public bool Is国信金阳 => ErpElement.Company == CompanyEnum.国信金阳;
|
|
|
|
public bool Is华安 => ErpElement.Company == CompanyEnum.华安;
|
|
public bool Is招证 => ErpElement.Company == CompanyEnum.招证;
|
|
public bool Is东吴 => ErpElement.Company == CompanyEnum.东吴;
|
|
public bool Is广发商贸 => ErpElement.Company == CompanyEnum.广发商贸;
|
|
|
|
public bool Is中粮 => ErpElement.Company == CompanyEnum.中粮;
|
|
|
|
public bool Is湘财 => ErpElement.Company == CompanyEnum.湘财;
|
|
public bool Is物产中大 => ErpElement.Company == CompanyEnum.物产中大;
|
|
public bool Is东莞 => ErpElement.Company == CompanyEnum.东莞;
|
|
|
|
public bool Is山西固收 => ErpElement.Company == CompanyEnum.山西固收;
|
|
public bool Is浙商 => ErpElement.Company == CompanyEnum.浙商;
|
|
/// <summary>
|
|
/// 衡泰内证账号
|
|
/// </summary>
|
|
public string HTAccount => ErpElement.HTAccount;
|
|
#endregion
|
|
|
|
#region----Get Config----
|
|
|
|
/// <summary>
|
|
/// 获取收盘配置
|
|
/// </summary>
|
|
public SettlementConfig GetSettlementConfig()
|
|
{
|
|
return System.JsonHelper.Deserialize<SettlementConfig>(ErpElement.SettlementConfig) ?? new SettlementConfig
|
|
{
|
|
Version = "V1",
|
|
CalcPnlExplain = false,
|
|
PriceType = 3,
|
|
SupportPart = false,
|
|
VolTypes = "持仓,开仓,对冲,光证,BidAskVol"
|
|
};
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|