接口优化

This commit is contained in:
tongfei
2023-11-22 11:06:06 +08:00
parent e9d775870b
commit 44f21ae5f1
6 changed files with 126 additions and 74 deletions

View File

@@ -448,7 +448,7 @@ namespace WMS.Web.Domain.Services
var boxDetails = boxs.SelectMany(x => x.Details).GroupBy(x => x.MaterialId).Select(x => new { MaterialId = x.Key, Qty = x.Sum(t => t.Qty) }).ToList();
//3.比对false为比对失败;
bool isRight = boxDetails.All(x => task.Details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty >= x.Qty)) && boxDetails.Count == task.Details.Count;
bool isRight = boxDetails.All(x => task.Details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty >= x.Qty)) && boxDetails.Count <= task.Details.Count;
if (!isRight)
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.ContrastError);