|
|
|
@ -1,10 +1,12 @@
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.Module.Core.Helpers;
|
|
|
|
|
using DS.WMS.Core.Flow.Dtos;
|
|
|
|
|
using DS.WMS.Core.Flow.Entity;
|
|
|
|
|
using DS.WMS.Core.Flow.Interface;
|
|
|
|
|
using DS.WMS.Core.Flow.Method;
|
|
|
|
|
using DS.WMS.Core.Info.Interface;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos.TaskInteraction;
|
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
|
using DS.WMS.Core.Op.Entity.TaskInteraction;
|
|
|
|
@ -19,6 +21,7 @@ using Masuit.Tools;
|
|
|
|
|
using Masuit.Tools.Systems;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using static DS.WMS.Core.Op.Method.TaskInteraction.ActionSelector.BookingSelector;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
{
|
|
|
|
@ -65,6 +68,11 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected ISeaExportService OpService { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 客户端参数服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected IClientParamService ClientParamService { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化
|
|
|
|
|
/// </summary>
|
|
|
|
@ -77,6 +85,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
FlowService = provider.GetRequiredService<IClientFlowInstanceService>();
|
|
|
|
|
ActionService = provider.GetRequiredService<IActionManagerService>();
|
|
|
|
|
OpService = provider.GetRequiredService<ISeaExportService>();
|
|
|
|
|
ClientParamService = provider.GetRequiredService<IClientParamService>();
|
|
|
|
|
|
|
|
|
|
TenantDb.QueryFilter.Clear<IOrgId>();
|
|
|
|
|
}
|
|
|
|
@ -373,7 +382,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
};
|
|
|
|
|
if (!task.NextType.HasValue)
|
|
|
|
|
task.NextType = await GetNextTypeAsync(task);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await TenantDb.Insertable(task).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
//审核任务需创建工作流
|
|
|
|
@ -527,7 +536,20 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
if (useTransaction)
|
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
|
|
|
|
|
|
ActionService.TriggerActionAsync(task);
|
|
|
|
|
if (task.TaskStatus == TaskStatusEnum.Complete)//目前限制任务完成才触发
|
|
|
|
|
{
|
|
|
|
|
Dictionary<string, object>? dic = null;
|
|
|
|
|
if (request.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
dic = new Dictionary<string, object>();
|
|
|
|
|
var param = await ClientParamService.GetParamAsync<string>(task.BusinessId, Booking_Route,
|
|
|
|
|
(x, y) => x.CustomerId == y.ForwarderId);
|
|
|
|
|
dic[TaskFlowDataNameConst.ClientParam] = param;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ActionService.TriggerActionAsync(task, additionalData: dic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult<TaskBaseTypeEnum?>.Success(task.TaskStatus == TaskStatusEnum.Complete ? await GetNextTypeAsync(task) : null);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|