修改运踪查询

master
jianghaiqing 6 months ago
parent 97ae235e42
commit 43019dd119

@ -339,6 +339,11 @@ namespace Myshipping.Application
/// </summary>
public string currentNodeCd { get; set; }
/// <summary>
/// 箱型名称
/// </summary>
public string sizeName { get; set; }
/// <summary>
/// 集装箱状态信息
/// </summary>

@ -91,7 +91,7 @@ namespace Myshipping.Application
.Where(t => t.TypeCode.Equals("after_port_trace_ctn_status", StringComparison.OrdinalIgnoreCase)).ToList();
//按顺序取状态配置字典
Dictionary<string, Tuple<string, int>> statusEnumDict = statusDict.Select(a => new { Key = a.Code, Val = new Tuple<string, int>(a.Value, a.Sort), Sort = a.Sort })
Dictionary<string, Tuple<string, string, int>> statusEnumDict = statusDict.Select(a => new { Key = a.Code, Val = new Tuple<string, string,int>(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<string, int> referToCtnDict = new Dictionary<string, int>();
bool isTransfer = false;
@ -113,6 +116,13 @@ namespace Myshipping.Application
{
result.resultData.containerInfoList.ForEach(s =>
{
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);
@ -186,7 +196,7 @@ namespace Myshipping.Application
return currStatus;
}).ToList();
foreach (KeyValuePair<string, Tuple<string, int>> kvp in statusEnumDict)
foreach (KeyValuePair<string, Tuple<string,string, int>> 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);
}

Loading…
Cancel
Save