diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 4787b85a..93a6995f 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2860,16 +2860,24 @@ namespace Myshipping.Application if (ediRouteEnum == EDIRouteEnum.ESL || ediRouteEnum == EDIRouteEnum.PIL || ediRouteEnum == EDIRouteEnum.WY || ediRouteEnum == EDIRouteEnum.YML || ediRouteEnum == EDIRouteEnum.YT) { + //付费方式基础数据 + var baseFrtList = _cache.GetAllCodeFrt().GetAwaiter().GetResult(); + + var baseFrtInfo = baseFrtList.FirstOrDefault(t => t.EnName.Equals(order.BLFRT, StringComparison.OrdinalIgnoreCase)); + + if (baseFrtInfo == null) + throw Oops.Bah($"付费方式{order.BLFRT}的基础代码未找到"); + //付费方式映射 var ediFrtList = _cache.GetAllMappingFrt().GetAwaiter().GetResult() .Where(t => t.Module.Equals(CONST_MAPPING_MODULE, StringComparison.OrdinalIgnoreCase)).ToList(); if (!string.IsNullOrWhiteSpace(order.BLFRT)) { - var currFrtInfo = ediFrtList.FirstOrDefault(t => t.Code.Equals(order.BLFRT, StringComparison.OrdinalIgnoreCase)); + var currFrtInfo = ediFrtList.FirstOrDefault(t => t.Code.Equals(baseFrtInfo.Code, StringComparison.OrdinalIgnoreCase)); if (currFrtInfo == null) - throw Oops.Bah($"付费方式{order.YARDID}的EDI代码未找到"); + throw Oops.Bah($"付费方式{baseFrtInfo.Code}的EDI代码未找到"); primaryModel.BLFRTEDICODE = currFrtInfo.MapCode?.Trim(); }