修改运踪查询

master
jianghaiqing 6 months ago
parent 4514dc103d
commit f27520d890

@ -16,7 +16,7 @@ namespace Myshipping.Application
/// <summary>
/// 回执消息
/// </summary>
public string msg { get; set; }
public string message { get; set; }
/// <summary>
/// 查询详情列表

@ -92,10 +92,10 @@ namespace Myshipping.Application
.Where(t => t.TypeCode.Equals("after_port_trace_ctn_status", StringComparison.OrdinalIgnoreCase)).ToList();
//按顺序取状态配置字典
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 })
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","ETD","ETA", "LDI", "CDPOD", "BPOD" };
string[] skipStatus = new string[] { "GIOI", "LOFV", "FVD", "FVA", "DFFV", "LOR", "DFR", "RA", "DIFR", "LOT", "DIFT", "ADI", "DIDI", "CGRL", "RFP", "ETD", "ETA", "LDI", "CDPOD", "BPOD" };
string[] transferStatus = new string[] { "AIP", "BIP", "ETDIP", "DIIP", "GOIP", "GIIP", "LIP", "EDIP", "DEIP", "EAIP" };
@ -121,7 +121,7 @@ namespace Myshipping.Application
{
string ctnSize = s.size;
if(!string.IsNullOrWhiteSpace(s.size))
if (!string.IsNullOrWhiteSpace(s.size))
{
ctnSize = $"{Regex.Match(s.size, "[0-9]{2}")}{Regex.Match(s.size, "[a-zA-Z]{1,3}([0-9]{1})?")}";
}
@ -216,9 +216,9 @@ namespace Myshipping.Application
return currStatus;
}).ToList();
foreach (KeyValuePair<string, Tuple<string,string, int>> kvp in statusEnumDict)
foreach (KeyValuePair<string, Tuple<string, string, int>> kvp in statusEnumDict)
{
if(!skipStatus.Contains(kvp.Key))
if (!skipStatus.Contains(kvp.Key))
{
//不是中转的需要把状态节点去掉
if (isTransfer || (!isTransfer && !transferStatus.Contains(kvp.Key)))
@ -230,7 +230,7 @@ namespace Myshipping.Application
currStatus = new EmbedTraceFlowStatusInfo
{
statusCd = kvp.Key,
statusCnName = !string.IsNullOrWhiteSpace(kvp.Value.Item2)? kvp.Value.Item2 : kvp.Value.Item1,
statusCnName = !string.IsNullOrWhiteSpace(kvp.Value.Item2) ? kvp.Value.Item2 : kvp.Value.Item1,
sortNo = kvp.Value.Item3,
statusCtnStatic = $"0/{referToCtnDict.Count}",
};
@ -241,11 +241,11 @@ namespace Myshipping.Application
currStatus.statusCnName = kvp.Value.Item2;
}
if(currStatus.statusCd.Equals("DPOL", StringComparison.OrdinalIgnoreCase))
currStatus.isSplitStart = true;
if (currStatus.statusCd.Equals("DPOL", StringComparison.OrdinalIgnoreCase))
currStatus.isSplitStart = true;
if (currStatus.statusCd.Equals("APOD", StringComparison.OrdinalIgnoreCase))
currStatus.isSplitEnd = true;
currStatus.isSplitEnd = true;
if (!string.IsNullOrWhiteSpace(longContainerStatus.currentNodeCd) && longContainerStatus.currentNodeCd.Equals(kvp.Key, StringComparison.OrdinalIgnoreCase))
{
@ -260,7 +260,7 @@ namespace Myshipping.Application
result.resultData.containerInfoList.ForEach(b =>
{
if(statusEnumDict.Any(k=> !string.IsNullOrWhiteSpace(b.currentNodeCd) && k.Key.Equals(b.currentNodeCd, StringComparison.OrdinalIgnoreCase)))
if (statusEnumDict.Any(k => !string.IsNullOrWhiteSpace(b.currentNodeCd) && k.Key.Equals(b.currentNodeCd, StringComparison.OrdinalIgnoreCase)))
{
b.currentNodeCnName = !string.IsNullOrWhiteSpace(statusEnumDict[b.currentNodeCd].Item2) ? statusEnumDict[b.currentNodeCd].Item2 : statusEnumDict[b.currentNodeCd].Item1;
}
@ -273,7 +273,22 @@ namespace Myshipping.Application
});
});
_logger.LogInformation($"{JSON.Serialize(queryDto)} 查询成功");
}
else
{
_logger.LogInformation($"{JSON.Serialize(queryDto)} 查询失败,{result.resultMessage}");
throw Oops.Oh(result.resultMessage);
}
}
else
{
_logger.LogInformation($"{JSON.Serialize(queryDto)} 查询失败,{queryRlt.message}");
throw Oops.Oh(result.resultMessage.Contains("官网查询无数据") ? "无查询结果" : "查询失败");
}
return result;

Loading…
Cancel
Save