|
|
|
@ -119,6 +119,10 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<TaskCautionNoticeInfo> _taskCautionNoticeInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskCautionNoticeDetailInfo> _taskCautionNoticeDetailInfoRepository;
|
|
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<TaskRouteChangeAdvisoryInfo> _taskRouteChangeAdvisoryInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> _taskRouteChangeAdvisoryDetailInfoRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
|
|
|
|
|
private readonly ISysCacheService _cache;
|
|
|
|
|
private readonly ILogger<BookingOrderService> _logger;
|
|
|
|
@ -182,6 +186,8 @@ namespace Myshipping.Application
|
|
|
|
|
SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> taskPODDischargeGateoutFullDetailInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskCautionNoticeInfo> taskCautionNoticeInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskCautionNoticeDetailInfo> taskCautionNoticeDetailInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskRouteChangeAdvisoryInfo> taskRouteChangeAdvisoryInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> taskRouteChangeAdvisoryDetailInfoRepository,
|
|
|
|
|
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
|
|
|
|
|
IDjyWebsiteAccountConfigService webAccountConfig,
|
|
|
|
|
ISysCacheService cache,
|
|
|
|
@ -250,6 +256,9 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
_taskCautionNoticeInfoRepository = taskCautionNoticeInfoRepository;
|
|
|
|
|
_taskCautionNoticeDetailInfoRepository = taskCautionNoticeDetailInfoRepository;
|
|
|
|
|
|
|
|
|
|
_taskRouteChangeAdvisoryInfoRepository = taskRouteChangeAdvisoryInfoRepository;
|
|
|
|
|
_taskRouteChangeAdvisoryDetailInfoRepository = taskRouteChangeAdvisoryDetailInfoRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 创建任务
|
|
|
|
@ -476,6 +485,12 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
fileCategory = TaskFileCategoryEnum.SI_SUBMITTED.ToString();
|
|
|
|
|
}
|
|
|
|
|
else if (TaskBaseTypeEnum.ROUTE_CUT_CHANGE.ToString() == taskInfo.TASK_BASE_TYPE)
|
|
|
|
|
{
|
|
|
|
|
attachFileType = "advisoryfiles";
|
|
|
|
|
|
|
|
|
|
fileCategory = TaskFileCategoryEnum.ADVISORY.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var noExtensionFileName = Path.GetFileNameWithoutExtension(file.FileName);
|
|
|
|
|
var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, noExtensionFileName,
|
|
|
|
@ -1495,7 +1510,36 @@ namespace Myshipping.Application
|
|
|
|
|
#region 航线船舶截止时间调整的通知
|
|
|
|
|
if (info.Main.TaskType == TaskBaseTypeEnum.ROUTE_CUT_CHANGE)
|
|
|
|
|
{
|
|
|
|
|
TaskRouteChangeAdvisoryInfo taskRouteChangeAdvisoryInfo = info.Main.RouteChangeAdvisoryInfo.Adapt<TaskRouteChangeAdvisoryInfo>();
|
|
|
|
|
|
|
|
|
|
taskRouteChangeAdvisoryInfo.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
taskRouteChangeAdvisoryInfo.TASK_ID = taskInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
taskRouteChangeAdvisoryInfo.CreatedTime = taskInfo.CreatedTime;
|
|
|
|
|
taskRouteChangeAdvisoryInfo.UpdatedTime = taskInfo.CreatedTime;
|
|
|
|
|
|
|
|
|
|
taskRouteChangeAdvisoryInfo.CreatedUserId = taskInfo.CreatedUserId;
|
|
|
|
|
taskRouteChangeAdvisoryInfo.CreatedUserName = taskInfo.CreatedUserName;
|
|
|
|
|
taskRouteChangeAdvisoryInfo.TenantId = taskInfo.TenantId;
|
|
|
|
|
taskRouteChangeAdvisoryInfo.TenantName = taskInfo.TenantName;
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(taskRouteChangeAdvisoryInfo.READ_PORTLOAD))
|
|
|
|
|
{
|
|
|
|
|
var portList = _cache.GetAllCodePortLoad().GetAwaiter().GetResult();
|
|
|
|
|
|
|
|
|
|
if (portList != null && portList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var portInfo = portList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.EnName) && a.EnName.Equals(taskRouteChangeAdvisoryInfo.READ_PORTLOAD,StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
if (portInfo != null)
|
|
|
|
|
{
|
|
|
|
|
taskRouteChangeAdvisoryInfo.PORTLOADID = portInfo?.EdiCode;
|
|
|
|
|
taskRouteChangeAdvisoryInfo.PORTLOAD = portInfo?.EnName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _taskRouteChangeAdvisoryInfoRepository.InsertAsync(taskRouteChangeAdvisoryInfo);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -5951,6 +5995,42 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 创建Advisory任务
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 创建Advisory任务
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="file">文件</param>
|
|
|
|
|
/// <param name="jsonData">BC任务详情JSON</param>
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
[HttpPost("/TaskManage/CreateAdvisoryTaskJob"), AllowAnonymous, ApiUser(ApiCode = "BCTaskManage")]
|
|
|
|
|
public async Task<TaskManageOrderResultDto> CreateAdvisoryTaskJob(IFormFile file, IFormFile modifyFile, string jsonData)
|
|
|
|
|
{
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 接收到创建任务报文 报文={msg}", batchNo, jsonData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
TaskManageOrderMessageInfo info = JSON.Deserialize<TaskManageOrderMessageInfo>(jsonData);
|
|
|
|
|
|
|
|
|
|
if (info == null)
|
|
|
|
|
throw Oops.Bah("jsonData请求内容错误,无法反序列化报文");
|
|
|
|
|
|
|
|
|
|
result = await InitTaskJob(info, batchNo, file, null);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = $"请求任务异常,{ex.Message}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 获取文件类型
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取文件类型
|
|
|
|
|