优化详情
This commit is contained in:
@@ -198,6 +198,19 @@ namespace WMS.Web.Repositories
|
|||||||
SerialNumbers = (string.Join(",", x.detail.SerialNumbers).TrimEnd(','))
|
SerialNumbers = (string.Join(",", x.detail.SerialNumbers).TrimEnd(','))
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
var boxIds = boxList.GroupBy(x => x.BoxId).Select(x => x.Key).ToList();
|
||||||
|
var boxs= await _context.Box.Where(x => boxIds.Contains(x.Id)).ToListAsync();
|
||||||
|
boxList.ForEach(x=>
|
||||||
|
{
|
||||||
|
var current_box= boxs.Where(b => b.Id == x.BoxId).FirstOrDefault();
|
||||||
|
if (current_box != null)
|
||||||
|
{
|
||||||
|
var current_boxDet= current_box.Details.Where(d => d.MaterialNumber == x.MaterialNumber).FirstOrDefault();
|
||||||
|
if (x.MethodForInt == (int)InventoryInOutMethod.Product && current_boxDet.Qty != 0)
|
||||||
|
x.Qty = current_boxDet.Qty;
|
||||||
|
}
|
||||||
|
});
|
||||||
response.Boxs = boxList;
|
response.Boxs = boxList;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user