From 0355ab30f8a1706aa5b20096c1887f55e6dcac3f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 27 Dec 2022 17:06:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9EDI=E7=9A=84=E5=8C=85?= =?UTF-8?q?=E8=A3=85=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 685bf4a9..3b244bf0 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2517,9 +2517,12 @@ namespace Myshipping.Application contaModel.CTNALLCODE = currConta.MapCode; + if (string.IsNullOrWhiteSpace(conta.KINDPKGS)) + throw Oops.Oh($"集装箱包装不能为空"); + var curContaBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(conta.KINDPKGS, StringComparison.OrdinalIgnoreCase)); - if (curBasePkgs == null) + if (curContaBasePkgs == null) throw Oops.Bah($"包装{conta.KINDPKGS}的基础数据代码未找到"); //EDI包装 @@ -2546,7 +2549,15 @@ namespace Myshipping.Application cargoModel.CNTRNO = contaList.FirstOrDefault(a => a.Id == cargo.CTNID.Value).CNTRNO; - var ediDetailPkgs = ediPkgsList.FirstOrDefault(x => x.Code.Equals(cargo.KINDPKGS, StringComparison.OrdinalIgnoreCase)); + if (string.IsNullOrWhiteSpace(cargo.KINDPKGS)) + throw Oops.Oh($"多品名包装不能为空"); + + var curCargoBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(cargo.KINDPKGS, StringComparison.OrdinalIgnoreCase)); + + if (curCargoBasePkgs == null) + throw Oops.Bah($"包装{cargo.KINDPKGS}的基础数据代码未找到"); + + var ediDetailPkgs = ediPkgsList.FirstOrDefault(x => x.Code.Equals(curCargoBasePkgs.Code, StringComparison.OrdinalIgnoreCase)); if (ediDetailPkgs == null) throw Oops.Oh($"货明细的包装{cargo.KINDPKGS}的EDI代码未找到"); From 958fc4f440ba3f87997e962d2401d32bd761faef Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 27 Dec 2022 17:36:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9EDI=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 3b244bf0..a1c1da39 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -55,6 +55,7 @@ using System.Net; using Furion.DistributedIDGenerator; using System.Linq.Expressions; using Myshipping.Core.Extension; +using System.Text.RegularExpressions; namespace Myshipping.Application { @@ -2754,7 +2755,14 @@ namespace Myshipping.Application _logger.LogInformation($"调用SO(SI),校验:{strCheck},数据对象:{JsonConvert.SerializeObject(ediModel)}"); if (!string.IsNullOrWhiteSpace(strCheck)) + { + //if (Regex.IsMatch(strCheck, "\\")) + //{ + // strCheck = Regex.Replace(strCheck, "\\", "\\r\\n"); + //} throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); + } + var currRlt = PILEdiHelper.CreateEdiPIL(ediModel); #endregion @@ -2769,7 +2777,14 @@ namespace Myshipping.Application _logger.LogInformation($"调用SO(SI),校验:{strCheck},数据对象:{JsonConvert.SerializeObject(ediModel)}"); if (!string.IsNullOrWhiteSpace(strCheck)) + { + //if (Regex.IsMatch(strCheck, "\\")) + //{ + // strCheck = Regex.Replace(strCheck, "\\", "\\r\\n"); + //} + throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); + } CommonWebApiResult currRlt = new CommonWebApiResult(); @@ -2794,7 +2809,13 @@ namespace Myshipping.Application _logger.LogInformation($"调用SO(SI),校验:{strCheck},数据对象:{JsonConvert.SerializeObject(ediModel)}"); if (!string.IsNullOrWhiteSpace(strCheck)) + { + //if (Regex.IsMatch(strCheck, "\\")) + //{ + // strCheck = Regex.Replace(strCheck, "\\", "\\r\\n"); + //} throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); + } var currRlt = WYEdiHelper.CreateEdiWY(ediModel); #endregion @@ -2810,7 +2831,9 @@ namespace Myshipping.Application _logger.LogInformation($"调用SO(SI),校验:{strCheck},数据对象:{JsonConvert.SerializeObject(ediModel)}"); if (!string.IsNullOrWhiteSpace(strCheck)) + { throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); + } CommonWebApiResult currRlt = new CommonWebApiResult(); @@ -2835,7 +2858,15 @@ namespace Myshipping.Application _logger.LogInformation($"调用SO(SI),校验:{strCheck},数据对象:{JsonConvert.SerializeObject(ediModel)}"); if (!string.IsNullOrWhiteSpace(strCheck)) + { + //if (Regex.IsMatch(strCheck, "\\")) + //{ + // strCheck = Regex.Replace(strCheck, "\\", "
"); + //} + throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}"); + } + CommonWebApiResult currRlt = YTEdiHelper.CreateEdiYT(ediModel); #endregion From 41830f0b637fd64b35268addce2ac748342b72a5 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Tue, 27 Dec 2022 17:39:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/BookingPrintTemplate.cs | 8 ++++++++ .../Myshipping.Application.xml | 20 +++++++++++++++++++ .../BookingOrder/BookingOrderService.cs | 4 +++- .../Dto/BookingPrintTemplateInput.cs | 9 +++++++++ .../BookingTemplate/BookingTemplateService.cs | 10 +++++----- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/Myshipping.Application/Entity/BookingPrintTemplate.cs b/Myshipping.Application/Entity/BookingPrintTemplate.cs index 6e0fc541..96c0aab1 100644 --- a/Myshipping.Application/Entity/BookingPrintTemplate.cs +++ b/Myshipping.Application/Entity/BookingPrintTemplate.cs @@ -31,5 +31,13 @@ namespace Myshipping.Application.Entity /// 租户名称 /// public string TenantName { get; set; } + /// + /// 主单 + /// + public bool IsMain { get; set; } + /// + /// 分单 + /// + public bool IsSub { get; set; } } } \ No newline at end of file diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 0abd8bd9..f3bcc4a7 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -3341,6 +3341,16 @@ 租户名称 + + + 主单 + + + + + 分单 + + 订舱备注 @@ -8647,6 +8657,16 @@ 租户名称 + + + 主单 + + + + + 分单 + + 订舱打印模板新增输入参数 diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index f9a4518c..cd45bdb7 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1560,7 +1560,9 @@ namespace Myshipping.Application .Select(x => new { x.TypeCode, - x.TypeName + x.TypeName, + x.IsMain, + x.IsSub }) .ToListAsync(); diff --git a/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs b/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs index 50f9579a..31712bd6 100644 --- a/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs +++ b/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs @@ -29,6 +29,15 @@ namespace Myshipping.Application /// public string TenantName { get; set; } + /// + /// 主单 + /// + public bool IsMain { get; set; } + /// + /// 分单 + /// + public bool IsSub { get; set; } + } /// diff --git a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs index a530b828..f68b7774 100644 --- a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs +++ b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs @@ -52,11 +52,11 @@ namespace Myshipping.Application [HttpPost("/BookingTemplate/add")] public async Task Add(AddBookingTemplateInput input) { - var c = _rep.Count(x => x.Type.Contains(input.Type) && x.Title == input.Title); - if (c > 0) - { - throw Oops.Oh(BookingErrorCode.BOOK101); - } + //var c = _rep.Count(x => x.Type.Contains(input.Type) && x.Title == input.Title); + //if (c > 0) + //{ + // throw Oops.Oh(BookingErrorCode.BOOK101); + //} var entity = input.Adapt(); await _rep.InsertAsync(entity);