| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseOldCacheStocks(item.MaterialNo, item.Width).Where(x => !palletCodes.Contains(x.PalletCode)).ToList() ?? new List<Dt_StockInfo>(); |
| | | //è·åç«åºå¯ç¨åºå |
| | | stockInfos.AddRange(_stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!palletCodes.Contains(x.PalletCode)).ToList()); |
| | | |
| | | //è·åææè¯¥ç©æåæ® |
| | | List<Dt_OutSGOrderDetail> details = outboundOrderDetails.Where(x => x.MaterialNo == item.MaterialNo && x.Width == item.Width && x.MachineName == item.MachineName).ToList(); |
| | | |
| | | if (!stockInfos.Any()) |
| | | { |
| | | //没æå¯ç¨åºåï¼æ 记为缺æ |
| | | foreach (var detail in details) |
| | | { |
| | | detail.OutSGOrderDetailStatus = OutOrderStatusEnum.缺æ.ObjToInt(); |
| | | } |
| | | message += $"ç©æï¼{item.MaterialNo},å¹
宽ï¼{item.Width}æ åºåï¼"; |
| | | continue; |
| | | } |
| | |
| | | List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutOldStocks(stockInfos, needQuantity).ToList(); |
| | | //æ·»å åºååé
|
| | | outStocks.AddRange(autoAssignStocks); |
| | | //è·åææè¯¥ç©æåæ® |
| | | List<Dt_OutSGOrderDetail> details = outboundOrderDetails.Where(x => x.MaterialNo == item.MaterialNo && x.Width == item.Width && x.MachineName == item.MachineName).ToList(); |
| | | |
| | | autoAssignStocks.ForEach(x => |
| | | { |
| | | x.StockOutLength = 0; |