|
|
|
@ -0,0 +1,41 @@
|
|
|
|
|
using DS.WMS.Core.Op.Dtos;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos.TaskInteraction;
|
|
|
|
|
using DS.WMS.Core.Op.Interface.TaskInteraction;
|
|
|
|
|
using DS.WMS.Core.Op.Interface;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 截单动作
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class ClosingOrderActionExecutor : DefaultActionExecutor
|
|
|
|
|
{
|
|
|
|
|
public override async Task ExecuteAsync(ActionExecutionContext context)
|
|
|
|
|
{
|
|
|
|
|
var opService = context.ServiceProvider.GetRequiredService<ISeaExportService>();
|
|
|
|
|
var taskService = context.ServiceProvider.GetRequiredService<ITaskService>();
|
|
|
|
|
var logService = context.ServiceProvider.GetRequiredService<ITaskLogService>();
|
|
|
|
|
|
|
|
|
|
//发送截单EDI
|
|
|
|
|
var result = await opService.SendBookingOrClosingEDI(new BookingOrClosingEDIOrderReq
|
|
|
|
|
{
|
|
|
|
|
Id = context.TaskInfo.BusinessId,
|
|
|
|
|
UseForwarderCode = false,
|
|
|
|
|
ForwarderCode = string.Empty,
|
|
|
|
|
ForwarderName = string.Empty,
|
|
|
|
|
FileRole = "9",
|
|
|
|
|
SendType = "E",
|
|
|
|
|
Send = true
|
|
|
|
|
});
|
|
|
|
|
//EDI提交未成功
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
await logService.WriteLogAsync(context.TaskInfo, "截单EDI返回结果失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await SetTaskCompleteAsync(context.TaskInfo, taskService, logService);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|