| | |
| | | |
| | | if (models.WareHouseNo == "W02") |
| | | { |
| | | storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02")).OrderBy(o => o.AreaNo).ToListAsync(); |
| | | storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02" || w.AreaNo == "B05")).OrderBy(o => o.AreaNo).ToListAsync(); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | } |
| | | return storageArea; |
| | | } |
| | | /// <summary> |
| | | /// 根据区域号获取储位地址集合 |
| | | /// </summary> |
| | | /// <param name="areaNo"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public List<string> GetLocatByArea(string areaNo) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(areaNo)) |
| | | { |
| | | throw new Exception("请选择区域"); |
| | | } |
| | | var _list = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0" && w.AreaNo == areaNo && w.WareHouseNo == "W04").Select(s => s.LocatNo).ToList(); |
| | | |
| | | return _list; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 获取已分配的出库单据 |
| | |
| | | } |
| | | }*/ |
| | | |
| | | public async Task AgvTransport(string palletNo, string areaNo, string ruku, string url, int userId) |
| | | public async Task AgvTransport(string palletNo, string areaNo,string locatNoEnd, string ruku, string url, int userId) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | throw Oops.Bah("所选区域信息不存在,请检查!"); |
| | | } |
| | | EndLocat = await GetLocat(areaNo); |
| | | if (!string.IsNullOrEmpty(locatNoEnd)) |
| | | { |
| | | EndLocat = locatNoEnd;//指定储位地址 |
| | | } |
| | | else |
| | | { |
| | | EndLocat = await GetLocat(areaNo);//系统分配储位地址 |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | throw Oops.Bah("托盘储位信息不存在,请检查!"); |
| | | } |
| | | if (stockDetail.WareHouseNo != "W04") |
| | | if (stockDetail.WareHouseNo != "W04" && stockDetail.WareHouseNo != "W02") |
| | | { |
| | | throw Oops.Bah("该托盘未在平库内,请检查!"); |
| | | throw Oops.Bah("该托盘未在平库或货架库内,请检查!"); |
| | | } |
| | | |
| | | //起始储位信息 |
| | |
| | | //目标储位信息 |
| | | //var storageLocatEnd = new SysStorageLocat(); |
| | | |
| | | var storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0"); |
| | | var storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.WareHouseNo == "W04" && w.AreaNo == areaNo); |
| | | if (storageLocatEnd == null) |
| | | { |
| | | throw Oops.Bah("目标储位信息不存在,请检查!"); |