| | |
| | | throw new Exception("选择的出库单明细参数错误"); |
| | | } |
| | | //所有要出库的出库分配信息(未下发的信息和待拣货的信息) |
| | | var item = Db.Queryable<BllExportAllot>().First(a => a.IsDel == "0" && a.SONo == soNo && a.SODetailNo == intDetailId && a.Status == "0" ); |
| | | var item = Db.Queryable<BllExportAllot>().First(a => a.IsDel == "0" && a.SONo == soNo && a.SODetailNo == intDetailId && a.PalletNo == palletNo && a.Status == "0" ); |
| | | if (item == null) //判断是否有需要下发的出库流水 |
| | | { |
| | | throw new Exception("当前出库单据无需要下发的托盘"); |
| | |
| | | var imBl = com.GetImTask(item.PalletNo); |
| | | if (imBl != null) |
| | | { |
| | | str = "要出库的托盘正在入库"; |
| | | return outDto1; |
| | | throw new Exception("要出库的托盘正在入库"); |
| | | } |
| | | //判断是否是已经出过库又回库 |
| | | if (item.Status == "0") |
| | |
| | | Db.Updateable(notice).ExecuteCommand(); |
| | | } |
| | | } |
| | | str = "要出库的托盘已在库外"; |
| | | Db.CommitTran(); |
| | | str = "托盘已在库外"; |
| | | return outDto1; |
| | | } |
| | | str = "要出库的托盘正在入库"; |
| | | return outDto1; |
| | | } |
| | | |
| | | var locate = Db.Queryable<SysStorageLocat>().First(m => m.LocatNo == locateNo && m.IsDel == "0");//当前出库的储位信息 |
| | | if (locate == null) |
| | | { |
| | | str = "出库的托盘储位信息错误(在储位表中未查询到)"; |
| | | return outDto1; |
| | | throw new Exception("出库的托盘储位信息错误(在储位表中未查询到)"); |
| | | } |
| | | //判断储位标志是否为损坏 |
| | | if (locate.Flag == "2") |
| | | { |
| | | str = "储位损坏不能出库"; |
| | | return outDto1; |
| | | throw new Exception("储位损坏不能出库"); |
| | | } |
| | | if (locate.WareHouseNo != "W02") |
| | | { |
| | | str = "托盘不在货架库上"; |
| | | return outDto1; |
| | | throw new Exception("托盘不在货架库上"); |
| | | } |
| | | var locateEnd = Db.Queryable<SysStorageLocat>().First(m => m.LocatNo == outModeLocate && m.IsDel == "0");//当前出库的目标储位信息 |
| | | if (locateEnd == null) |
| | | { |
| | | str = "出库的托盘储位信息错误(在储位表中未查询到)"; |
| | | return outDto1; |
| | | throw new Exception("出库的托盘储位信息错误(在储位表中未查询到)"); |
| | | } |
| | | else if (locateEnd.Status != "0") |
| | | { |
| | | str = "目标储位状态不是空储位"; |
| | | return outDto1; |
| | | throw new Exception("目标储位状态不是空储位"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | } |
| | | else if (locate.Status == "5") //移出中 |
| | | { |
| | | str = "当前要出库的储位正在移出"; |
| | | return outDto1; |
| | | throw new Exception("当前要出库的储位正在移出"); |
| | | } |
| | | |
| | | |