支持审批流程中的分支网关和节点触发条件
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Org.BouncyCastle.Ocsp;
|
||||
using Newtonsoft.Json;
|
||||
using YLErp.Helpers;
|
||||
using YLErp.DBModels.Enums;
|
||||
using YLErp.Model.Enum;
|
||||
using YLErp.Modules.AppModule;
|
||||
@@ -43,7 +45,7 @@ namespace YLErp.Web.Controllers
|
||||
[HttpPost]
|
||||
public ActionResult AddProcess(string type, List<ApprovalProcessAddRequest> data)
|
||||
{
|
||||
if (type == "TradeProcess" && data != null && data.Count > 0)
|
||||
if ((type == "TradeProcess" || type == "CloseProcess") && data != null && data.Count > 0)
|
||||
{
|
||||
foreach (var item in data)
|
||||
{
|
||||
@@ -54,6 +56,25 @@ namespace YLErp.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// 校验节点触发条件 JSON 格式,避免非法数据入库
|
||||
if (data != null)
|
||||
{
|
||||
foreach (var item in data)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(item.triggerCondition))
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonConvert.DeserializeObject<ConditionExpressionConfig>(item.triggerCondition);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return JsonError("触发条件格式非法,请检查括号与条件是否完整");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new ApprovalProcessService(CurUser).AddProcess(type, data);
|
||||
return JsonSuccess("设置成功");
|
||||
}
|
||||
@@ -66,10 +87,13 @@ namespace YLErp.Web.Controllers
|
||||
|
||||
var tradeProcess = list.Where(s => s.processType == "TradeProcess").OrderBy(s => s.order).ThenBy(s => s.parentNode).ThenBy(s => s.node).ToList();
|
||||
|
||||
// 需求②:了结/平仓/行权审批流程
|
||||
var closeProcess = list.Where(s => s.processType == "CloseProcess").OrderBy(s => s.order).ThenBy(s => s.parentNode).ThenBy(s => s.node).ToList();
|
||||
|
||||
var creditProcess = list.Where(s => s.processType == "CreditProcess").OrderBy(s => s.order).ToList();
|
||||
var outCashProcess = list.Where(s => s.processType == "OutCashProcess").OrderBy(s => s.order).ToList();
|
||||
var clientProcess = list.Where(s => s.processType == "ClientProcess").OrderBy(s => s.order).ThenBy(s => s.parentNode).ThenBy(s => s.node).ToList();
|
||||
return Json(new { OpenProcess = openProcess, TradeProcess = tradeProcess, CreditProcess = creditProcess, OutCashProcess= outCashProcess,ClientProcess = clientProcess });
|
||||
return Json(new { OpenProcess = openProcess, TradeProcess = tradeProcess, CloseProcess = closeProcess, CreditProcess = creditProcess, OutCashProcess= outCashProcess,ClientProcess = clientProcess });
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user