| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundRepository; |
| | |
| | | foreach (var item in groupDetails) |
| | | { |
| | | decimal needQuantity = item.XqLen; |
| | | //鑾峰彇鍙敤搴撳瓨 |
| | | 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(); |
| | | //鑾峰彇鑰佸巶缂撳瓨鍙敤搴撳瓨 |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseOldCacheStocks(item.MaterialNo, item.Width) ?? new List<Dt_StockInfo>(); |
| | | //鑾峰彇绔嬪簱鍙敤搴撳瓨 |
| | | stockInfos.AddRange(_stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!outStocks.Select(x=>x.PalletCode).Contains(x.PalletCode)).ToList()); |
| | | if (!stockInfos.Any()) |
| | | { |
| | | continue; |
| | |
| | | |
| | | } |
| | | |
| | | locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList())); |
| | | locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Where(x=>!x.LocationCode.IsNullOrEmpty() && !locationInfos.Select(x=>x.LocationCode).Contains(x.LocationCode)).Select(x => x.LocationCode).ToList())); |
| | | } |
| | | |
| | | return (outStocks, outboundOrderDetails, outStockLockInfos, locationInfos); |
| | |
| | | { |
| | | try |
| | | { |
| | | stockInfos.Where(x => x.LocationCode.IsNullOrEmpty()).ToList().ForEach(x => |
| | | { |
| | | x.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt(); |
| | | }); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfos); |
| | | BaseDal.UpdateData(outboundOrderDetails); |
| | | |