| | |
| | | { |
| | | throw new Exception("该托盘未在平库内,请检查!"); |
| | | } |
| | | //起始储位信息 |
| | | var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == stockDetail.LocatNo); |
| | | if (storageLocat == null) |
| | | { |
| | | throw new Exception("储位信息不存在,请检查!"); |
| | | } |
| | | //目标储位信息 |
| | | var storageLocatEnd = new SysStorageLocat(); |
| | | if (!string.IsNullOrEmpty(areaNo)) |
| | | { |
| | | storageLocatEnd = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0"); |
| | | if (storageLocatEnd == null) |
| | | { |
| | | throw new Exception("目标储位信息不存在,请检查!"); |
| | | } |
| | | } |
| | | |
| | | //开启事务 |
| | | Db.BeginTran(); |
| | | |
| | |
| | | stock.LockQty += (decimal)stockDetail.Qty; |
| | | Db.Updateable(stock).ExecuteCommand(); |
| | | |
| | | //修改储位地址状态 |
| | | //修改起始储位地址状态 |
| | | storageLocat.Status = "5";//0:空储位 1:有物品 2:入库中 3:出库中 4:移入中 5:移出中 |
| | | Db.Updateable(storageLocat).ExecuteCommand(); |
| | | |
| | | //修改目标储位地址状态 |
| | | if (storageLocatEnd != null) |
| | | { |
| | | storageLocatEnd.Status = "4";//0:空储位 1:有物品 2:入库中 3:出库中 4:移入中 5:移出中 |
| | | Db.Updateable(storageLocatEnd).ExecuteCommand(); |
| | | } |
| | | //添加操作日志记录 |
| | | var k = new OperationCrServer().AddLogOperationCr("PDA模块", "AGV转运", palletNo, "移库", $"PDA呼叫小车对托盘号:{palletNo}发起转运", userId); |
| | | //提交事务 |
| | |
| | | } |
| | | string EndLocat = string.Empty;//目标位置 |
| | | EndLocat= GetLocat(areaNo, stockDetail.SkuNo, stockDetail.LotNo,palletNo); |
| | | //目标储位信息 |
| | | var storageLocatEnd = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.Status == "0"); |
| | | if (storageLocatEnd == null) |
| | | { |
| | | throw new Exception("目标储位信息不存在,请检查!"); |
| | | } |
| | | //开启事务 |
| | | Db.BeginTran(); |
| | | |
| | |
| | | storageLocat.Status = "5";//0:空储位 1:有物品 2:入库中 3:出库中 4:移入中 5:移出中 |
| | | Db.Updateable(storageLocat).ExecuteCommand(); |
| | | |
| | | //修改目标储位地址状态 |
| | | storageLocatEnd.Status = "4";//0:空储位 1:有物品 2:入库中 3:出库中 4:移入中 5:移出中 |
| | | Db.Updateable(storageLocatEnd).ExecuteCommand(); |
| | | |
| | | //添加操作日志记录 |
| | | var k = new OperationCrServer().AddLogOperationCr("PDA模块", "AGV转运", palletNo, "移库", $"PDA呼叫小车对托盘号:{palletNo}发起转运", userId); |
| | | //提交事务 |