平仓审核不符合条件直接跳过
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using YLErp.BLL;
|
||||
using YLErp.Helpers;
|
||||
using YLErp.Model;
|
||||
using YLErp.Model.Enum;
|
||||
|
||||
@@ -105,13 +106,33 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
{
|
||||
var td = DbContext.trade.Find(tradeId);
|
||||
td.OptDate = DateTime.Now;
|
||||
td.TradeStatus = ConsTrade.行权待复核;
|
||||
td.CheckStatus = Convert.ToInt32(TradeCheckEnum.StatusOfOld);
|
||||
// 需求②:行权按交易状态查对应流程,而非只查开仓流程
|
||||
if (valuedateBLL.SystemDate.CloseReApprove == 1 && TradeProcessCountByCategory(td) > 0)
|
||||
|
||||
// 先设状态,使流程类别能正确推断为 CloseProcess
|
||||
td.TradeStatus = ConsTrade.行权待复核;
|
||||
|
||||
// 需求②:行权按交易状态查对应流程
|
||||
var needApproval = valuedateBLL.SystemDate.CloseReApprove == 1 && TradeProcessCountByCategory(td) > 0;
|
||||
if (needApproval)
|
||||
{
|
||||
//如果有审批组
|
||||
InitTradeProcessOrder(td,UserId);
|
||||
// 需求①:进入审批前先判断触发条件——若所有节点都不满足触发条件,跳过审批。
|
||||
needApproval = NeedApprovalByTrigger(td);
|
||||
}
|
||||
|
||||
if (needApproval)
|
||||
{
|
||||
// 需要审批:保持"行权待复核",进入审批流程等待人工审批
|
||||
InitTradeProcessOrder(td, UserId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 不需要审批:直接完成行权
|
||||
td.ProcessOrderId = ProcessTradeLog.审批通过;
|
||||
td.ProcessStatus = ProcessTradeStatus.通过审批.ToString();
|
||||
td.ProcessOptDate = DateTime.Now;
|
||||
DbContext.SaveChanges();
|
||||
new TradeUnwindService(this).UnwindTrade(td, null, true, true);
|
||||
return;
|
||||
}
|
||||
|
||||
DbContext.SaveChanges();
|
||||
|
||||
Reference in New Issue
Block a user