修复重复任务判断

usertest
嵇文龙 3 months ago
parent 0c963aa354
commit 536bc8ae0e

@ -2,6 +2,8 @@
using System.Runtime.Serialization;
using DS.Module.Core;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Method.TaskInteraction;
using Masuit.Tools.Systems;
namespace DS.WMS.Core.Op.Dtos.TaskInteraction
{
@ -51,6 +53,10 @@ namespace DS.WMS.Core.Op.Dtos.TaskInteraction
{
yield return new ValidationResult($"参数 {nameof(TaskTypeName)} 值不在有效枚举范围之内");
}
else if (TaskService.IsOrderType(TaskType) && BusinessType == null)
{
yield return new ValidationResult($"任务类型为【{TaskType.GetDescription()}】时,参数 {nameof(BusinessType)} 不能为空");
}
}
}
}

@ -4,7 +4,6 @@ using DS.Module.Core.Data;
using DS.Module.Core.Helpers;
using DS.Module.DjyRulesEngine;
using DS.WMS.Core.Fee.Interface;
using DS.WMS.Core.Fee.Method;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface;
@ -150,7 +149,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
var task = await GetQuery(request.BusinessId, request.BusinessType, request.TaskType).FirstAsync();
if (task != null && task.TaskStatus != TaskStatusEnum.Cancel)
if (task != null && task.TaskStatus != TaskStatusEnum.Pending && task.TaskStatus != TaskStatusEnum.Cancel)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskExists));
DataResult result = DataResult.Success;

Loading…
Cancel
Save