修改SITC

master^2
jianghaiqing 3 days ago
parent abbcbed49b
commit d8000c33f2

@ -8255,122 +8255,246 @@ namespace Myshipping.Application
var currPortInfo = ediLoadPortList.FirstOrDefault(a =>
a.Code.Equals(multiline.FstPortLoadCode, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
throw Oops.Bah($"一程装货港{multiline.FstPortLoadCode}的EDI代码未找到");
if (currPortInfo != null)
{
multiline.FstPortLoadCode = currPortInfo.MapCode?.Trim();
multiline.FstPortLoad = currPortInfo.MapName?.Trim();
}
//一程卸货港
if (!string.IsNullOrWhiteSpace(multiline.FstPortDischargeCode))
else
{
var sameList = portList.Where(a =>
var codePortList = portList.Where(a =>
!string.IsNullOrWhiteSpace(a.EdiCode)
&& a.EdiCode.Equals(multiline.FstPortDischargeCode, StringComparison.OrdinalIgnoreCase))
&& a.EdiCode.Equals(multiline.FstPortLoadCode, 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)
if (codePortList.Count > 0)
{
var currTPortInfo = ediPortList.FirstOrDefault(a =>
codePortList.Contains(a.Code)
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
if (currTPortInfo != null)
{
currPortInfo = ediPortList.FirstOrDefault(a =>
sameList.Contains(a.Code));
multiline.FstPortLoadCode = currTPortInfo.MapCode?.Trim();
multiline.FstPortLoad = currTPortInfo.MapName?.Trim();
}
else
{
throw Oops.Bah($"一程装货港{multiline.FstPortLoadCode}的映射EDI代码未找到");
}
}
else
{
throw Oops.Bah($"一程装货港{multiline.FstPortLoadCode}基础港口代码未找到");
}
}
}
//一程卸货港
if (!string.IsNullOrWhiteSpace(multiline.FstPortDischargeCode))
{
var currPortInfo = ediLoadPortList.FirstOrDefault(a =>
a.Code.Equals(multiline.FstPortDischargeCode, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
throw Oops.Bah($"一程卸货港{multiline.FstPortDischargeCode}的映射EDI代码未找到");
if (currPortInfo != null)
{
multiline.FstPortDischargeCode = currPortInfo.MapCode?.Trim();
multiline.FstPortDischarge = currPortInfo.MapName?.Trim();
}
else
{
var codePortList = portList.Where(a =>
!string.IsNullOrWhiteSpace(a.EdiCode)
&& a.EdiCode.Equals(multiline.FstPortDischargeCode, StringComparison.OrdinalIgnoreCase))
.Select(a => a.Code).ToList();
if (codePortList.Count > 0)
{
var currTPortInfo = ediPortList.FirstOrDefault(a =>
codePortList.Contains(a.Code)
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
if (currTPortInfo != null)
{
multiline.FstPortDischargeCode = currTPortInfo.MapCode?.Trim();
multiline.FstPortDischarge = currTPortInfo.MapName?.Trim();
}
else
{
throw Oops.Bah($"一程卸货港{multiline.FstPortDischargeCode}的映射EDI代码未找到");
}
}
else
{
throw Oops.Bah($"一程卸货港{multiline.FstPortDischargeCode}基础港口代码未找到");
}
}
}
//二程装货港
if (!string.IsNullOrWhiteSpace(multiline.SecPortLoadCode))
{
var currPortInfo = ediLoadPortList.FirstOrDefault(a =>
a.Code.Equals(multiline.SecPortLoadCode, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
throw Oops.Bah($"二程装货港{multiline.SecPortLoadCode}的EDI代码未找到");
if (currPortInfo != null)
{
multiline.SecPortLoadCode = currPortInfo.MapCode?.Trim();
multiline.SecPortLoad = currPortInfo.MapName?.Trim();
}
//二程卸货港
if (!string.IsNullOrWhiteSpace(multiline.SecPortDischargeCode))
else
{
var sameList = portList.Where(a =>
var codePortList = portList.Where(a =>
!string.IsNullOrWhiteSpace(a.EdiCode)
&& a.EdiCode.Equals(multiline.SecPortDischargeCode, StringComparison.OrdinalIgnoreCase))
&& a.EdiCode.Equals(multiline.SecPortLoadCode, 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)
if (codePortList.Count > 0)
{
var currTPortInfo = ediPortList.FirstOrDefault(a =>
codePortList.Contains(a.Code)
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
if (currTPortInfo != null)
{
currPortInfo = ediPortList.FirstOrDefault(a =>
sameList.Contains(a.Code));
multiline.SecPortLoadCode = currTPortInfo.MapCode?.Trim();
multiline.SecPortLoad = currTPortInfo.MapName?.Trim();
}
else
{
throw Oops.Bah($"二程装货港{multiline.FstPortDischargeCode}的映射EDI代码未找到");
}
}
else
{
throw Oops.Bah($"二程装货港{multiline.FstPortDischargeCode}基础港口代码未找到");
}
}
}
//二程卸货港
if (!string.IsNullOrWhiteSpace(multiline.SecPortDischargeCode))
{
var currPortInfo = ediLoadPortList.FirstOrDefault(a =>
a.Code.Equals(multiline.SecPortDischargeCode, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
throw Oops.Bah($"二程卸货港{multiline.SecPortDischargeCode}的映射EDI代码未找到");
if (currPortInfo != null)
{
multiline.SecPortDischargeCode = currPortInfo.MapCode?.Trim();
multiline.SecPortDischarge = currPortInfo.MapName?.Trim();
}
else
{
var codePortList = portList.Where(a =>
!string.IsNullOrWhiteSpace(a.EdiCode)
&& a.EdiCode.Equals(multiline.SecPortDischargeCode, StringComparison.OrdinalIgnoreCase))
.Select(a => a.Code).ToList();
if (codePortList.Count > 0)
{
var currTPortInfo = ediPortList.FirstOrDefault(a =>
codePortList.Contains(a.Code)
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
if (currTPortInfo != null)
{
multiline.SecPortDischargeCode = currTPortInfo.MapCode?.Trim();
multiline.SecPortDischarge = currTPortInfo.MapName?.Trim();
}
else
{
throw Oops.Bah($"二程卸货港{multiline.FstPortDischargeCode}的映射EDI代码未找到");
}
}
else
{
throw Oops.Bah($"二程卸货港{multiline.FstPortDischargeCode}基础港口代码未找到");
}
}
}
//三程装货港
if (!string.IsNullOrWhiteSpace(multiline.ThdPortLoadCode))
{
var currPortInfo = ediLoadPortList.FirstOrDefault(a =>
a.Code.Equals(multiline.ThdPortLoadCode, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
throw Oops.Bah($"三程装货港{multiline.ThdPortLoadCode}的EDI代码未找到");
if (currPortInfo != null)
{
multiline.ThdPortLoadCode = currPortInfo.MapCode?.Trim();
multiline.ThdPortLoad = currPortInfo.MapName?.Trim();
}
//三程卸货港
if (!string.IsNullOrWhiteSpace(multiline.ThdPortDischargeCode))
else
{
var sameList = portList.Where(a =>
var codePortList = portList.Where(a =>
!string.IsNullOrWhiteSpace(a.EdiCode)
&& a.EdiCode.Equals(multiline.ThdPortDischargeCode, StringComparison.OrdinalIgnoreCase))
&& a.EdiCode.Equals(multiline.ThdPortLoadCode, 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)
if (codePortList.Count > 0)
{
var currTPortInfo = ediPortList.FirstOrDefault(a =>
codePortList.Contains(a.Code)
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
if (currTPortInfo != null)
{
currPortInfo = ediPortList.FirstOrDefault(a =>
sameList.Contains(a.Code));
multiline.ThdPortLoadCode = currTPortInfo.MapCode?.Trim();
multiline.ThdPortLoad = currTPortInfo.MapName?.Trim();
}
else
{
throw Oops.Bah($"三程装货港{multiline.FstPortDischargeCode}的映射EDI代码未找到");
}
}
else
{
throw Oops.Bah($"三程装货港{multiline.FstPortDischargeCode}基础港口代码未找到");
}
}
}
//三程卸货港
if (!string.IsNullOrWhiteSpace(multiline.ThdPortDischargeCode))
{
var currPortInfo = ediLoadPortList.FirstOrDefault(a =>
a.Code.Equals(multiline.ThdPortDischargeCode, StringComparison.OrdinalIgnoreCase));
if (currPortInfo == null)
throw Oops.Bah($"三程卸货港{multiline.ThdPortDischargeCode}的映射EDI代码未找到");
if (currPortInfo != null)
{
multiline.ThdPortDischargeCode = currPortInfo.MapCode?.Trim();
multiline.ThdPortDischarge = currPortInfo.MapName?.Trim();
}
else
{
var codePortList = portList.Where(a =>
!string.IsNullOrWhiteSpace(a.EdiCode)
&& a.EdiCode.Equals(multiline.ThdPortDischargeCode, StringComparison.OrdinalIgnoreCase))
.Select(a => a.Code).ToList();
if (codePortList.Count > 0)
{
var currTPortInfo = ediPortList.FirstOrDefault(a =>
codePortList.Contains(a.Code)
&& !string.IsNullOrWhiteSpace(a.CarrierCode)
&& a.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase));
if (currTPortInfo != null)
{
multiline.ThdPortDischargeCode = currTPortInfo.MapCode?.Trim();
multiline.ThdPortDischarge = currTPortInfo.MapName?.Trim();
}
else
{
throw Oops.Bah($"三程卸货港{multiline.FstPortDischargeCode}的映射EDI代码未找到");
}
}
else
{
throw Oops.Bah($"三程卸货港{multiline.FstPortDischargeCode}基础港口代码未找到");
}
}
}
#endregion
ediModel.SITCExt = multiline.Adapt<SITCExtInfo>();
@ -12527,6 +12651,37 @@ namespace Myshipping.Application
{
result.extra2 = record;
}
else
{
record = new BookingMultiLineSplitRecord();
if (!string.IsNullOrWhiteSpace(order.PORTLOADID))
{
record.FstPortLoadCode = order.PORTLOADID;
record.FstPortLoad = order.PORTLOAD;
}
if (!string.IsNullOrWhiteSpace(order.PORTDISCHARGEID))
{
record.FstPortDischargeCode = order.PORTDISCHARGEID;
record.FstPortDischarge = order.PORTDISCHARGE;
}
if (!string.IsNullOrWhiteSpace(order.VESSEL))
{
record.FstVessel = order.VESSEL;
}
if (!string.IsNullOrWhiteSpace(order.VOYNO))
{
record.FstVoyno = order.VOYNO;
}
if (order.ETD.HasValue)
{
record.FstETD = order.ETD.Value;
}
}
return result;
}

@ -9750,6 +9750,11 @@
公开数据:获取箱型映射代码
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.PortMixList(Myshipping.Core.Service.NameQueryDto)">
<summary>
起始港和目的港合并查询
</summary>
</member>
<member name="P:Myshipping.Core.Service.CommonDB.Dto.CodeCarrierDto.Code">
<summary>
代码

Loading…
Cancel
Save