diff --git a/WCS.WebApi/Controllers/PDAMatBindController.cs b/WCS.WebApi/Controllers/PDAMatBindController.cs index 39e0bc6..6f544cc 100644 --- a/WCS.WebApi/Controllers/PDAMatBindController.cs +++ b/WCS.WebApi/Controllers/PDAMatBindController.cs @@ -312,32 +312,6 @@ namespace WCS.WebApi.Controllers #endregion #region 数据校验 - //判断参数 - //if (string.IsNullOrEmpty(request.LocationCode)) - //{ - // return new ResponseCommon() - // { - // Code = 201, - // Message = "工位编码为空!", - // Data = null, - // }; - //} - - ////获取是否存在当前工位 - //var location = await DbHelp.db.Queryable() - // .Where(t => t.Id == request.LocationId) - // .Where(t => t.IsEnable == true) - // .FirstAsync(); - //if (location == null) - //{ - // return new ResponseCommon() - // { - // Code = 201, - // Message = $"工位[{request.LocationCode}]不存在或已被禁用!\r\n请联系系统管理人员维护工位信息!", - // Data = null, - // }; - //} - //获取当前工位的货架 var shelf = await DbHelp.db.Queryable() .Where(t => t.Id == request.ShelfId) @@ -364,6 +338,21 @@ namespace WCS.WebApi.Controllers Data = null, }; } + //获取货架是否已绑定物料 + var matCurrentInfo = await DbHelp.db.Queryable() + .Where(t => t.ShelfId == shelf.Id) + .OrderBy(t => t.Id) + .FirstAsync(); + //货架已绑定物料 + if (matCurrentInfo != null) + { + return new ResponseCommon() + { + Code = 201, + Message = $"当前货架已绑定物料:\r\n{matCurrentInfo.MatCode}\r\n请确认!", + Data = null, + }; + } //获取物料基础信息 var matBaseInfo = await DbHelp.db.Queryable() diff --git a/版本履历表.xlsx b/版本履历表.xlsx index 6926262..5cd958b 100644 Binary files a/版本履历表.xlsx and b/版本履历表.xlsx differ