From 43019dd119c2e2e20ad08eea9508ed8375f93829 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Thu, 16 May 2024 09:23:43 +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 --- .../Dtos/QueryTraceAfterPortResultDto.cs | 5 ++++ .../EmbedTraceProductService.cs | 27 ++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs b/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs index 2e7e818c..70a516e1 100644 --- a/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs +++ b/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs @@ -339,6 +339,11 @@ namespace Myshipping.Application /// public string currentNodeCd { get; set; } + /// + /// 箱型名称 + /// + public string sizeName { get; set; } + /// /// 集装箱状态信息 /// diff --git a/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs b/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs index ab80a334..7465219e 100644 --- a/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs +++ b/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs @@ -91,7 +91,7 @@ namespace Myshipping.Application .Where(t => t.TypeCode.Equals("after_port_trace_ctn_status", StringComparison.OrdinalIgnoreCase)).ToList(); //按顺序取状态配置字典 - Dictionary> statusEnumDict = statusDict.Select(a => new { Key = a.Code, Val = new Tuple(a.Value, a.Sort), Sort = a.Sort }) + Dictionary> statusEnumDict = statusDict.Select(a => new { Key = a.Code, Val = new Tuple(a.Value,a.Remark, a.Sort), Sort = a.Sort }) .OrderBy(a => a.Sort).ToDictionary(a => a.Key, b => b.Val); string[] skipStatus = new string[] { "GIOI", "LOFV", "FVD", "FVA", "DFFV", "LOR", "DFR", "RA", "DIFR", "LOT", "DIFT", "ADI", "DIDI", "CGRL", "RFP" }; @@ -105,6 +105,9 @@ namespace Myshipping.Application if (result != null && result.resultData != null) { + //这里需要翻译一下箱型 + var ctnCodeMappingList = _cache.GetAllMappingCtn().GetAwaiter().GetResult().ToList(); + Dictionary referToCtnDict = new Dictionary(); bool isTransfer = false; @@ -113,7 +116,14 @@ namespace Myshipping.Application { result.resultData.containerInfoList.ForEach(s => { - if(s.containerStatusInfoList != null && s.containerStatusInfoList.Count > 0) + var ctnMapping = ctnCodeMappingList.FirstOrDefault(t => t.MapCode.Equals(s.size)); + + if(ctnMapping != null) + { + s.sizeName = ctnMapping.MapName?.Trim(); + } + + if (s.containerStatusInfoList != null && s.containerStatusInfoList.Count > 0) { referToCtnDict.Add(s.containerNo, s.containerStatusInfoList.Count); @@ -129,7 +139,7 @@ namespace Myshipping.Application { a.statusCnName = a.statusCd; } - + return a; }).ToList(); } @@ -186,7 +196,7 @@ namespace Myshipping.Application return currStatus; }).ToList(); - foreach (KeyValuePair> kvp in statusEnumDict) + foreach (KeyValuePair> kvp in statusEnumDict) { if(!skipStatus.Contains(kvp.Key)) { @@ -200,11 +210,16 @@ namespace Myshipping.Application currStatus = new EmbedTraceFlowStatusInfo { statusCd = kvp.Key, - statusCnName = kvp.Value.Item1, - sortNo = kvp.Value.Item2, + statusCnName = !string.IsNullOrWhiteSpace(kvp.Value.Item2)? kvp.Value.Item2 : kvp.Value.Item1, + sortNo = kvp.Value.Item3, statusCtnStatic = $"0/{referToCtnDict.Count}", }; } + else + { + if (!string.IsNullOrWhiteSpace(kvp.Value.Item2)) + currStatus.statusCnName = kvp.Value.Item2; + } result.embedTraceFlowStatusList.Add(currStatus); }