|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using Furion;
|
|
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
|
|
|
using Furion;
|
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
|
using Furion.DistributedIDGenerator;
|
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
@ -82,6 +83,8 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly IDjyCustomerService _djyCustomerService;
|
|
|
|
|
private readonly INamedServiceProvider<IBookingMSKAPIService> _namedBookingMSKAPIServiceProvider;
|
|
|
|
|
private readonly IDjyTenantParamService _djyTenantParamService;
|
|
|
|
|
private readonly ICommonDBService _commonDBService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly INamedServiceProvider<IBookingSlotService> _namedBookingSlotServiceProvider;
|
|
|
|
|
|
|
|
|
@ -126,7 +129,7 @@ namespace Myshipping.Application
|
|
|
|
|
SqlSugarRepository<BookingSlotAllocation> bookingSlotAllocationRepository,
|
|
|
|
|
SqlSugarRepository<BookingSlotAllocationCtn> bookingSlotAllocationCtnRepository,
|
|
|
|
|
SqlSugarRepository<BookingOrderContact> bookingOrderContactRepository,
|
|
|
|
|
SqlSugarRepository<BookingSlotCompare> bookingSlotCompareRepository)
|
|
|
|
|
SqlSugarRepository<BookingSlotCompare> bookingSlotCompareRepository, ICommonDBService commonDBService)
|
|
|
|
|
{
|
|
|
|
|
_taskBaseRepository = taskBaseRepository;
|
|
|
|
|
_taskBCInfoRepository = taskBCInfoRepository;
|
|
|
|
@ -153,6 +156,7 @@ namespace Myshipping.Application
|
|
|
|
|
_namedBookingMSKAPIServiceProvider = namedBookingMSKAPIServiceProvider;
|
|
|
|
|
_namedBookingSlotServiceProvider = namedBookingSlotServiceProvider;
|
|
|
|
|
_djyTenantParamService = djyTenantParamService;
|
|
|
|
|
_commonDBService = commonDBService;
|
|
|
|
|
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
@ -4041,27 +4045,60 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 同步更新船名基础表
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 同步更新船名基础表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="taskPKId">BC任务主键</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<TaskManageOrderResultDto> SyncDjyVesselInfo(string taskPKId)
|
|
|
|
|
{
|
|
|
|
|
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPKId);
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
if (taskBase == null)
|
|
|
|
|
throw Oops.Oh($"任务主键{taskPKId}无法获取业务信息");
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var taskBase = _taskBaseRepository.AsQueryable().Filter(null,true).First(a => a.PK_ID == taskPKId);
|
|
|
|
|
|
|
|
|
|
var taskBCInfo = _taskBCInfoRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
|
|
|
|
|
if (taskBase == null)
|
|
|
|
|
throw Oops.Oh($"任务主键{taskPKId}无法获取业务信息");
|
|
|
|
|
|
|
|
|
|
if (taskBCInfo == null)
|
|
|
|
|
throw Oops.Oh($"BC任务主键{taskPKId}无法获取业务信息");
|
|
|
|
|
var taskBCInfo = _taskBCInfoRepository.AsQueryable().Filter(null, true).First(a => a.TASK_ID == taskBase.PK_ID);
|
|
|
|
|
|
|
|
|
|
if (taskBCInfo == null)
|
|
|
|
|
throw Oops.Oh($"BC任务主键{taskPKId}无法获取业务信息");
|
|
|
|
|
|
|
|
|
|
if(!string.IsNullOrWhiteSpace(taskBCInfo.VESSEL))
|
|
|
|
|
{
|
|
|
|
|
var syncRlt = await _commonDBService.SyncVessel(new Core.Service.CommonDB.Dto.CodeVesselDto { Name = taskBCInfo.VESSEL });
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(syncRlt))
|
|
|
|
|
{
|
|
|
|
|
result.succ = true;
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
_logger.LogInformation($"任务BC MBLNO:{taskBCInfo.MBL_NO} 同步船名成功 新增船名{taskBCInfo.VESSEL}");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = syncRlt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = "BC的船名为空";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = $"同步船名到船名基础表异常,原因:{ex.Message}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|