update: 【获取时间轴】当存在需要显示的轨迹才需要补充签收节点

This commit is contained in:
云龙 王 2024-11-28 10:07:46 +08:00
parent 85d0b9efe1
commit 7fe025c9bd

View File

@ -251,16 +251,20 @@ public class TrackOrderService : ApplicationService
if (!order.IsCompleted) //如果没完结则显示签收节点 if (!order.IsCompleted) //如果没完结则显示签收节点
{ {
var eddUnixTimestamp = order.EstimatedDeliveryDate.HasValue ? ToUnixTimestamp(DateTime.Parse(order.EstimatedDeliveryDate.ToString()!)) : 0; var eddUnixTimestamp = order.EstimatedDeliveryDate.HasValue ? ToUnixTimestamp(DateTime.Parse(order.EstimatedDeliveryDate.ToString()!)) : 0;
var isShowTime = eddUnixTimestamp > 0 && res.Data.All(m => m.TrackTime < eddUnixTimestamp);
var isShowTime = eddUnixTimestamp > 0 && res.Data != null && res.Data.All(m => m.TrackTime < eddUnixTimestamp); //当存在需要显示的轨迹才需要补充签收节点
res.Data.Add(new GetDetailTimelineOutput() if (res.Data.Count != 0)
{ {
Content = "签收", res.Data.Add(new GetDetailTimelineOutput()
IsHighlight = false, {
TrackTimeZone = isShowTime ? $"GMT{(order.DestinationTimeZone >= 0 ? "+" : "-")}{order.DestinationTimeZone}" : "", Content = "签收",
TrackTime = isShowTime ? eddUnixTimestamp : 0, IsHighlight = false,
TrackTimePrefix = isShowTime ? "预计签收时间:" : "", TrackTimeZone = isShowTime ? $"GMT{(order.DestinationTimeZone >= 0 ? "+" : "-")}{order.DestinationTimeZone}" : "",
}); TrackTime = isShowTime ? eddUnixTimestamp : 0,
TrackTimePrefix = isShowTime ? "预计签收时间:" : "",
});
}
} }
return res; return res;