This commit is contained in:
tongfei
2023-12-07 16:08:57 +08:00
parent 5ba8a48b8e
commit 420164acdc

View File

@@ -568,9 +568,13 @@ namespace WMS.Web.Domain.Services
var boxIds = dtoData.Details.SelectMany(x => x.BoxsDetails).GroupBy(x=>x.BoxId).Select(x => x.Key).ToList();
var boxInventorys = await _boxInventoryRepositories.GetList(boxIds);
//判断箱库存是否存在
var isNotHaveBoxInvetory = boxInventorys.All(x => boxIds.Any(bid => bid != x.BoxId));
if(isNotHaveBoxInvetory)
foreach (var bid in boxIds)
{
var isHaveBoxInvetory= boxInventorys.Where(x => x.BoxId == bid).Any();
if (!isHaveBoxInvetory)
return Result.ReFailure(ResultCodes.BoxInventoryNoDataError);
}
//2.组装
var generateDtoList = dtoData.Details.SelectMany(x => x.BoxsDetails).GroupBy(x => new { x.BoxId })