|
|
@ -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)
|
|
|
|
foreach (var waitMatchConfigItem in waitMatchConfigList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var condition = conditionList.FirstOrDefault(x => x.ConfigId == waitMatchConfigItem.Id);
|
|
|
|
var condition = conditionList.FirstOrDefault(x => x.ConfigId == waitMatchConfigItem.Id);
|
|
|
|
if (condition == null || string.IsNullOrEmpty(condition.Content))
|
|
|
|
if (condition == null || string.IsNullOrEmpty(condition.Content))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
matchedConfigList.Add(waitMatchConfigItem);
|
|
|
|
matchedConfigList.Add((waitMatchConfigItem, false));
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var contitionContent = JsonConvert.DeserializeObject<ConditionContent>(condition.Content)!;
|
|
|
|
var contitionContent = JsonConvert.DeserializeObject<ConditionContent>(condition.Content)!;
|
|
|
|
if (ConditionHelper.IsPass(contitionContent, dataContext))
|
|
|
|
if (ConditionHelper.IsPass(contitionContent, dataContext))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
matchedConfigList.Add(waitMatchConfigItem);
|
|
|
|
matchedConfigList.Add((waitMatchConfigItem, true));
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (matchedConfigList.Count == 1)
|
|
|
|
if (matchedConfigList.Count == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
executeConfig = matchedConfigList[0];
|
|
|
|
executeConfig = matchedConfigList[0].config;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (matchedConfigList.Count > 1)
|
|
|
|
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)
|
|
|
|
if (executeConfig == null)
|
|
|
@ -297,7 +298,14 @@ namespace DS.WMS.Core.TaskPlat
|
|
|
|
dynamic dynamicTask = task;
|
|
|
|
dynamic dynamicTask = task;
|
|
|
|
if (dynamicTask.Result != null)
|
|
|
|
if (dynamicTask.Result != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
flowLogDetail.ExecuteReturn = JsonConvert.SerializeObject(dynamicTask.Result);
|
|
|
|
if (dynamicTask.Result != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
flowLogDetail.ExecuteReturn = JsonConvert.SerializeObject(dynamicTask.Result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
flowLogDetail.ExecuteReturn = "执行返回结果为null";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var isSuccess = dynamicTask.Result.Succeeded;
|
|
|
|
var isSuccess = dynamicTask.Result.Succeeded;
|
|
|
|
if (isSuccess != null && isSuccess is bool)
|
|
|
|
if (isSuccess != null && isSuccess is bool)
|
|
|
|