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#

using DS.Module.Core;
using DS.WMS.Core.Op.Dtos;
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
{
const TaskBaseTypeEnum TASK_TYPE = TaskBaseTypeEnum.PRE_ALERT;
/// <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>
public override async Task<DataResult> CreateMultipleTaskAsync(TaskCreationRequest request, bool useTransaction = true)
{
var orders = request.ExtraData as List<SeaExportRes>;
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));
}
}
///// <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);
//}
}
}