You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB
C#

1 month ago
using DS.Module.Core;
1 month ago
using DS.WMS.Core.Op.Dtos;
1 month ago
using DS.WMS.Core.TaskInteraction.Dtos;
using DS.WMS.Core.TaskInteraction.Interface;
namespace DS.WMS.Core.TaskInteraction.Method
{
/// <summary>
/// PA任务服务
/// </summary>
public class PreAlertTaskService : TaskService, IPreAlertTaskService
{
1 month ago
const TaskBaseTypeEnum TASK_TYPE = TaskBaseTypeEnum.PRE_ALERT;
1 month ago
/// <summary>
/// 初始化
/// </summary>
/// <param name="provider"></param>
public PreAlertTaskService(IServiceProvider provider) : base(provider)
{
}
/// <summary>
/// 创建PA任务
/// </summary>
/// <param name="request"></param>
/// <param name="useTransaction"></param>
/// <returns></returns>
1 month ago
public override async Task<DataResult> CreateMultipleTaskAsync(TaskCreationRequest request, bool useTransaction = true)
1 month ago
{
1 month ago
var orders = request.ExtraData as List<SeaExportRes>;
1 month ago
1 month ago
if (useTransaction)
await TenantDb.Ado.BeginTranAsync();
try
{
if (useTransaction)
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
catch (Exception ex)
{
if (useTransaction)
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
1 month ago
}
1 month ago
///// <summary>
///// 设置任务状态
///// </summary>
///// <param name="request"></param>
///// <param name="useTransaction"></param>
///// <returns></returns>
//public override Task<DataResult> SetTaskStatusAsync(TaskUpdateRequest request, bool useTransaction = true)
//{
// return base.SetTaskStatusAsync(request, useTransaction);
//}
1 month ago
}
}