wet 2 years ago
commit c7fb0cd358

@ -3304,7 +3304,7 @@ namespace Myshipping.Application
{ {
ChengZhongZhongLiang = ctn.WEIGHKGS.Value.ToString(), ChengZhongZhongLiang = ctn.WEIGHKGS.Value.ToString(),
ChengZhongShiJian = ctn.WEIGHDATE, ChengZhongShiJian = ctn.WEIGHDATE,
CTNALL = ctn.CTNALL, CTNALL = ctn.CTNALL.Replace("'", ""),
CNTRNO = ctn.CNTRNO, CNTRNO = ctn.CNTRNO,
SEALNO = ctn.SEALNO SEALNO = ctn.SEALNO
}); });
@ -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;
@ -5431,7 +5463,7 @@ namespace Myshipping.Application
if (!string.IsNullOrEmpty(item.CARRIERID)) if (!string.IsNullOrEmpty(item.CARRIERID))
{ {
var CARRIER = _cache.GetAllCodeCarrier().Result.Where(x =>x.Code == item.CARRIERID).Select(x => x.CnName).FirstOrDefault(); var CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == item.CARRIERID).Select(x => x.CnName).FirstOrDefault();
if (CARRIER != null) if (CARRIER != null)
{ {
@ -5449,11 +5481,11 @@ namespace Myshipping.Application
item.ISSUETYPE = ISSUETYPE; item.ISSUETYPE = ISSUETYPE;
} }
var ctn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == item.Id ).ToListAsync(); var ctn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == item.Id).ToListAsync();
item.ctnInputs = ctn.Adapt<List<BookingCtnDto>>(); item.ctnInputs = ctn.Adapt<List<BookingCtnDto>>();
foreach (var it in item.ctnInputs) foreach (var it in item.ctnInputs)
{ {
var ctnDetailInputs = await _ctndetailrep.AsQueryable().Filter(null, true).Where(x => x.CTNID == it.Id ).ToListAsync(); var ctnDetailInputs = await _ctndetailrep.AsQueryable().Filter(null, true).Where(x => x.CTNID == it.Id).ToListAsync();
it.ctnDetailInputs = ctnDetailInputs.Adapt<List<BookingCtnDetailDto>>(); it.ctnDetailInputs = ctnDetailInputs.Adapt<List<BookingCtnDetailDto>>();
} }
var BookingLetteryard = await _repLetterYard.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).FirstAsync(); var BookingLetteryard = await _repLetterYard.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).FirstAsync();
@ -5461,7 +5493,7 @@ namespace Myshipping.Application
{ {
item.BookingLetteryard = BookingLetteryard; item.BookingLetteryard = BookingLetteryard;
} }
var BookingEDIExt = await _bookingEDIExt.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id ).FirstAsync(); var BookingEDIExt = await _bookingEDIExt.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).FirstAsync();
if (BookingEDIExt != null) if (BookingEDIExt != null)
{ {
item.BookingEDIExt = BookingEDIExt.Adapt<BookingEDIExtDto>(); item.BookingEDIExt = BookingEDIExt.Adapt<BookingEDIExtDto>();
@ -5474,12 +5506,12 @@ namespace Myshipping.Application
ExtData = t.ExtData ExtData = t.ExtData
}).Distinct().ToListAsync(); }).Distinct().ToListAsync();
var childrens = await _rep.AsQueryable().Filter(null, true).Where(x => x.ParentId == item.Id && x.TenantId == UserManager.TENANT_ID).ToListAsync(); var childrens = await _rep.AsQueryable().Filter(null, true).Where(x => x.ParentId == item.Id && x.TenantId == UserManager.TENANT_ID).ToListAsync();
item.childrens = childrens.Adapt<List<Children>>(); item.childrens = childrens.Adapt<List<Children>>();
foreach (var childitem in item.childrens) foreach (var childitem in item.childrens)
{ {
var ctnInputs = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == childitem.Id ).ToListAsync(); var ctnInputs = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == childitem.Id).ToListAsync();
childitem.ctnInputs = ctnInputs.Adapt<List<BookingCtnDto>>(); childitem.ctnInputs = ctnInputs.Adapt<List<BookingCtnDto>>();
foreach (var it in childitem.ctnInputs) foreach (var it in childitem.ctnInputs)
@ -5488,7 +5520,7 @@ namespace Myshipping.Application
it.ctnDetailInputs = ctnDetailInputs.Adapt<List<BookingCtnDetailDto>>(); it.ctnDetailInputs = ctnDetailInputs.Adapt<List<BookingCtnDetailDto>>();
} }
var childBookingEDIExt = await _bookingEDIExt.AsQueryable().Filter(null, true).Where(x => x.BookingId == childitem.Id ).FirstAsync(); var childBookingEDIExt = await _bookingEDIExt.AsQueryable().Filter(null, true).Where(x => x.BookingId == childitem.Id).FirstAsync();
if (childBookingEDIExt != null) if (childBookingEDIExt != null)
{ {
childitem.BookingEDIExt = childBookingEDIExt.Adapt<BookingEDIExtDto>(); childitem.BookingEDIExt = childBookingEDIExt.Adapt<BookingEDIExtDto>();

@ -62,14 +62,20 @@ namespace Myshipping.Core.Entity.CommonDB
/// </summary> /// </summary>
public string MapName { get; set; } public string MapName { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
} }

@ -1102,11 +1102,21 @@
映射名称 映射名称
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Entity.CommonDB.MappingIssueType.MapCode">
<summary>
映射代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CommonDB.MappingIssueType.Remark"> <member name="P:Myshipping.Core.Entity.CommonDB.MappingIssueType.Remark">
<summary> <summary>
备注 备注
</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