|
|
|
@ -1422,6 +1422,101 @@ namespace Myshipping.Application
|
|
|
|
|
bkModel.VOYNOINNER = taskBCInfo.CARRIER_VOYNO;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//增加装货港、卸货港的对应
|
|
|
|
|
// 解析收货地,得到装货港名称及五字码
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(taskBCInfo.PLACERECEIPT))
|
|
|
|
|
{
|
|
|
|
|
var portEnName = taskBCInfo.PLACERECEIPT.Split(',')[0]?.Trim();
|
|
|
|
|
|
|
|
|
|
//这里CMA的收货地全称放在了括号里面
|
|
|
|
|
if (taskBCInfo.CARRIERID.Equals("CMA", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(taskBCInfo.PLACERECEIPT))
|
|
|
|
|
taskBCInfo.PLACERECEIPT = taskBCInfo.PLACERECEIPT.Replace("(", "(").Replace(")", ")");
|
|
|
|
|
|
|
|
|
|
if (taskBCInfo.PLACERECEIPT.IndexOf("(") >= 0)
|
|
|
|
|
{
|
|
|
|
|
string currStr = Regex.Match(taskBCInfo.PLACERECEIPT, "(?<=\\().*(?=\\))").Value?.Trim();
|
|
|
|
|
|
|
|
|
|
portEnName = currStr.Split(',')[0]?.Trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName))
|
|
|
|
|
{
|
|
|
|
|
var cachePortLoad = await _cache.GetAllCodePortLoad();
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceReceiptToPortload(portEnName, cachePortLoad, () => _cache.GetAllMappingPortLoad());
|
|
|
|
|
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("通过收货地城市名称未匹配到港口信息,订舱编号:{MBL_NO}", taskBCInfo.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bkModel.PORTLOAD = portInfo.EnName;
|
|
|
|
|
bkModel.PORTLOADID = portInfo.EdiCode;
|
|
|
|
|
|
|
|
|
|
bkModel.PLACERECEIPT = portInfo.EnName;
|
|
|
|
|
bkModel.PLACERECEIPTID = portInfo.EdiCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("收货地分割后得到的城市名称为空,订舱编号:{MBL_NO}", taskBCInfo.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("收货地为空,订舱编号:{MBL_NO}", taskBCInfo.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
// 解析交货地,得到为卸货港名称及五字码, 以及国家信息
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(taskBCInfo.PLACEDELIVERY))
|
|
|
|
|
{
|
|
|
|
|
var portEnName = taskBCInfo.PLACEDELIVERY.Split(',')[0]?.Trim();
|
|
|
|
|
|
|
|
|
|
//这里CMA的收货地全称放在了括号里面
|
|
|
|
|
if (taskBCInfo.CARRIERID.Equals("CMA", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(taskBCInfo.PLACEDELIVERY))
|
|
|
|
|
taskBCInfo.PLACEDELIVERY = taskBCInfo.PLACEDELIVERY.Replace("(", "(").Replace(")", ")");
|
|
|
|
|
|
|
|
|
|
if (taskBCInfo.PLACEDELIVERY.IndexOf("(") >= 0)
|
|
|
|
|
{
|
|
|
|
|
string currStr = Regex.Match(taskBCInfo.PLACEDELIVERY, "(?<=\\().*(?=\\))").Value?.Trim();
|
|
|
|
|
|
|
|
|
|
portEnName = currStr.Split(',')[0]?.Trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName))
|
|
|
|
|
{
|
|
|
|
|
var cachePort = await _cache.GetAllCodePort();
|
|
|
|
|
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceDeliveryToPort(portEnName, cachePort, () => _cache.GetAllMappingPort());
|
|
|
|
|
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("通过交货地城市名称未匹配到港口信息,订舱编号:{MBL_NO}", taskBCInfo.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bkModel.PORTDISCHARGE = portInfo.EnName;
|
|
|
|
|
bkModel.PORTDISCHARGEID = portInfo.EdiCode;
|
|
|
|
|
|
|
|
|
|
bkModel.PLACEDELIVERY = portInfo.EnName;
|
|
|
|
|
bkModel.PLACEDELIVERYID = portInfo.EdiCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("交货地分割后得到的城市名称为空,订舱编号:{MBL_NO}", taskBCInfo.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("交货地为空,订舱编号:{MBL_NO}", taskBCInfo.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList();
|
|
|
|
|
|
|
|
|
@ -2793,6 +2888,103 @@ namespace Myshipping.Application
|
|
|
|
|
ctnInputs = new List<BookingCtnDto>()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//增加装货港、卸货港的对应
|
|
|
|
|
// 解析收货地,得到装货港名称及五字码
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(bcOrder.PLACERECEIPT))
|
|
|
|
|
{
|
|
|
|
|
var portEnName = bcOrder.PLACERECEIPT.Split(',')[0]?.Trim();
|
|
|
|
|
|
|
|
|
|
//这里CMA的收货地全称放在了括号里面
|
|
|
|
|
if (bcOrder.CARRIERID.Equals("CMA", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(bcOrder.PLACERECEIPT))
|
|
|
|
|
bcOrder.PLACERECEIPT = bcOrder.PLACERECEIPT.Replace("(", "(").Replace(")", ")");
|
|
|
|
|
|
|
|
|
|
if (bcOrder.PLACERECEIPT.IndexOf("(") >= 0)
|
|
|
|
|
{
|
|
|
|
|
string currStr = Regex.Match(bcOrder.PLACERECEIPT, "(?<=\\().*(?=\\))").Value?.Trim();
|
|
|
|
|
|
|
|
|
|
portEnName = currStr.Split(',')[0]?.Trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName))
|
|
|
|
|
{
|
|
|
|
|
var cachePortLoad = await _cache.GetAllCodePortLoad();
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceReceiptToPortload(portEnName, cachePortLoad, () => _cache.GetAllMappingPortLoad());
|
|
|
|
|
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("通过收货地城市名称未匹配到港口信息,订舱编号:{MBL_NO}", bcOrder.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bkModel.PORTLOAD = portInfo.EnName;
|
|
|
|
|
bkModel.PORTLOADID = portInfo.EdiCode;
|
|
|
|
|
|
|
|
|
|
bkModel.PLACERECEIPT = portInfo.EnName;
|
|
|
|
|
bkModel.PLACERECEIPTID = portInfo.EdiCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("收货地分割后得到的城市名称为空,订舱编号:{MBL_NO}", bcOrder.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("收货地为空,订舱编号:{MBL_NO}", bcOrder.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
// 解析交货地,得到为卸货港名称及五字码, 以及国家信息
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(bcOrder.PLACEDELIVERY))
|
|
|
|
|
{
|
|
|
|
|
var portEnName = bcOrder.PLACEDELIVERY.Split(',')[0]?.Trim();
|
|
|
|
|
|
|
|
|
|
//这里CMA的收货地全称放在了括号里面
|
|
|
|
|
if (bcOrder.CARRIERID.Equals("CMA", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(bcOrder.PLACEDELIVERY))
|
|
|
|
|
bcOrder.PLACEDELIVERY = bcOrder.PLACEDELIVERY.Replace("(", "(").Replace(")", ")");
|
|
|
|
|
|
|
|
|
|
if (bcOrder.PLACEDELIVERY.IndexOf("(") >= 0)
|
|
|
|
|
{
|
|
|
|
|
string currStr = Regex.Match(bcOrder.PLACEDELIVERY, "(?<=\\().*(?=\\))").Value?.Trim();
|
|
|
|
|
|
|
|
|
|
portEnName = currStr.Split(',')[0]?.Trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName))
|
|
|
|
|
{
|
|
|
|
|
var cachePort = await _cache.GetAllCodePort();
|
|
|
|
|
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceDeliveryToPort(portEnName, cachePort, () => _cache.GetAllMappingPort());
|
|
|
|
|
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("通过交货地城市名称未匹配到港口信息,订舱编号:{MBL_NO}", bcOrder.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bkModel.PORTDISCHARGE = portInfo.EnName;
|
|
|
|
|
bkModel.PORTDISCHARGEID = portInfo.EdiCode;
|
|
|
|
|
|
|
|
|
|
bkModel.PLACEDELIVERY = portInfo.EnName;
|
|
|
|
|
bkModel.PLACEDELIVERYID = portInfo.EdiCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("交货地分割后得到的城市名称为空,订舱编号:{MBL_NO}", bcOrder.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("交货地为空,订舱编号:{MBL_NO}", bcOrder.MBL_NO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder err = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
if(string.IsNullOrWhiteSpace(bcOrder.MBL_NO))
|
|
|
|
@ -2847,6 +3039,16 @@ namespace Myshipping.Application
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.CLOSINGDATE));
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.CLOSEDOCDATE));
|
|
|
|
|
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PORTDISCHARGE));
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PORTDISCHARGEID));
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PLACEDELIVERY));
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PLACEDELIVERYID));
|
|
|
|
|
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PORTLOAD));
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PORTLOADID));
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PLACERECEIPT));
|
|
|
|
|
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.PLACERECEIPTID));
|
|
|
|
|
|
|
|
|
|
var taskBCCtnList = _taskBCCTNInfoRepository.AsQueryable().Filter(null, true).Where(a => a.P_ID == bcOrder.PK_ID && a.TenantId == UserManager.TENANT_ID).ToList();
|
|
|
|
|
|
|
|
|
|
var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList();
|
|
|
|
@ -3840,15 +4042,24 @@ namespace Myshipping.Application
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 同步更新船期表
|
|
|
|
|
/// 同步更新船名基础表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="taskPKId">BC任务主键</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<TaskManageOrderResultDto> SyncDjyVesselInfo(string taskPKId)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
将BC的船名、航次、开船日期、装货港、卸货港写入船期表
|
|
|
|
|
*/
|
|
|
|
|
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPKId);
|
|
|
|
|
|
|
|
|
|
if (taskBase == null)
|
|
|
|
|
throw Oops.Oh($"任务主键{taskPKId}无法获取业务信息");
|
|
|
|
|
|
|
|
|
|
var taskBCInfo = _taskBCInfoRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
|
|
|
|
|
|
|
|
|
|
if (taskBCInfo == null)
|
|
|
|
|
throw Oops.Oh($"BC任务主键{taskPKId}无法获取业务信息");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|