修复bug

This commit is contained in:
18942506660
2024-11-29 09:15:57 +08:00
parent 079b09cebe
commit bfd4f880f9
3 changed files with 39 additions and 20 deletions

View File

@@ -522,14 +522,17 @@ namespace WMS.Web.Domain.Services
});
var all_boxIds = dto.Boxs.Select(s => s.BoxId).ToList();
//2.1判断箱是否上架过了
var boxInventoryList = await _boxInventoryRepositories.GetList(all_boxIds);
foreach (var b in dto.Boxs)
//2.1判断箱是否上架过了 按箱出货才判断
if (dto.ShelfMethod == 1)
{
var boxInventory = boxInventoryList.FirstOrDefault(f => f.BoxId == b.BoxId);
if (boxInventory != null)
var boxInventoryList = await _boxInventoryRepositories.GetList(all_boxIds);
foreach (var b in dto.Boxs)
{
return Result<InStock>.ReFailure($"{b.BoxBillNo} 箱号已上架入库", 80000);
var boxInventory = boxInventoryList.FirstOrDefault(f => f.BoxId == b.BoxId);
if (boxInventory != null)
{
return Result<InStock>.ReFailure($"{b.BoxBillNo} 箱号已上架入库", 80000);
}
}
}