|
|
|
@ -146,19 +146,25 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
var ids = request.Ids;
|
|
|
|
|
ids ??= [request.BusinessId];
|
|
|
|
|
|
|
|
|
|
if (ids.Length == 0)
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
List<string> strList = [];
|
|
|
|
|
DataResult result;
|
|
|
|
|
for (int i = 0; i < ids.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
request.BusinessId = ids[i];
|
|
|
|
|
result = await CreateTaskAsync(request, useTransaction);
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
return result;
|
|
|
|
|
{
|
|
|
|
|
if (result.Data == null)
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
strList.Add(result.Data.ToString()!);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Success;
|
|
|
|
|
if (strList.Count == 0)
|
|
|
|
|
return DataResult.Success;
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed(string.Format(MultiLanguageConst.OrderTaskSubmitted, string.Join("、", strList)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -180,6 +186,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
request.TaskTypeName = nextType.Value.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DataResult result = DataResult.Success;
|
|
|
|
|
bool updateFlag = false;
|
|
|
|
|
var task = await GetQuery(request.BusinessId, request.BusinessType, request.TaskType).FirstAsync();
|
|
|
|
|
if (task != null)
|
|
|
|
@ -191,11 +198,19 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
}
|
|
|
|
|
else //其他任务类型返回已存在提示
|
|
|
|
|
{
|
|
|
|
|
if (IsOrderType(request.TaskType))
|
|
|
|
|
{
|
|
|
|
|
string custNO = await TenantDb.Queryable<SeaExport>().Where(x => x.Id == request.BusinessId)
|
|
|
|
|
.Select(x => x.CustomerNo).FirstAsync();
|
|
|
|
|
result = DataResult.Failed(string.Format(MultiLanguageConst.OrderTaskSubmitted, custNO));
|
|
|
|
|
result.Data = custNO;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskExists));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DataResult result = DataResult.Success;
|
|
|
|
|
if (request.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
result = await CheckRulesAsync(request.BusinessId, request.BusinessType.Value, RuleEngineType.COMMON_ORDER_AUDIT);
|
|
|
|
|