平仓审核不符合条件直接跳过
This commit is contained in:
@@ -214,6 +214,24 @@ namespace YLErp.Modules.TradeModule
|
||||
return ctx;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需求①:判断按触发条件是否需要审批。
|
||||
/// <para>取该交易类别的审批流程,若所有节点配置的触发条件都不满足当前业务,则无需审批(返回 false)。</para>
|
||||
/// <para>若无审批流程或节点无触发条件,返回 true(需要审批)。</para>
|
||||
/// </summary>
|
||||
protected bool NeedApprovalByTrigger(trade td)
|
||||
{
|
||||
var tradeProcess = TradeProcessByCategory(td);
|
||||
if (tradeProcess == null || tradeProcess.Count == 0) return true;
|
||||
|
||||
var start = tradeProcess.FirstOrDefault(x => x.node == 0);
|
||||
if (start == null) start = tradeProcess.OrderBy(x => x.order).First();
|
||||
|
||||
var ctx = BuildTriggerContext(td, UserId);
|
||||
var target = ConditionEvaluator.FindFirstTriggeredNode(tradeProcess, start, ctx);
|
||||
return target != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按交易状态推断流程类别:开仓(TradeProcess) / 了结(CloseProcess)。需求②。
|
||||
/// <para>委托给 ProcessCategoryConst.Resolve,供全局复用。</para>
|
||||
|
||||
Reference in New Issue
Block a user