修改SITC

master^2
jianghaiqing 3 days ago
parent abbcbed49b
commit d8000c33f2

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

@ -9750,6 +9750,11 @@
公开数据:获取箱型映射代码 公开数据:获取箱型映射代码
</summary> </summary>
</member> </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"> <member name="P:Myshipping.Core.Service.CommonDB.Dto.CodeCarrierDto.Code">
<summary> <summary>
代码 代码

Loading…
Cancel
Save