lss
2025-05-15 dc5be5ac7d2a5aae1618fe3d1d8a689d10fdc9dc
HH.WCS.Mobox3/HH.WCS.Mobox3.DaYang/wms/LocationHelper.cs
@@ -115,7 +115,7 @@
                //如果没有找到相同物料的外侧货位,找一个内测空货位
                if (location == null)
                {
                    location = GetEmptyLocByItemCode(areaCode, new int[] { 1, 4 });
                    location = GetEmptyLocByItemCode(areaCode, new List<int> { 1, 4 });
                }
                return location;
            }
@@ -167,14 +167,24 @@
        /// <param name="areaCode">库区编码</param>
        /// <param name="row">货位排</param>
        /// <returns></returns>
        internal static Location GetEmptyLocByItemCode(string areaCode, int[] row)
        internal static Location GetEmptyLocByItemCode(string areaCode, List<int> row)
        {
            var db = new SqlHelper<object>().GetInstance();
            Location location = null;
            try
            {
                //判断当前排可用货位小于2 如果小于2则不允许入
                for (int i = row.Count(); i < 0; i--)
                {
                    var locationNum = db.Queryable<Location>().Where(a => a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 && a.S_AREA_CODE == areaCode && a.N_ROW == row[i]).ToList().Count;
                    if (locationNum <= 2)
                    {
                        row.RemoveAt(i);
                    }
                }
                location = db.Queryable<Location>().Where(a => a.N_CURRENT_NUM == 0 && a.N_LOCK_STATE == 0 && a.S_AREA_CODE == areaCode && row.Contains(a.N_ROW)).First();
                return location;
            }
            catch (Exception ex)
@@ -322,7 +332,7 @@
            return result;
        }
        /// <summary>
        /// 根据货位集合获取有容器的货位
        /// </summary>