|
|
|
@ -8247,9 +8247,181 @@ namespace Myshipping.Application
|
|
|
|
|
primaryModel.FEETYPE = multiline.FEETYPE;
|
|
|
|
|
primaryModel.PAYABLEEXT = multiline.PAYABLE;
|
|
|
|
|
|
|
|
|
|
ediModel.SITCExt = multiline.Adapt<SITCExtInfo>();
|
|
|
|
|
|
|
|
|
|
//这里做个检查
|
|
|
|
|
#region 映射港口
|
|
|
|
|
//一程装货港
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(multiline.FstPortLoadCode))
|
|
|
|
|
{
|
|
|
|
|
var sameList = portList.Where(a =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(a.EdiCode)
|
|
|
|
|
&& a.EdiCode.Equals(multiline.FstPortLoadCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
.Select(a => a.Code).ToList();
|
|
|
|
|
|
|
|
|
|
if (sameList == null || sameList.Count == 0)
|
|
|
|
|
throw Oops.Bah($"一程装货港{multiline.FstPortLoadCode}基础港口代码未找到");
|
|
|
|
|
|
|
|
|
|
var currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code)
|
|
|
|
|
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
|
|
|
|
|
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
{
|
|
|
|
|
currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
throw Oops.Bah($"一程装货港{multiline.FstPortLoadCode}的映射EDI代码未找到");
|
|
|
|
|
|
|
|
|
|
multiline.FstPortLoadCode = currPortInfo.MapCode?.Trim();
|
|
|
|
|
multiline.FstPortLoad = currPortInfo.MapName?.Trim();
|
|
|
|
|
}
|
|
|
|
|
//一程卸货港
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(multiline.FstPortDischargeCode))
|
|
|
|
|
{
|
|
|
|
|
var sameList = portList.Where(a =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(a.EdiCode)
|
|
|
|
|
&& a.EdiCode.Equals(multiline.FstPortDischargeCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
.Select(a => a.Code).ToList();
|
|
|
|
|
|
|
|
|
|
if (sameList == null || sameList.Count == 0)
|
|
|
|
|
throw Oops.Bah($"一程卸货港{multiline.FstPortDischargeCode}基础港口代码未找到");
|
|
|
|
|
|
|
|
|
|
var currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code)
|
|
|
|
|
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
|
|
|
|
|
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
{
|
|
|
|
|
currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
throw Oops.Bah($"一程卸货港{multiline.FstPortDischargeCode}的映射EDI代码未找到");
|
|
|
|
|
|
|
|
|
|
multiline.FstPortDischargeCode = currPortInfo.MapCode?.Trim();
|
|
|
|
|
multiline.FstPortDischarge = currPortInfo.MapName?.Trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//二程装货港
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(multiline.SecPortLoadCode))
|
|
|
|
|
{
|
|
|
|
|
var sameList = portList.Where(a =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(a.EdiCode)
|
|
|
|
|
&& a.EdiCode.Equals(multiline.SecPortLoadCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
.Select(a => a.Code).ToList();
|
|
|
|
|
|
|
|
|
|
if (sameList == null || sameList.Count == 0)
|
|
|
|
|
throw Oops.Bah($"二程装货港{multiline.SecPortLoadCode}基础港口代码未找到");
|
|
|
|
|
|
|
|
|
|
var currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code)
|
|
|
|
|
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
|
|
|
|
|
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
{
|
|
|
|
|
currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
throw Oops.Bah($"二程装货港{multiline.SecPortLoadCode}的映射EDI代码未找到");
|
|
|
|
|
|
|
|
|
|
multiline.SecPortLoadCode = currPortInfo.MapCode?.Trim();
|
|
|
|
|
multiline.SecPortLoad = currPortInfo.MapName?.Trim();
|
|
|
|
|
}
|
|
|
|
|
//二程卸货港
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(multiline.SecPortDischargeCode))
|
|
|
|
|
{
|
|
|
|
|
var sameList = portList.Where(a =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(a.EdiCode)
|
|
|
|
|
&& a.EdiCode.Equals(multiline.SecPortDischargeCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
.Select(a => a.Code).ToList();
|
|
|
|
|
|
|
|
|
|
if (sameList == null || sameList.Count == 0)
|
|
|
|
|
throw Oops.Bah($"二程卸货港{multiline.SecPortDischargeCode}基础港口代码未找到");
|
|
|
|
|
|
|
|
|
|
var currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code)
|
|
|
|
|
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
|
|
|
|
|
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
{
|
|
|
|
|
currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
throw Oops.Bah($"二程卸货港{multiline.SecPortDischargeCode}的映射EDI代码未找到");
|
|
|
|
|
|
|
|
|
|
multiline.SecPortDischargeCode = currPortInfo.MapCode?.Trim();
|
|
|
|
|
multiline.SecPortDischarge = currPortInfo.MapName?.Trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//三程装货港
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(multiline.ThdPortLoadCode))
|
|
|
|
|
{
|
|
|
|
|
var sameList = portList.Where(a =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(a.EdiCode)
|
|
|
|
|
&& a.EdiCode.Equals(multiline.FstPortLoadCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
.Select(a => a.Code).ToList();
|
|
|
|
|
|
|
|
|
|
if (sameList == null || sameList.Count == 0)
|
|
|
|
|
throw Oops.Bah($"三程装货港{multiline.ThdPortLoadCode}基础港口代码未找到");
|
|
|
|
|
|
|
|
|
|
var currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code)
|
|
|
|
|
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
|
|
|
|
|
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
{
|
|
|
|
|
currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
throw Oops.Bah($"三程装货港{multiline.ThdPortLoadCode}的映射EDI代码未找到");
|
|
|
|
|
|
|
|
|
|
multiline.ThdPortLoadCode = currPortInfo.MapCode?.Trim();
|
|
|
|
|
multiline.ThdPortLoad = currPortInfo.MapName?.Trim();
|
|
|
|
|
}
|
|
|
|
|
//三程卸货港
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(multiline.ThdPortDischargeCode))
|
|
|
|
|
{
|
|
|
|
|
var sameList = portList.Where(a =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(a.EdiCode)
|
|
|
|
|
&& a.EdiCode.Equals(multiline.ThdPortDischargeCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
.Select(a => a.Code).ToList();
|
|
|
|
|
|
|
|
|
|
if (sameList == null || sameList.Count == 0)
|
|
|
|
|
throw Oops.Bah($"三程卸货港{multiline.ThdPortDischargeCode}基础港口代码未找到");
|
|
|
|
|
|
|
|
|
|
var currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code)
|
|
|
|
|
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
|
|
|
|
|
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
{
|
|
|
|
|
currPortInfo = ediPortList.FirstOrDefault(a =>
|
|
|
|
|
sameList.Contains(a.Code));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currPortInfo == null)
|
|
|
|
|
throw Oops.Bah($"三程卸货港{multiline.ThdPortDischargeCode}的映射EDI代码未找到");
|
|
|
|
|
|
|
|
|
|
multiline.ThdPortDischargeCode = currPortInfo.MapCode?.Trim();
|
|
|
|
|
multiline.ThdPortDischarge = currPortInfo.MapName?.Trim();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
ediModel.SITCExt = multiline.Adapt<SITCExtInfo>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|