|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
using DS.WMS.Core.Info.Interface;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos.TaskInteraction;
|
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
|
using DS.WMS.Core.Op.Interface.TaskInteraction;
|
|
|
|
|
using DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor;
|
|
|
|
|
using DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking;
|
|
|
|
|
using Masuit.Tools;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionSelector
|
|
|
|
@ -16,16 +18,25 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionSelector
|
|
|
|
|
|
|
|
|
|
public async Task<IActionExecutor> GetActionExecutor(ActionExecutionContext context)
|
|
|
|
|
{
|
|
|
|
|
//var taskService = context.ServiceProvider.GetRequiredService<ITaskService>();
|
|
|
|
|
var clientParamService = context.ServiceProvider.GetRequiredService<IClientParamService>();
|
|
|
|
|
switch (context.TaskInfo.BusinessType)
|
|
|
|
|
{
|
|
|
|
|
case BusinessType.OceanShippingExport:
|
|
|
|
|
var seTaskService = context.ServiceProvider.GetService<ISeaExportTaskService>();
|
|
|
|
|
var order = await seTaskService.AsQueryable(x => x.Id == context.TaskInfo.BusinessId).Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.BookingNo,
|
|
|
|
|
x.MBLNO
|
|
|
|
|
}).FirstAsync();
|
|
|
|
|
//订单已有订舱编号或提单号,则跳过订舱动作执行
|
|
|
|
|
if (order != null && (!order.BookingNo.IsNullOrEmpty() || !order.MBLNO.IsNullOrEmpty()))
|
|
|
|
|
return new DefaultActionExecutor();
|
|
|
|
|
|
|
|
|
|
//if (await taskService.ExistsAsync(x => x.TaskType == TaskBaseTypeEnum.WAIT_BC &&
|
|
|
|
|
// x.BusinessId == context.TaskInfo.BusinessId && x.BusinessType == context.TaskInfo.BusinessType))
|
|
|
|
|
//{
|
|
|
|
|
// //存在订舱确认,跳过订舱环节
|
|
|
|
|
// return new DefaultActionExecutor();
|
|
|
|
|
//}
|
|
|
|
|
break;
|
|
|
|
|
case BusinessType.OceanShippingImport:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var clientParamService = context.ServiceProvider.GetRequiredService<IClientParamService>();
|
|
|
|
|
var param = await clientParamService.GetParamAsync<string>(context.TaskInfo.BusinessId, Booking_Route,
|
|
|
|
|
(x, y) => x.CustomerId == y.ForwarderId);
|
|
|
|
|
if (string.IsNullOrEmpty(param.Value))
|
|
|
|
|