任务执行调整

usertest
zhangxiaofeng 3 months ago
parent dbb07a2278
commit 917aded780

@ -226,6 +226,9 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
TaskInfo = dataContext.GetOrDefault<BusinessTask>(TaskFlowDataNameConst.BusinessTask), TaskInfo = dataContext.GetOrDefault<BusinessTask>(TaskFlowDataNameConst.BusinessTask),
ServiceProvider = ServiceProvider ServiceProvider = ServiceProvider
}; };
//dataContext.Set("TypeName", "DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease.SpaceReleaseActionExecutor,DS.WMS.Core");
foreach (var key in dataContext.Keys) foreach (var key in dataContext.Keys)
context.AdditionalData[key] = dataContext[key]; context.AdditionalData[key] = dataContext[key];

@ -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)

@ -66,10 +66,11 @@
"FileType": [ ".xls", ".xlsx", ".pdf", ".txt", ".pms" ] "FileType": [ ".xls", ".xlsx", ".pdf", ".txt", ".pms" ]
}, },
"BCCompare": { "BCCompare": {
"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare", //"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare",
"MSKBCReadUrl": "http://47.104.73.97:7115/api/TaskBCParser/ExcuteBCFileRead", "MSKBCReadUrl": "http://47.104.73.97:7115/api/TaskBCParser/ExcuteBCFileRead",
"MSKBCModifyFileUrl": "http://47.104.73.97:7115/api/TaskBCParser/ModifyBCFile", "MSKBCModifyFileUrl": "http://47.104.73.97:7115/api/TaskBCParser/ModifyBCFile",
"CMABCReadUrl": "http://47.104.73.97:7115/api/TaskBCCMAParser/ExcuteBCFileRead" "CMABCReadUrl": "http://47.104.73.97:7115/api/TaskBCCMAParser/ExcuteBCFileRead",
"Url": "http://60.209.125.238:35210/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare"
}, },
"ShippingOrderCompare": { "ShippingOrderCompare": {
"Url": "http://47.104.73.97:7115/api/TaskShippingOrderCompare/ExcuteShippingOrderCompare", "Url": "http://47.104.73.97:7115/api/TaskShippingOrderCompare/ExcuteShippingOrderCompare",

Loading…
Cancel
Save