From 2af61018560be0edfedaa7a06c7aa6eed2c0ee98 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 25 Apr 2023 15:09:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AD=BE=E5=8D=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Core/Entity/CommonDB/CodeIssueType.cs | 5 ++++- Myshipping.Core/Myshipping.Core.xml | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs b/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs index 6cb0fdaf..f6f7bb9c 100644 --- a/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs +++ b/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs @@ -62,7 +62,10 @@ namespace Myshipping.Core.Entity.CommonDB /// public string MapName { get; set; } - + /// + /// 映射代码 + /// + public string MapCode { get; set; } /// /// 备注 diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 5a845f82..a92fe94a 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -1102,6 +1102,11 @@ 映射名称 + + + 映射代码 + + 备注 From 2aa30a657e390618f640372254511671345934c2 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Tue, 25 Apr 2023 15:46:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?vgm=E7=AE=B1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 6ae579a2..58752d09 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -3304,7 +3304,7 @@ namespace Myshipping.Application { ChengZhongZhongLiang = ctn.WEIGHKGS.Value.ToString(), ChengZhongShiJian = ctn.WEIGHDATE, - CTNALL = ctn.CTNALL, + CTNALL = ctn.CTNALL.Replace("'", ""), CNTRNO = ctn.CNTRNO, SEALNO = ctn.SEALNO }); @@ -5431,14 +5431,14 @@ namespace Myshipping.Application 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) { item.CARRIER = CARRIER; } - - + + } var CtnDayNumlist = await GetGoodsStatusList(item.Id); item.CtnDayNum = CtnDayNumlist.Where(x => x.StatusName == "申请箱使").Select(x => x.ExtData).FirstOrDefault(); @@ -5449,11 +5449,11 @@ namespace Myshipping.Application 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>(); 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>(); } var BookingLetteryard = await _repLetterYard.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).FirstAsync(); @@ -5461,7 +5461,7 @@ namespace Myshipping.Application { 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) { item.BookingEDIExt = BookingEDIExt.Adapt(); @@ -5474,12 +5474,12 @@ namespace Myshipping.Application ExtData = t.ExtData }).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>(); 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>(); foreach (var it in childitem.ctnInputs) @@ -5488,7 +5488,7 @@ namespace Myshipping.Application it.ctnDetailInputs = ctnDetailInputs.Adapt>(); } - 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) { childitem.BookingEDIExt = childBookingEDIExt.Adapt(); From 51a581414b4fb3896d82d9d1e768b3ff4946bf8c Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 25 Apr 2023 16:09:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E8=88=B1?= =?UTF-8?q?=E7=9A=84EDI=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=AD=BE=E5=8D=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 32 +++++++++++++++++++ .../Entity/CommonDB/CodeIssueType.cs | 5 ++- Myshipping.Core/Myshipping.Core.xml | 5 +++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 6ae579a2..a2c1b148 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -4002,6 +4002,38 @@ namespace Myshipping.Application 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.ORDERNO = order.BOOKINGNO; diff --git a/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs b/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs index f6f7bb9c..63410ff0 100644 --- a/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs +++ b/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs @@ -72,7 +72,10 @@ namespace Myshipping.Core.Entity.CommonDB /// public string Remark { get; set; } - + /// + /// 船司代码 + /// + public string CarrierCode { get; set; } } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index a92fe94a..a66e5950 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -1112,6 +1112,11 @@ 备注 + + + 船司代码 + + 航线代码