修改运踪查询

master
jianghaiqing 6 months ago
parent c6cbde4f56
commit 50655c6127

@ -500,9 +500,13 @@ namespace Myshipping.Application.EDI
if (string.IsNullOrEmpty(headData.NOTIFYPARTY)) if (string.IsNullOrEmpty(headData.NOTIFYPARTY))
{
//CMA 订舱时可以不填通知人
if (headData.CARRIEREDICODE != "CMDU")
{ {
error = error + "<br />提单号:" + headData.MBLNO + " 通知人不能为空"; error = error + "<br />提单号:" + headData.MBLNO + " 通知人不能为空";
} }
}
else else
{ {
if (StringIsChinese(headData.NOTIFYPARTY)) if (StringIsChinese(headData.NOTIFYPARTY))

@ -94,7 +94,8 @@ namespace Myshipping.Application
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, int>> statusEnumDict = statusDict.Select(a => new { Key = a.Code, Val = new Tuple<string, int>(a.Value, a.Sort), Sort = a.Sort })
.OrderBy(a => a.Sort).ToDictionary(a => a.Key, b => b.Val); .OrderBy(a => a.Sort).ToDictionary(a => a.Key, b => b.Val);
string[] skipStatus = new string[] { "GIOI", "LOFV", "FVD", "FVA", "DFFV", "ETA", "LOR", "DFR", "RA", "DIFR", "LOT", "DIFT", "ADI", "DIDI", "CGRL", "RFP" }; string[] skipStatus = new string[] { "GIOI", "LOFV", "FVD", "FVA", "DFFV", "LOR", "DFR", "RA", "DIFR", "LOT", "DIFT", "ADI", "DIDI", "CGRL", "RFP" };
string[] transferStatus = new string[] { "AIP", "BIP", "ETDIP", "DIIP", "GOIP", "GIIP", "LIP", "EDIP", "DEIP" };
if (queryRlt.code == 200) if (queryRlt.code == 200)
{ {
@ -106,6 +107,8 @@ namespace Myshipping.Application
{ {
Dictionary<string, int> referToCtnDict = new Dictionary<string, int>(); Dictionary<string, int> referToCtnDict = new Dictionary<string, int>();
bool isTransfer = false;
if (result.resultData.containerInfoList != null && result.resultData.containerInfoList.Count > 0) if (result.resultData.containerInfoList != null && result.resultData.containerInfoList.Count > 0)
{ {
result.resultData.containerInfoList.ForEach(s => result.resultData.containerInfoList.ForEach(s =>
@ -134,6 +137,12 @@ namespace Myshipping.Application
}); });
} }
//legType = "T" 标识当票有中转
if (result.resultData.routingInfoList.Any(t => t.legType.Equals("T", StringComparison.OrdinalIgnoreCase)))
{
isTransfer = true;
}
result.embedTraceFlowStatusList = new List<EmbedTraceFlowStatusInfo>(); result.embedTraceFlowStatusList = new List<EmbedTraceFlowStatusInfo>();
var ctnNo = referToCtnDict.OrderByDescending(a => a.Value).FirstOrDefault().Key; var ctnNo = referToCtnDict.OrderByDescending(a => a.Value).FirstOrDefault().Key;
@ -180,6 +189,9 @@ namespace Myshipping.Application
foreach (KeyValuePair<string, Tuple<string, int>> kvp in statusEnumDict) foreach (KeyValuePair<string, Tuple<string, int>> kvp in statusEnumDict)
{ {
if(!skipStatus.Contains(kvp.Key)) if(!skipStatus.Contains(kvp.Key))
{
//不是中转的需要把状态节点去掉
if (isTransfer || (!isTransfer && !transferStatus.Contains(kvp.Key)))
{ {
var currStatus = takeList.FirstOrDefault(p => p.statusCd.Equals(kvp.Key, StringComparison.OrdinalIgnoreCase)); var currStatus = takeList.FirstOrDefault(p => p.statusCd.Equals(kvp.Key, StringComparison.OrdinalIgnoreCase));
@ -199,6 +211,7 @@ namespace Myshipping.Application
} }
} }
} }
}
return result; return result;
} }

@ -300,40 +300,13 @@ namespace Myshipping.Application
} }
if (withDispatchList.Any(a => if (withDispatchList.Any(a =>
!a.Detail.NOM_STATUS_NOTE.Equals("Load", StringComparison.OrdinalIgnoreCase))) a.Detail.NOM_STATUS_NOTE.Equals("Load", StringComparison.OrdinalIgnoreCase)))
{ {
model.PreBillList.AddRange(withDispatchList.Where(a => model.LoadDetailList.AddRange(withDispatchList.Where(a =>
!a.Detail.NOM_STATUS_NOTE.Equals("Load", StringComparison.OrdinalIgnoreCase)) a.Detail.NOM_STATUS_NOTE.Equals("Load", StringComparison.OrdinalIgnoreCase))
.Select((a, idx) => .Select((a, idx) =>
{ {
TaskRollingNominationShipPreBillShowDto preBillInfo = new TaskRollingNominationShipPreBillShowDto return a.Detail.Adapt<TaskRollingNominationShipDetailShowDto>();
{
Bookedby = a.Detail.BOOKED_BY,
ConfirmDate = a.Dispatch?.CONFIRM_DATE,
ConfirmDeadLine = a.Dispatch?.CONFIRM_DEAD_LINE,
CtnStat = $"{a.Detail.CTNALL}*{a.Detail.CTNNUM}",
CustomerId = a.Detail.CUSTOMERID,
CustomerName = a.Detail.CUSTOMERNAME,
ContractualName = a.Detail.CONTRACTUAL_NAME,
CreateShareLinkDate = a.Dispatch?.CREATE_SHARE_LINK_DATE,
DischargePortName = a.Detail.DISCHARGEPORT_NAME,
IsSend = a.Dispatch != null ? a.Dispatch.IS_SEND : false,
IsUserManual = a.Dispatch != null ? a.Dispatch.IS_USER_MANUAL : false,
LoadPortName = a.Detail.LOADPORT_NAME,
PlaceOfDelivery = a.Detail.PLACEOF_DELIVERY,
PlaceOfReceipt = a.Detail.PLACEOF_RECEIPT,
Shipment = a.Detail.SHIPMENT,
Status = a.Dispatch?.STATUS,
ShareLinkKey = a.Dispatch?.SHARE_LINK_KEY,
UserOpinion = a.Dispatch?.USER_OPINION,
UserOpinionTxt = a.Dispatch?.USER_OPINION_TXT,
BatchId = a.Dispatch?.BATCH_ID,
BookingId = a.Detail.BOOKING_ID,
GroupName = a.Detail.CUSTOMERID.HasValue ? $"CUST_{idx + 1}" : "",
CtnNote = !string.IsNullOrWhiteSpace(a.Detail.CTNNOTE) ? a.Detail.CTNNOTE : ""
};
return preBillInfo;
}).ToList()); }).ToList());
} }

Loading…
Cancel
Save