| | |
| | | { |
| | | decimal needQuantity = item.XqLen; |
| | | //鑾峰彇鍙敤搴撳瓨 |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId); |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!outStocks.Select(x=>x.PalletCode).Contains(x.PalletCode)).ToList(); |
| | | if (!stockInfos.Any()) |
| | | { |
| | | throw new Exception($"鏈壘鍒板彲鍒嗛厤搴撳瓨"); |
| | |
| | | Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(sGOrder, details[i], autoAssignStocks[0], orderDetailNeedQuantity); |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | details[i].AssignTotalUsage = orderQuantity; |
| | | autoAssignStocks[0].StockOutLength-= orderDetailNeedQuantity; |
| | | autoAssignStocks[0].StockOutLength+= orderDetailNeedQuantity; |
| | | if (autoAssignStocks[0].StockOutLength== autoAssignStocks[0].StockLength) |
| | | { |
| | | autoAssignStocks.Remove(autoAssignStocks[0]); |
| | | } |
| | | assignStop =false; |
| | | } |
| | | } |