From dbc711497f2497cd537af8430e173e84176b457d Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Wed, 24 May 2023 11:14:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A7=E7=89=A9=E7=8A=B6=E6=80=81=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index a2ee5649..a7623c05 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1600,7 +1600,12 @@ namespace Myshipping.Application var t = list.Union(config).OrderBy(x => x.Sort).DistinctBy(x => x.StatusName).ToList(); if (t != null) { - var StatusName = t.OrderByDescending(x => x.FinishTime).Select(x => x.StatusName).First(); + var StatusName = t.Where(x => x.FinishTime.HasValue).OrderByDescending(x => x.FinishTime).Select(x => x.StatusName).FirstOrDefault(); + if (StatusName == null) + { + StatusName = ""; + } + order.BSSTATUSNAME = StatusName; await _rep.AsUpdateable(order).IgnoreColumns(it => new