对比失败,直接接口返回错误信息
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user