From fc51bfab68c8ac06f5a33d24588584e88abbcfe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=B3=B0?= Date: Wed, 8 Jul 2026 10:59:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=A2=ABrevert=E8=AF=AF?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 14 ++++++++++++++ YLErpWeb/App/HostedTaskService.cs | 13 +++++++++++++ YLErpWeb/App_Data/FunctionRight.xml | 17 +++++++++++++++++ YLErpWeb/App_Data/Menus.txt | 1 + 4 files changed, 45 insertions(+) diff --git a/.editorconfig b/.editorconfig index 40eb71f1..e2964ef3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -160,3 +160,17 @@ csharp_preserve_single_line_statements = true # CA1819: Properties should not return arrays dotnet_diagnostic.CA1819.severity = silent + +# JavaScript 和 TypeScript 文件 +[*.{js,jsx,ts,tsx}] +# 缩进和间距 +indent_size = 4 +indent_style = space +tab_width = 4 + +# 新行首选项 +end_of_line = crlf +insert_final_newline = false + +# 拖尾逗号不添加 +trailing_comma = none diff --git a/YLErpWeb/App/HostedTaskService.cs b/YLErpWeb/App/HostedTaskService.cs index 75bf1339..025420b8 100644 --- a/YLErpWeb/App/HostedTaskService.cs +++ b/YLErpWeb/App/HostedTaskService.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting.Server.Features; using YLErp.DBModels.Consts; using YLErp.Modules.AppModule; using YLErp.Modules.EodModule.SettlementModule; +using YLErp.Modules.RiskEngine; using YLErp.Modules.RiskModule; using YLErp.Modules.SuperviseReportModule.SAC.Service; using YLErp.Modules.TradeRiskCalcModule; @@ -124,6 +125,18 @@ namespace YLErp.Web.App PS.SetConfig(ConsAppConfig.YLErpWebUrlConfig, address); } + // 预热风控引擎:加载规则与应用到内存,并预编译所有规则 + Task.Run(() => + { + try + { + RiskEngineService.GetInstance().Preload(); + } + catch (Exception ex) + { + LogFactory.GetLogger("HostedTaskService").Error("[风控引擎] 启动预热失败", ex); + } + }); }); return Task.CompletedTask; diff --git a/YLErpWeb/App_Data/FunctionRight.xml b/YLErpWeb/App_Data/FunctionRight.xml index 7962c464..3d23be45 100644 --- a/YLErpWeb/App_Data/FunctionRight.xml +++ b/YLErpWeb/App_Data/FunctionRight.xml @@ -60,6 +60,23 @@ + + + + + + + + + + + + + + + + + diff --git a/YLErpWeb/App_Data/Menus.txt b/YLErpWeb/App_Data/Menus.txt index a8aea562..506f2a79 100644 --- a/YLErpWeb/App_Data/Menus.txt +++ b/YLErpWeb/App_Data/Menus.txt @@ -25,6 +25,7 @@ {Name:"资金监控",Rights:["风险控制-资金监控"],Url:"client/clientRiskMonitor"}, {Name:"市场风险",Rights:["风险控制-市场风险"],Url:"risk/RiskExposureReport"}, {Name:"限额监控",Rights:["风险控制-限额监控"],Url:"risk/quotaMonitor"}, + {Name:"异常交易监控",Rights:["风险控制-异常交易监控"],Url:"v3/risk/risk-engine-config"}, {Name:"白名单券池",Rights:["风险控制-白名单券池"],Url:"v3/data/underlying-pool"}, {Name:"日终持仓风险",Rights:["风险控制-日终持仓风险"],Url:"trade/EodPositionRisks"}, {Name:"日终持仓风险_互换",Rights:["风险控制-日终持仓风险_互换"],Url:"swaptrade2/EodPositionRisks"},