From a4df525ee894981bc3a8576effb0c2800ec4a874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=BE=99=20=E7=8E=8B?= Date: Fri, 29 Nov 2024 14:23:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E3=80=90=E6=A0=B9?= =?UTF-8?q?=E6=8D=AEId=E8=8E=B7=E5=8F=96=E8=BD=A8=E8=BF=B9=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E3=80=91=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E6=A0=A1=E9=AA=8C=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E8=A7=84=E5=88=991=EF=BC=9AorderId=E4=B8=BA=E7=A9=BA=EF=BC=8Co?= =?UTF-8?q?rderNo=E4=B8=BA=E7=A9=BA+systemId>0=EF=BC=8C=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E4=B8=BA=E5=8F=82=E6=95=B0=E5=BC=82=E5=B8=B8=20=E8=A7=84?= =?UTF-8?q?=E5=88=992=EF=BC=9AorderId=E4=B8=BA=E7=A9=BA=EF=BC=8CorderNo?= =?UTF-8?q?=E4=B8=8D=E4=B8=BA=E7=A9=BA+systemId=E4=B8=BA=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=B8=BA=E5=8F=82=E6=95=B0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=20=E6=B3=A8=EF=BC=9A=E5=BD=93orderId>0,orderNo=E4=B8=8D?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA,systemId>0=EF=BC=8C=E5=88=99=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E3=80=90=E8=AE=A2=E5=8D=95=E5=8F=B7+=E7=B3=BB?= =?UTF-8?q?=E7=BB=9Fid=E3=80=91=E7=9A=84=E6=96=B9=E5=BC=8F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=BD=A8=E8=BF=B9=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackOrders/TrackOrderService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs b/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs index 472c63bf..3f3aa542 100644 --- a/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs +++ b/src/SJZY.Track.Application/Services/TrackOrders/TrackOrderService.cs @@ -115,14 +115,16 @@ public class TrackOrderService : ApplicationService [HttpPost("GetDetails")] public async Task> GetTracksAsync(int? orderId, string? orderNo, int? systemId) { - Expression> whereExpression = null; + Expression>? whereExpression = null; + //根据订单id查询 if (orderId != null && orderId > 0) whereExpression = m => m.Id == orderId; + //根据订单号+系统id查询 if (!string.IsNullOrEmpty(orderNo) && systemId != null && systemId > 0) whereExpression = m => m.OrderNo == orderNo && m.SubSystemId == systemId; - if (orderId == default && orderNo == default && systemId == default) + if (whereExpression == default) throw new BusinessException(message: "请求参数异常"); var subSystemId = await _orderRepository.GetFirstAsync(whereExpression, x => x.SubSystemId);