优化接口

This commit is contained in:
tongfei
2024-04-11 16:55:53 +08:00
parent 20ecf4f1ce
commit 0773b932f8
4 changed files with 19 additions and 0 deletions

View File

@@ -1792,6 +1792,11 @@
仓库编码
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.InStockTask.ContrastMaterialsRequest.MaterialNumber">
<summary>
所选物料
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.InStockTask.ContrastMaterialsRequest.BoxBillNos">
<summary>
箱号集合

View File

@@ -23,6 +23,11 @@ namespace WMS.Web.Core.Dto.InStockTask
[Required(ErrorMessage = "仓库不能为空")]
public string StockCode { get; set; }
/// <summary>
/// 所选物料
/// </summary>
public string MaterialNumber { get; set; }
/// <summary>
/// 箱号集合
/// </summary>

View File

@@ -653,6 +653,14 @@ namespace WMS.Web.Domain.Services
if (boxs == null || boxs.Count == 0)
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.BoxNoData);
//判断箱不存在所选的物料
foreach (var item in boxs)
{
var isAnyHave= item.Details.Any(x => x.MaterialNumber == dto.MaterialNumber);
if(!isAnyHave)
return Result<ContrastMaterialsResponse>.ReFailure(item.BoxBillNo+ResultCodes.BoxNoMaterialError.Item2, ResultCodes.BoxNoMaterialError.Item1);
}
//3.判断箱里面对应的物料是否存在;不存在就报错
foreach (var item in boxs)
{

View File

@@ -46,6 +46,7 @@ namespace WMS.Web.Domain.Values
public static ValueTuple<int, string> BoxNoData = (80000, "系统找不到该箱号");
public static ValueTuple<int, string> InStockTaskBoxIsHaveData = (80000, "该箱已收货");
public static ValueTuple<int, string> BoxBillNoError = (80000, "请扫描箱码作为箱号");
public static ValueTuple<int, string> BoxNoMaterialError = (80000, "该箱不存在对应所需的物料");
public static ValueTuple<int, string> BoxMateriaNoData = (800010, "箱对应物料信息不存在");
public static ValueTuple<int, string> MateriaNoData = (800011, "产品信息不存在");
public static ValueTuple<int, string> BoxInventorySerialNumbersNoData = (800012, "序列号不存在于箱库存数据中");