Files
zszq-trs/YLErpWeb/App/Startup.cs
T
2026-08-04 11:33:09 +08:00

102 lines
4.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using YLErp.Modules.TradeModule.DocGenerateModule;
namespace YLErp.Web
{
/// <summary>
/// 程序帮助类
/// </summary>
public static class Startup
{
/// <summary>
/// 初始化OTC系统上下文
/// </summary>
public static void Start(IConfiguration config)
{
AppHelper.InitConfig();
OtcAppContext.Initialize(Server.MapPath);
AppManager.Initialize(Enums.SubSystemName.OtcWeb, config);
GlobalConfig.EnableGenerateOnTradeClosed = true;
GlobalConfig.OverrideOldDoc = true;
GlobalConfig.ProjectTitle = "场外衍生品交易管理系统";
GlobalConfig.GetNameByUserId = UserBLL.GetNameById;
GlobalConfig.SealHandler = new SealTaskHandleService(OptUserInfo.SystemUser);
//配置确认书文档生成是否覆盖旧的
//适用于插件环境
switch (PS.Config.Company)
{
case Configuration.CompanyEnum.海通:
GlobalConfig.DotFindBrotherTrade = true;
break;
case Configuration.CompanyEnum.光大光子:
GlobalConfig.EnableExtendSetting = true;
GlobalConfig.SelectConfirmationBookTemplate = true;
break;
case Configuration.CompanyEnum.伴兴:
GlobalConfig.SelectConfirmationBookTemplate = true;
break;
case Configuration.CompanyEnum.润和:
case Configuration.CompanyEnum.国泰君安:
GlobalConfig.EnableExtendSetting = true;
break;
case Configuration.CompanyEnum.中财资本:
break;
case Configuration.CompanyEnum.渤海:
case Configuration.CompanyEnum.安粮:
case Configuration.CompanyEnum.申万:
case Configuration.CompanyEnum.国联:
GlobalConfig.EnableExtendSetting = true;
break;
case Configuration.CompanyEnum.国海:
GlobalConfig.EnableExtendSetting = true;
GlobalConfig.ProjectTitle = "场外衍生品业务管理系统";
break;
case Configuration.CompanyEnum.浙商:
GlobalConfig.ExtendReportType.Add("月报基础数据债券收益互换", 2);
break;
case Configuration.CompanyEnum.方顿:
GlobalConfig.ExtendReportType.Add("风险资本准备计算表", 1);
break;
case Configuration.CompanyEnum.格林大华:
GlobalConfig.ExtendReportType.Add("客户持仓信息", 3);
break;
case Configuration.CompanyEnum.东吴:
GlobalConfig.ExtendReportType.Add("客户资金记录报表", 4);
break;
default:
break;
}
SsoLoginConfig.Init();
GeneralSSOConfig.Init(config);
SetDefaultInitial();
}
private static void SetDefaultInitial()
{
//默认
var dingShiShuoMing = DBCacheManager.Single.GetStr(CacheTable.DingShiDesc);
if (string.IsNullOrEmpty(dingShiShuoMing))
{
DBCacheManager.Single.Set(CacheTable.DingShiDesc, @" 说明:&nbsp;Note<br />
1. 期权收支, 负数表示客户支付期权费,正数表示客户收到期权费;<br />
2. 结算收支,负数表示客户期权结算支出,正数表示客户期权结算收入;<br />
3. 持仓量,负数表示客户卖出期权,正数表示客户买入期权;<br />
4. 可用资金 = 账户现金 + 维持预付金,正数表示客户可以出金的金额;<br />
5. 追保金额 = -min(可用资金 + 授信额度, 0)<br />
6. 客户权益 = 账户现金 + 持仓市值;<br />
7. 账户现金 = 昨日账户现金 + 今日入金 + 期权费收支 + 结算费收支 - 今日出金;<br />", 1000000000);
}
var luoKuanDesc = DBCacheManager.Single.GetStr(CacheTable.LuoKuanDesc);
if (string.IsNullOrEmpty(luoKuanDesc))
{
DBCacheManager.Single.Set(CacheTable.LuoKuanDesc, string.Format(@"<p></p>顺颂商祺<p></p><p>{0}风险管理有限公司&nbsp;</p><p>场外衍生品部</p>", YLErp.PS.Config.Company), 1000000000);
}
}
}
}