From 85d0b9efe10e66ac925b2d8532da8b219fe34cb8 Mon Sep 17 00:00:00 2001 From: eli Date: Wed, 27 Nov 2024 17:48:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E8=AE=A2=E5=8D=95=E5=8F=B7?= =?UTF-8?q?+=E5=AD=90=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackOrders/TrackOrderService.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs b/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs index 75806f9e..e21286df 100644 --- a/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs +++ b/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs @@ -1,3 +1,4 @@ +using System.Linq.Expressions; using SJZY.Expand.AliyunOSS; using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Application.Contract.Dtos.TrackOrder; @@ -108,11 +109,20 @@ public class TrackOrderService : ApplicationService /// 根据订单id获取轨迹明细列表 /// /// + /// + /// /// [HttpPost("GetDetails")] - public async Task> GetTracksAsync(int orderId) + public async Task> GetTracksAsync(int orderId, string orderNo, int systemId) { - var subSystemId = await _orderRepository.GetFirstAsync(x => x.Id == orderId, x => x.SubSystemId); + Expression> whereExpression = null; + if (orderId > 0) + whereExpression = m => m.Id == orderId; + + if (string.IsNullOrEmpty(orderNo) && systemId > 0) + whereExpression = m => m.OrderNo == orderNo && m.SubSystemId == systemId; + + var subSystemId = await _orderRepository.GetFirstAsync(whereExpression, x => x.SubSystemId); if (subSystemId == default) { throw new BusinessException(message: "订单不存在"); From 7fe025c9bdf5ec12cc04d70d1e17f94834180298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=BE=99=20=E7=8E=8B?= Date: Thu, 28 Nov 2024 10:07:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update:=20=E3=80=90=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BD=B4=E3=80=91=E5=BD=93=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA=E7=9A=84=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=89=8D=E9=9C=80=E8=A6=81=E8=A1=A5=E5=85=85=E7=AD=BE=E6=94=B6?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackOrders/TrackOrderService.cs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs b/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs index e21286df..4c63e8a7 100644 --- a/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs +++ b/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs @@ -251,16 +251,20 @@ public class TrackOrderService : ApplicationService if (!order.IsCompleted) //如果没完结则显示签收节点 { 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 = "签收", - IsHighlight = false, - TrackTimeZone = isShowTime ? $"GMT{(order.DestinationTimeZone >= 0 ? "+" : "-")}{order.DestinationTimeZone}" : "", - TrackTime = isShowTime ? eddUnixTimestamp : 0, - TrackTimePrefix = isShowTime ? "预计签收时间:" : "", - }); + res.Data.Add(new GetDetailTimelineOutput() + { + Content = "签收", + IsHighlight = false, + TrackTimeZone = isShowTime ? $"GMT{(order.DestinationTimeZone >= 0 ? "+" : "-")}{order.DestinationTimeZone}" : "", + TrackTime = isShowTime ? eddUnixTimestamp : 0, + TrackTimePrefix = isShowTime ? "预计签收时间:" : "", + }); + } } return res;