fix: 特批批量确认跳过新风控
This commit is contained in:
@@ -46,7 +46,7 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
/// <summary>
|
||||
/// 2021-02-04改造:批量确认因为耗时太长,用户多页面(交易列表,今日交易)并发确认导致生成多条期权费资金记录
|
||||
/// </summary>
|
||||
public TradeConfirmResultModel tradeConfirm(IEnumerable<int> tradeids, bool ignoreMoneyCheck = false, bool isSkipApproval = false, bool ignoreRiskWarning = false, IEnumerable<string> ignoreRiskRuleIds = null)
|
||||
public TradeConfirmResultModel tradeConfirm(IEnumerable<int> tradeids, bool ignoreMoneyCheck = false, bool isSkipApproval = false, bool ignoreRiskWarning = false, IEnumerable<string> ignoreRiskRuleIds = null, bool skipNewRiskCheck = false)
|
||||
{
|
||||
if (tradeids is null || !tradeids.Any(n => n > 0))
|
||||
{
|
||||
@@ -102,7 +102,8 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
changeConfirmPaths: result.changeConfirmPaths,
|
||||
continueQuotaCheck: idCache.Contains(pid),
|
||||
ignoreRiskWarning: ignoreRiskWarning,
|
||||
ignoreRiskRuleIds: ignoreRiskRuleIds);
|
||||
ignoreRiskRuleIds: ignoreRiskRuleIds,
|
||||
skipNewRiskCheck: skipNewRiskCheck);
|
||||
if (pid > 0)
|
||||
{
|
||||
idCache.Add(pid);
|
||||
@@ -166,9 +167,10 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
/// <param name="confirmedTradeIds"></param>
|
||||
/// <param name="changeConfirmPaths"></param>
|
||||
/// <param name="continueQuotaCheck"></param>
|
||||
/// <param name="skipNewRiskCheck">仅用于特批批量确认,true 表示老风控和新风控都跳过;单笔老风控特批保持 false,仍执行新风控。</param>
|
||||
/// <returns></returns>
|
||||
private TradeOpenResult ConfirmTrade(int tid, bool isBatch, bool hasTradeProcess,
|
||||
bool ignoreMoneyCheck, bool isSkipApproval, List<int> confirmedTradeIds, List<string> changeConfirmPaths, bool continueQuotaCheck = false, bool ignoreRiskWarning = false, IEnumerable<string> ignoreRiskRuleIds = null)
|
||||
bool ignoreMoneyCheck, bool isSkipApproval, List<int> confirmedTradeIds, List<string> changeConfirmPaths, bool continueQuotaCheck = false, bool ignoreRiskWarning = false, IEnumerable<string> ignoreRiskRuleIds = null, bool skipNewRiskCheck = false)
|
||||
{
|
||||
var td = DbContext.trade.FirstOrDefault(t => t.id == tid);
|
||||
var result = new TradeOpenResult(td ?? new trade());
|
||||
@@ -211,8 +213,8 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
var trialService = new QuotaMonitorService(this);
|
||||
if (ignoreMoneyCheck)
|
||||
{
|
||||
// ignoreMoneyCheck 表示老风控资金/限额检查已被特批放行,只跳过老风控;新风控仍需独立执行。
|
||||
if (!trialService.CheckTradeConfirmNewRisk(ref result, ignoreRiskWarning, ignoreRiskRuleIds))
|
||||
// 单笔老风控特批仍需执行新风控;特批批量确认通过 skipNewRiskCheck 显式跳过新风控。
|
||||
if (!skipNewRiskCheck && !trialService.CheckTradeConfirmNewRisk(ref result, ignoreRiskWarning, ignoreRiskRuleIds))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2489,12 +2489,15 @@ namespace YLErp.Web.Controllers
|
||||
}
|
||||
}
|
||||
var isSkipApproval = false;
|
||||
var skipNewRiskCheck = false;
|
||||
// 特批批量确认的语义是直接确认,跳过审批、老风控和新风控;单笔老风控特批不设置该标记。
|
||||
if (CurUser.交易管理_特批批量确认 && isSkipCheck)
|
||||
{
|
||||
ignoreMoneyCheck = true;
|
||||
isSkipApproval = true;
|
||||
skipNewRiskCheck = true;
|
||||
}
|
||||
var result = new TradeConfirmService(CurUser).tradeConfirm(tradeidArr, ignoreMoneyCheck, isSkipApproval, ignoreRiskWarning, ignoreRiskRuleIdArr);
|
||||
var result = new TradeConfirmService(CurUser).tradeConfirm(tradeidArr, ignoreMoneyCheck, isSkipApproval, ignoreRiskWarning, ignoreRiskRuleIdArr, skipNewRiskCheck);
|
||||
_logger.Info($"TradeConfirmRisk.Result tradeids:{tradeids}, lackOfMoney:{result.LackOfMoney}, type:{result.type}, trialDataId:{result.TrialDataId}, oldRiskNeedSpecialApproval:{result.OldRiskNeedSpecialApproval}, newRiskNeedApproval:{result.NewRiskNeedApproval}, newRiskBlocked:{result.NewRiskBlocked}, ignoreRiskRuleIds:{string.Join(",", result.ignoreRiskRuleIds ?? new List<string>())}, errorMsgLength:{result.errorMsg?.Length ?? 0}, tipMsgLength:{result.tipMsg?.Length ?? 0}, userId:{CurUser?.UserId}");
|
||||
|
||||
//如果需要前端确认信息,触发新老风控
|
||||
|
||||
Reference in New Issue
Block a user