| | |
| | | |
| | | #endregion |
| | | |
| | | #region AGV转运 |
| | | /// <summary> |
| | | /// 获取托盘所在储位地址 |
| | | /// </summary> |
| | | /// <param name="palletNo"></param> |
| | | /// <returns></returns> |
| | | public string GetPalletLocatNo(string palletNo) |
| | | { |
| | | try |
| | | { |
| | | var models = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo); |
| | | if (models == null) |
| | | { |
| | | throw new Exception("托盘库存信息不存在,请检查!"); |
| | | } |
| | | if (string.IsNullOrEmpty(models.LocatNo)) |
| | | { |
| | | throw new Exception("托盘储位信息不存在,请检查!"); |
| | | } |
| | | return models.LocatNo; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取托盘所在楼层所有区域 |
| | | /// </summary> |
| | | /// <param name="palletNo"></param> |
| | | /// <returns></returns> |
| | | public List<SysStorageArea> GetStorageArea(string palletNo) |
| | | { |
| | | try |
| | | { |
| | | var models = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo); |
| | | if (models == null) |
| | | { |
| | | throw new Exception("托盘库存信息不存在,请检查!"); |
| | | } |
| | | if (string.IsNullOrEmpty(models.LocatNo)) |
| | | { |
| | | throw new Exception("托盘储位信息不存在,请检查!"); |
| | | } |
| | | var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == models.LocatNo); |
| | | if (storageLocat == null) |
| | | { |
| | | throw new Exception("储位信息不存在,请检查!"); |
| | | } |
| | | var storageArea = new List<SysStorageArea>(); |
| | | if (storageLocat.AreaNo.Contains("B0")) |
| | | { |
| | | storageArea = Db.Queryable<SysStorageArea>().Where(w => w.AreaNo.Contains("B0")).ToList(); |
| | | } |
| | | else |
| | | { |
| | | storageArea = Db.Queryable<SysStorageArea>().Where(w => w.AreaNo.Contains("B1")).ToList(); |
| | | } |
| | | return storageArea; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |