diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs index 1e6cb204..39f5e6bf 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs @@ -73,8 +73,9 @@ public partial class OrderService var canLinkOrders = await _orderRepository.GetListAsync(x => x.OrderType == input.LinkOrderType && noLinkOrderNos.Contains(x.OrderNo), x => new { x.Id, x.OrderNo, x.OrderType, x.SubSystemId, x.CustomId }); - - if (canLinkOrders.Count == 0) return; + + // todo:如果有不存在的单,需要抛异常 + if (canLinkOrders.Count != noLinkOrderNos.Count() ) return; await _orderRepository.LinkOrderAsync(canLinkOrders.Select(x => new OrderLinkEntity { diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.Query.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.Query.cs index a055513f..295acceb 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.Query.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.Query.cs @@ -27,6 +27,8 @@ public partial class TrackService var res = new List(); input.OrderNos = input.OrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList(); // 单号去重、去空 + + // todo:没有映射上的轨迹要过滤掉 var details = await _trackDetailsRepository.GetListAsync(input.OrderType, input.OrderNos); foreach (var group in details.GroupBy(x => x.OrderId))