修改订舱的EDI,增加签单方式映射

optimize
jianghaiqing 2 years ago
parent 2af6101856
commit 51a581414b

@ -4002,6 +4002,38 @@ namespace Myshipping.Application
primaryModel.SERVICEEDICODE = currServiceInfo.MapCode?.Trim(); primaryModel.SERVICEEDICODE = currServiceInfo.MapCode?.Trim();
} }
//签单方式EDI
var baseIssueTypeList = _cache.GetAllCodeIssueType().GetAwaiter().GetResult();
var baseIssueTypeInfo = baseIssueTypeList.FirstOrDefault(t =>
t.EnName.Equals(order.ISSUETYPE, StringComparison.OrdinalIgnoreCase));
if (baseServiceInfo == null)
throw Oops.Bah($"签单方式{order.ISSUETYPE}的基础代码未找到");
//付费方式映射
var ediIssueTypeList = _cache.GetAllMappingIssueType().GetAwaiter().GetResult()
.Where(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase)
).ToList();
if (!string.IsNullOrWhiteSpace(order.ISSUETYPE))
{
var currIssueTypeInfo = ediIssueTypeList.FirstOrDefault(t => !string.IsNullOrWhiteSpace(t.CarrierCode)
&& t.CarrierCode.Equals(order.CARRIERID, StringComparison.OrdinalIgnoreCase)
&& t.Code.Equals(baseServiceInfo.Code, StringComparison.OrdinalIgnoreCase));
if (currIssueTypeInfo == null)
{
//如果没有对应的船司记录,则取默认的第一个代码对应的记录
currIssueTypeInfo = ediIssueTypeList.FirstOrDefault(t => t.Code.Equals(baseServiceInfo.Code, StringComparison.OrdinalIgnoreCase));
}
if (currIssueTypeInfo == null)
throw Oops.Bah($"签单方式{order.ISSUETYPE}的EDI代码未找到");
primaryModel.ISSUETYPE = currIssueTypeInfo.MapCode?.Trim();
}
primaryModel.CARRIEREDICODE = ediSOSICfg.MapCode; primaryModel.CARRIEREDICODE = ediSOSICfg.MapCode;
primaryModel.ORDERNO = order.BOOKINGNO; primaryModel.ORDERNO = order.BOOKINGNO;

@ -72,7 +72,10 @@ namespace Myshipping.Core.Entity.CommonDB
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
} }

@ -1112,6 +1112,11 @@
备注 备注
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Entity.CommonDB.MappingIssueType.CarrierCode">
<summary>
船司代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeLane.Code"> <member name="P:Myshipping.Core.Entity.CodeLane.Code">
<summary> <summary>
航线代码 航线代码

Loading…
Cancel
Save