对比接口优化
This commit is contained in:
@@ -343,12 +343,17 @@ namespace WMS.Web.Domain.Services
|
|||||||
if (box == null)
|
if (box == null)
|
||||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.BoxNoData);
|
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.BoxNoData);
|
||||||
|
|
||||||
//3.比对
|
//3.比对:false为比对失败;
|
||||||
bool isRight = box.Details.All(x => task.Details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty == x.Qty)) && box.Details.Count == task.Details.Count;
|
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)
|
if(!isRight)
|
||||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.ContrastError);
|
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.ContrastError);
|
||||||
|
|
||||||
//4.返回对比结果:true为比对成功,false为比对失败;并把箱ID和箱号返回
|
//4.是否存在箱号判断:存在的话,就不能收货或者非采购上架
|
||||||
|
bool isHave = task.Boxs.Where(x => x.BoxBillNo == box.BoxBillNo).Any();
|
||||||
|
if(isHave)
|
||||||
|
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.BoxHaveError);
|
||||||
|
|
||||||
|
//4.返回对比结果:true为比对成功,并把箱ID和箱号返回
|
||||||
var response = new ContrastMaterialsResponse();
|
var response = new ContrastMaterialsResponse();
|
||||||
response.BoxBillNo = box.BoxBillNo;
|
response.BoxBillNo = box.BoxBillNo;
|
||||||
response.BoxId = box.Id;
|
response.BoxId = box.Id;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace WMS.Web.Domain.Values
|
|||||||
public static ValueTuple<int, string> ErpSupplierError = (80005, "获取Erp相关供应商数据失败,请稍候再试!");
|
public static ValueTuple<int, string> ErpSupplierError = (80005, "获取Erp相关供应商数据失败,请稍候再试!");
|
||||||
public static ValueTuple<int, string> ErpStockError = (80006, "获取Erp相关仓库数据失败,请稍候再试!");
|
public static ValueTuple<int, string> ErpStockError = (80006, "获取Erp相关仓库数据失败,请稍候再试!");
|
||||||
public static ValueTuple<int, string> ErpMaterialError = (80007, "获取Erp相关物料数据失败,请稍候再试!");
|
public static ValueTuple<int, string> ErpMaterialError = (80007, "获取Erp相关物料数据失败,请稍候再试!");
|
||||||
|
public static ValueTuple<int, string> BoxHaveError = (80008, "该箱信息已被记录,请重新选择箱号!");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user