From bb89acfe7d691ad229a8c48c6e4a8f55cccd26dd Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Mon, 15 May 2023 09:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E7=AB=99=E6=98=A0=E5=B0=84=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=88=B9=E5=8F=B8=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 21 ++++++++++++------- Myshipping.Core/Entity/CommonDB/CodeYard.cs | 5 +++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 776d2fcf..4bc9598f 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -3109,10 +3109,10 @@ namespace Myshipping.Application await _repOrderUrl.InsertAsync(ordUrl); } - if (!string.IsNullOrEmpty(ordUrl.UrlTxxp)) - { - return ordUrl.UrlTxxp; - } + //if (!string.IsNullOrEmpty(ordUrl.UrlTxxp)) + //{ + // return ordUrl.UrlTxxp; + //} //校验船公司 if (string.IsNullOrEmpty(order.CARRIERID)) @@ -3135,10 +3135,16 @@ namespace Myshipping.Application } //场站转换 - var yardset = _cache.GetAllMappingYard().Result.FirstOrDefault(y => y.Code == order.YARDID && y.Module == "BookingTxxp"); + var yardsetList = _cache.GetAllMappingYard().Result.Where(y => y.Code == order.YARDID && y.Module == "BookingTxxp" && (y.CarrierCode == null || y.CarrierCode == "" || y.CarrierCode == order.CARRIERID)).ToList(); + if (yardsetList.Count == 0) + { + throw Oops.Bah(BookingErrorCode.BOOK120, $"{order.YARD} {order.CARRIER}(提箱小票)"); + } + + var yardset = yardsetList.FirstOrDefault(x => x.CarrierCode == order.CARRIERID); if (yardset == null) { - throw Oops.Bah(BookingErrorCode.BOOK120, $"{order.YARDID}(提箱小票)"); + yardset = yardsetList.FirstOrDefault(x => x.CarrierCode == null || x.CarrierCode == ""); } var ctns = await _repCtn.Where(x => x.BILLID == bookingId).ToListAsync(); @@ -3159,7 +3165,8 @@ namespace Myshipping.Application var expCode = ctns.Select(x => x.CTNCODE).Distinct().Except(ctnMapping.Select(y => y.Code)).ToList(); if (expCode.Count > 0) { - throw Oops.Bah(BookingErrorCode.BOOK123, $"{string.Join(',', expCode)}(提箱小票)"); + var expName = ctns.Where(x => expCode.Contains(x.CTNCODE)).Select(x => x.CTNALL).Distinct().ToList(); + throw Oops.Bah(BookingErrorCode.BOOK123, $"{string.Join(',', expName)}(提箱小票)"); } var user = await _repUser.FirstOrDefaultAsync(x => x.Id == UserManager.UserId); diff --git a/Myshipping.Core/Entity/CommonDB/CodeYard.cs b/Myshipping.Core/Entity/CommonDB/CodeYard.cs index 8fa2d99f..a7018771 100644 --- a/Myshipping.Core/Entity/CommonDB/CodeYard.cs +++ b/Myshipping.Core/Entity/CommonDB/CodeYard.cs @@ -68,5 +68,10 @@ namespace Myshipping.Core.Entity /// public string Remark { get; set; } + /// + /// 船司代码 + /// + public string CarrierCode { get; set; } + } }