review
This commit is contained in:
parent
10f6096770
commit
77b5352b05
@ -73,8 +73,9 @@ public partial class OrderService
|
|||||||
var canLinkOrders = await _orderRepository.GetListAsync(x =>
|
var canLinkOrders = await _orderRepository.GetListAsync(x =>
|
||||||
x.OrderType == input.LinkOrderType && noLinkOrderNos.Contains(x.OrderNo),
|
x.OrderType == input.LinkOrderType && noLinkOrderNos.Contains(x.OrderNo),
|
||||||
x => new { x.Id, x.OrderNo, x.OrderType, x.SubSystemId, x.CustomId });
|
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
|
await _orderRepository.LinkOrderAsync(canLinkOrders.Select(x => new OrderLinkEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,6 +27,8 @@ public partial class TrackService
|
|||||||
|
|
||||||
var res = new List<GetTrackOutput>();
|
var res = new List<GetTrackOutput>();
|
||||||
input.OrderNos = input.OrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList(); // 单号去重、去空
|
input.OrderNos = input.OrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList(); // 单号去重、去空
|
||||||
|
|
||||||
|
// todo:没有映射上的轨迹要过滤掉
|
||||||
var details = await _trackDetailsRepository.GetListAsync(input.OrderType, input.OrderNos);
|
var details = await _trackDetailsRepository.GetListAsync(input.OrderType, input.OrderNos);
|
||||||
|
|
||||||
foreach (var group in details.GroupBy(x => x.OrderId))
|
foreach (var group in details.GroupBy(x => x.OrderId))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user