fix:时间轴顺序问题
This commit is contained in:
parent
5166ec42b4
commit
9511dac81d
@ -235,20 +235,27 @@ public class TrackOrderService : ApplicationService
|
||||
});
|
||||
}
|
||||
|
||||
//如果轨迹状态没完结则追加最后一个默认节点
|
||||
if (!order.IsCompleted)
|
||||
// 按轨迹发生时间正序排序
|
||||
res.Data = res.Data?.OrderBy(m => m.TrackTime).ToList();
|
||||
|
||||
if (!order.IsCompleted) //如果没完结则显示签收节点
|
||||
{
|
||||
res.Data.Add(new GetDetailTimelineOutput()
|
||||
var eddUnixTimestamp = order.EstimatedDeliveryDate.HasValue ? ToUnixTimestamp(DateTime.Parse(order.EstimatedDeliveryDate.ToString()!)) : 0;
|
||||
|
||||
//订单上有预计签收时间,需要对比预计到达时间是否大于时间轴上所有轨迹内容的发生时间,如果有任意一条时间大于预计签收时间,则隐藏签收节点
|
||||
if (eddUnixTimestamp > 0 && res.Data != null && res.Data.All(m => m.TrackTime < eddUnixTimestamp))
|
||||
{
|
||||
Content = "签收",
|
||||
IsHighlight = false,
|
||||
TrackTimeZone = order.EstimatedDeliveryDate.HasValue ? $"GMT{(order.DestinationTimeZone >= 0 ? "+" : "-")}{order.DestinationTimeZone}" : "",
|
||||
TrackTime = order.EstimatedDeliveryDate.HasValue ? ToUnixTimestamp(DateTime.Parse(order.EstimatedDeliveryDate.ToString()!)) : 0,
|
||||
TrackTimePrefix = order.EstimatedDeliveryDate.HasValue ? "预计签收时间:" : "",
|
||||
});
|
||||
res.Data.Add(new GetDetailTimelineOutput()
|
||||
{
|
||||
Content = "签收",
|
||||
IsHighlight = false,
|
||||
TrackTimeZone = order.EstimatedDeliveryDate.HasValue ? $"GMT{(order.DestinationTimeZone >= 0 ? "+" : "-")}{order.DestinationTimeZone}" : "",
|
||||
TrackTime = eddUnixTimestamp,
|
||||
TrackTimePrefix = order.EstimatedDeliveryDate.HasValue ? "预计签收时间:" : "",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
res.Data = res.Data?.OrderBy(m => m.TrackTime).ToList();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user