| | |
| | | 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; |
| | |
| | | }); |
| | | for (int i = 0; i < details.Count; i++) |
| | | { |
| | | //è®¢åæ°é |
| | | ////è®¢åæ°é |
| | | //if ((details.Count-1) == i) |
| | | //{ |
| | | |
| | | //} |
| | | decimal orderQuantity = details[i].XqLen; |
| | | bool assignStop = true; |
| | | while (assignStop) |
| | |
| | | |
| | | } |
| | | |
| | | 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); |
| | | |
| | |
| | | } |
| | | |
| | | _outStockLockInfoService.Repository.AddData(addOutStockLockInfos); |
| | | List<Dt_OutStockLockInfo> addOutCacheInfos = addOutStockLockInfos.Where(x => x.LocationCode.Contains("èåç¼ååº")).ToList(); |
| | | List<Dt_OutLineView> outLineViewsAdd = addOutCacheInfos.Select(x => _mapper.Map<Dt_OutLineView>(x)).ToList(); |
| | | _outboundRepository.OutLineViewRepository.AddData(outLineViewsAdd); |
| | | } |
| | | List<Dt_OutStockLockInfo> updateOutStockLockInfos = outStockLockInfos.Where(x => x.Id > 0).ToList(); |
| | | if (updateOutStockLockInfos != null && updateOutStockLockInfos.Any()) |