From 127443cb4cac60326d3e270cbaa3b224b60b046f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 11 Sep 2023 17:51:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=B0=E8=B4=A6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 336b6d95..a2940eb3 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -634,18 +634,27 @@ namespace Myshipping.Application { if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield)) { - item.IsVGM = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + var currStus = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield); + + if(currStus != null) + item.IsVGM = currStus?.ActDate.Value; } if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield)) { - item.IsCanDan = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + var currStus = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield); + + if (currStus != null) + item.IsCanDan = currStus?.ActDate.Value; } if (currStatusList.Any(a => a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield)) { - item.IsZZFX = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + var currStus = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield); + + if (currStus != null) + item.IsZZFX = currStus?.ActDate.Value; } item.GoodsStatusList = currStatusList.OrderBy(a => a.CalcSortNo)