| | |
| | | //如果没有找到相同物料的外侧货位,找一个内测空货位 |
| | | if (location == null) |
| | | { |
| | | location = GetEmptyLocByItemCode(areaCode, new int[] { 1, 4 }); |
| | | location = GetEmptyLocByItemCode(areaCode, new List<int> { 1, 4 }); |
| | | } |
| | | return location; |
| | | } |
| | |
| | | /// <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) |
| | |
| | | return result; |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据货位集合获取有容器的货位 |
| | | /// </summary> |