对比失败,直接接口返回错误信息

This commit is contained in:
tongfei
2023-11-07 11:56:27 +08:00
parent 40918ca085
commit ce296eb9d3
5 changed files with 7 additions and 15 deletions

View File

@@ -241,13 +241,14 @@ namespace WMS.Web.Domain.Services
//3.比对
bool isRight = box.Details.All(x => task.Details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty == x.Qty)) && box.Details.Count == task.Details.Count;
if(!isRight)
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.ContrastError);
//4.返回对比结果true为比对成功false为比对失败;并把箱ID和箱号返回
var response = new ContrastMaterialsResponse();
response.BoxBillNo = box.BoxBillNo;
response.BoxId = box.Id;
response.TotalCount = box.Details.Sum(x => x.Qty);
response.IsRight = isRight;
response.TotalCount = box.Details.Sum(x => x.Qty);
return Result<ContrastMaterialsResponse>.ReSuccess(response);
}
}