From ebb1ca99dfb8914869ebf47856c9bcdd454ee985 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Wed, 26 Jul 2023 17:51:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?VGM=E7=9B=B4=E5=8F=91=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=88=B9=E5=8F=B8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 6e423735..7eca2815 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -3662,8 +3662,9 @@ namespace Myshipping.Application throw Oops.Bah(BookingErrorCode.BOOK127); } - var config = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "VGM_SEND_CHANNEL"); - if (config != null && config.ItemCode == "USE_MYSHIPPING") //使用大简云发送vgm + var config = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "VgmDirectSendCarrierId"); + var arrCarr = config.ItemCode.Split(",", StringSplitOptions.RemoveEmptyEntries); + if (!arrCarr.Contains(order.CARRIERID)) //使用大简云发送vgm { //ETD不能为空 if (!order.ETD.HasValue) From 612a0d06163f4dcd9b37f731ca60bf5713ac6100 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Thu, 27 Jul 2023 09:18:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B8=AF=E8=81=94=E6=8D=B7=E3=80=81?= =?UTF-8?q?=E6=B8=AF=E8=81=94=E6=AC=A3=E4=B8=8B=E8=B4=A7=E7=BA=B8=E7=AE=B1?= =?UTF-8?q?=E5=B1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EDI/XiahuozhiHelpler.cs | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/EDI/XiahuozhiHelpler.cs b/Myshipping.Application/EDI/XiahuozhiHelpler.cs index 6548900a..50e3dd8d 100644 --- a/Myshipping.Application/EDI/XiahuozhiHelpler.cs +++ b/Myshipping.Application/EDI/XiahuozhiHelpler.cs @@ -9,6 +9,7 @@ using Myshipping.Core; using Myshipping.Core.Entity; using Myshipping.Core.Helper; using Myshipping.Core.Service; +using Myshipping.Core.Service.Dict.Dto; using Newtonsoft.Json.Linq; using NPOI.HSSF.UserModel; using SqlSugar; @@ -171,7 +172,7 @@ namespace Myshipping.Application.EDI // 12:提单号:中转港:目的港:货代代码:船公司:HPL参考号:特殊说明 sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLJ")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{ExchangeStr(order.YARDREMARK)}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注 - //2021-8-17,报文中不能体现英文字符①【:】②【,】,以空格代替 + //2021-8-17,报文中不能体现英文字符①【:】②【,】,以空格代替 /* * 表象:QDAC064651 客户毛重28600 EDI进来28  港联捷回复:是前面货名太长,后面内容截断了,每行不超过255字符就行 @@ -203,7 +204,7 @@ namespace Myshipping.Application.EDI return new KeyValuePair(false, $"箱型({ctn.CTNALL})不匹配(EDI类型:XHZ_GLJ),无法发送下货纸,请联系管理员"); } - sbData.AppendLine($"13:{(order.ISCONTAINERSOC.HasValue && order.ISCONTAINERSOC.Value ? "SOC" : GetCarrierEDICode(order.CARRIERID, "XHZ_GLJ"))}:{ctnFind.Size}:{ctnEdi.MapCode}:{ctn.CTNNUM}:{ExchangeStr(ctn.REMARK)}:N");//箱经营人代码 尺寸 箱型 箱数 备注 加重箱 + sbData.AppendLine($"13:{(order.ISCONTAINERSOC.HasValue && order.ISCONTAINERSOC.Value ? "SOC" : GetCtnForCarrier(order.CARRIERID, "XHZ_GLJ", dictData))}:{ctnFind.Size}:{ctnEdi.MapCode}:{ctn.CTNNUM}:{ExchangeStr(ctn.REMARK)}:N");//箱经营人代码 尺寸 箱型 箱数 备注 加重箱 } Log.Information($"生成下货纸报文:{sbData.ToString()}"); @@ -808,7 +809,7 @@ namespace Myshipping.Application.EDI return new KeyValuePair(false, $"箱型({ctn.CTNALL})不匹配(EDI类型:XHZ_GLX),无法发送下货纸,请联系管理员"); } - sbData.AppendLine($"13:{(order.ISCONTAINERSOC.HasValue && order.ISCONTAINERSOC.Value ? "SOC" : GetCarrierEDICode(order.CARRIERID, "XHZ_GLX"))}:{ctnFind.Size}:{ctnEdi.MapCode}:{ctn.CTNNUM}:{ExchangeStr(ctn.REMARK)}:N");//箱经营人代码 尺寸 箱型 箱数 备注 加重箱 + sbData.AppendLine($"13:{(order.ISCONTAINERSOC.HasValue && order.ISCONTAINERSOC.Value ? "SOC" : GetCtnForCarrier(order.CARRIERID, "XHZ_GLJ", dictData))}:{ctnFind.Size}:{ctnEdi.MapCode}:{ctn.CTNNUM}:{ExchangeStr(ctn.REMARK)}:N");//箱经营人代码 尺寸 箱型 箱数 备注 加重箱 } Log.Information($"生成下货纸报文:{sbData.ToString()}"); @@ -997,6 +998,24 @@ namespace Myshipping.Application.EDI return EDICODE; } + /// + /// 获取箱属船司代码 + /// + /// + public static string GetCtnForCarrier(string carrid, string EDINAME, List dictData) + { + var xiaHuoZhiCarrierBelongMapping = dictData.Where(x => x.TypeCode == "XiaHuoZhiCarrierBelongMapping").ToList();//港联捷、港联欣下货纸的箱属映射配置 + var map = xiaHuoZhiCarrierBelongMapping.FirstOrDefault(x => x.Code == carrid); + if (map != null) + { + return map.Value; + } + else + { + return GetCarrierEDICode(carrid, EDINAME); + } + } + //获取付费方式edi代码(根据东胜7同功能模块代码翻译而成) public static string GetFrtEDICode(string FRT)