From 0355ab30f8a1706aa5b20096c1887f55e6dcac3f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 27 Dec 2022 17:06:37 +0800 Subject: [PATCH] =?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代码未找到");