|
|
|
@ -169,30 +169,31 @@ namespace DS.WMS.Core.TaskPlat
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 对节点列表里面的节点进行依次判断,取出要执行的节点
|
|
|
|
|
var matchedConfigList = new List<TaskFlowConfig>();
|
|
|
|
|
var matchedConfigList = new List<(TaskFlowConfig config, bool isHasCondition)>();
|
|
|
|
|
foreach (var waitMatchConfigItem in waitMatchConfigList)
|
|
|
|
|
{
|
|
|
|
|
var condition = conditionList.FirstOrDefault(x => x.ConfigId == waitMatchConfigItem.Id);
|
|
|
|
|
if (condition == null || string.IsNullOrEmpty(condition.Content))
|
|
|
|
|
{
|
|
|
|
|
matchedConfigList.Add(waitMatchConfigItem);
|
|
|
|
|
matchedConfigList.Add((waitMatchConfigItem, false));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var contitionContent = JsonConvert.DeserializeObject<ConditionContent>(condition.Content)!;
|
|
|
|
|
if (ConditionHelper.IsPass(contitionContent, dataContext))
|
|
|
|
|
{
|
|
|
|
|
matchedConfigList.Add(waitMatchConfigItem);
|
|
|
|
|
matchedConfigList.Add((waitMatchConfigItem, true));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (matchedConfigList.Count == 1)
|
|
|
|
|
{
|
|
|
|
|
executeConfig = matchedConfigList[0];
|
|
|
|
|
executeConfig = matchedConfigList[0].config;
|
|
|
|
|
}
|
|
|
|
|
else if (matchedConfigList.Count > 1)
|
|
|
|
|
{
|
|
|
|
|
executeConfig = matchedConfigList.FirstOrDefault(x => x.IsMoreMatchDefault);
|
|
|
|
|
var temp = matchedConfigList.OrderBy(x => x.config.Id).Where(x => x.isHasCondition).ToList();
|
|
|
|
|
executeConfig = temp.FirstOrDefault().config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (executeConfig == null)
|
|
|
|
@ -295,9 +296,16 @@ namespace DS.WMS.Core.TaskPlat
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dynamic dynamicTask = task;
|
|
|
|
|
if (dynamicTask.Result != null)
|
|
|
|
|
{
|
|
|
|
|
if (dynamicTask.Result != null)
|
|
|
|
|
{
|
|
|
|
|
flowLogDetail.ExecuteReturn = JsonConvert.SerializeObject(dynamicTask.Result);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
flowLogDetail.ExecuteReturn = "执行返回结果为null";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var isSuccess = dynamicTask.Result.Succeeded;
|
|
|
|
|
if (isSuccess != null && isSuccess is bool)
|
|
|
|
|