From bf332c593f60fdf48b666b0a4d62352ca0a62361 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Thu, 16 May 2024 16:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=90=E8=B8=AA=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmbedTraceProductService.cs | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs b/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs index 2a5dc9ad..6db0e021 100644 --- a/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs +++ b/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs @@ -6,6 +6,7 @@ using Furion.FriendlyException; using Furion.JsonSerialization; using Furion.RemoteRequest.Extensions; using Mapster; +using MathNet.Numerics.Distributions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -216,6 +217,19 @@ namespace Myshipping.Application return currStatus; }).ToList(); + var APODtotal = takeList.Where(p => p.statusCd.Equals("APOD", StringComparison.OrdinalIgnoreCase)).ToList(); + + if (APODtotal.Count > 1 && APODtotal.Any(p => p.isComplete)) + { + takeList = takeList.Select(a => + { + if (a.statusCd.Equals("APOD", StringComparison.OrdinalIgnoreCase) && !a.isComplete) + return null; + + return a; + }).Where(a => a != null).ToList(); + } + foreach (KeyValuePair> kvp in statusEnumDict) { if (!skipStatus.Contains(kvp.Key)) @@ -244,6 +258,7 @@ namespace Myshipping.Application if (currStatus.statusCd.Equals("DPOL", StringComparison.OrdinalIgnoreCase)) currStatus.isSplitStart = true; + if (currStatus.statusCd.Equals("APOD", StringComparison.OrdinalIgnoreCase)) currStatus.isSplitEnd = true; @@ -265,12 +280,29 @@ namespace Myshipping.Application b.currentNodeCnName = !string.IsNullOrWhiteSpace(statusEnumDict[b.currentNodeCd].Item2) ? statusEnumDict[b.currentNodeCd].Item2 : statusEnumDict[b.currentNodeCd].Item1; } - b.containerStatusInfoList.ForEach(c => { + b.containerStatusInfoList = b.containerStatusInfoList.Select(c => + { if (!string.IsNullOrWhiteSpace(b.currentNodeCd) && b.currentNodeCd.Equals(c.statusCd, StringComparison.OrdinalIgnoreCase)) { c.isCurrentStatus = true; } - }); + + if (!string.IsNullOrWhiteSpace(c.statusPlace)) + c.statusPlace = c.statusPlace.ToUpper(); + + if (!string.IsNullOrWhiteSpace(c.statusCd) && c.statusCd.Equals("ETA", StringComparison.OrdinalIgnoreCase)) + { + return null; + } + + if (!string.IsNullOrWhiteSpace(c.statusCd) && c.statusCd.Equals("APOD", StringComparison.OrdinalIgnoreCase) && !c.isEst.Equals("N", StringComparison.OrdinalIgnoreCase)) + { + return null; + } + + return c; + + }).Where(a => a != null).ToList(); });