入库增加验证过滤
This commit is contained in:
Binary file not shown.
@@ -356,6 +356,19 @@ namespace WMS.Web.Domain.Services
|
|||||||
return Result<InStock>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
return Result<InStock>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var all_boxIds = dto.Details.Select(s => s.BoxId).ToList();
|
||||||
|
//2.1判断箱是否上架过了
|
||||||
|
var boxInventoryList = await _boxInventoryRepositories.GetList(all_boxIds);
|
||||||
|
foreach (var bid in all_boxIds)
|
||||||
|
{
|
||||||
|
var boxInventory = boxInventoryList.FirstOrDefault(f => f.BoxId == bid);
|
||||||
|
if (boxInventory != null)
|
||||||
|
{
|
||||||
|
var box = await _boxRepositories.Get(bid);
|
||||||
|
if (box == null) return Result<InStock>.ReFailure(ResultCodes.BoxIsTrueShelf);
|
||||||
|
return Result<InStock>.ReFailure($"{box.BoxBillNo} 箱号已上架入库", 80000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//1.获取物料集合和组织集合和供应商的集合
|
//1.获取物料集合和组织集合和供应商的集合
|
||||||
var materials = new List<ErpMaterialDto>();
|
var materials = new List<ErpMaterialDto>();
|
||||||
@@ -507,6 +520,19 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
x.Details.RemoveAll(t => t.Qty == 0);
|
x.Details.RemoveAll(t => t.Qty == 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
var boxInventory = boxInventoryList.FirstOrDefault(f => f.BoxId == b.BoxId);
|
||||||
|
if (boxInventory != null)
|
||||||
|
{
|
||||||
|
return Result<InStock>.ReFailure($"{b.BoxBillNo} 箱号已上架入库", 80000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//1.获取来源单
|
//1.获取来源单
|
||||||
var task = await _inStockTaskRepositories.Get(dto.TaskId);
|
var task = await _inStockTaskRepositories.Get(dto.TaskId);
|
||||||
if (task == null)
|
if (task == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user