| | |
| | | result.FactoryArea = outboundOrder.FactoryArea; |
| | | List<Dt_OutboundOrderDetail> selectedDetails = new List<Dt_OutboundOrderDetail>(); |
| | | |
| | | if(request.DetailIds == null || !request.DetailIds.Any()) |
| | | if (request.DetailIds == null || !request.DetailIds.Any()) |
| | | { |
| | | selectedDetails = _detailRepository.QueryData(x => x.OrderId == outboundOrder.Id); |
| | | } |
| | | else |
| | | { |
| | | // è·åéæ©çåºåºæç» |
| | | selectedDetails = _detailRepository.QueryData(x => x.OrderId == outboundOrder.Id && request.DetailIds.Contains(x.Id)); |
| | | selectedDetails = _detailRepository.QueryData(x => x.OrderId == outboundOrder.Id && request.DetailIds.Contains(x.Id)); |
| | | } |
| | | |
| | | |
| | | |
| | | //if (outboundOrder.IsBatch == 1 && request.DetailIds.Count == 1) |
| | | //{ |
| | |
| | | //} |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | List<Dt_StockInfoDetail> stockInfoDetails = stockInfo.Details.Where((x => x.StockQuantity > x.OutboundQuantity)).ToList(); |
| | | |
| | | decimal itemQuantity = item.LockQuantity - item.OverOutQuantity; |
| | | |
| | | foreach (var stockDetail in stockInfoDetails) |
| | | { |
| | | if (item.LockQuantity - item.OverOutQuantity >= stockDetail.StockQuantity - stockInfoDetail.OutboundQuantity) |
| | | if (itemQuantity >= stockDetail.StockQuantity - stockDetail.OutboundQuantity) |
| | | { |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = stockDetail.Barcode, |
| | | Qty = stockDetail.StockQuantity - stockInfoDetail.OutboundQuantity, |
| | | Qty = stockDetail.StockQuantity - stockDetail.OutboundQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | | Unit = stockDetail?.Unit ?? "" |
| | | }; |
| | | |
| | | stockDetail.StockQuantity = stockInfoDetail.OutboundQuantity; |
| | | itemQuantity -= (stockDetail.StockQuantity - stockDetail.OutboundQuantity); |
| | | stockDetail.OutboundQuantity = stockDetail.StockQuantity; |
| | | barcodesList.Add(barcodes); |
| | | |
| | | if (itemQuantity <= 0) break; |
| | | } |
| | | else |
| | | { |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = stockDetail.Barcode, |
| | | Qty = item.LockQuantity - item.OverOutQuantity, |
| | | Qty = itemQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | | Unit = stockDetail?.Unit ?? "" |
| | | }; |
| | | stockInfoDetail.OutboundQuantity += item.LockQuantity - item.OverOutQuantity; |
| | | stockDetail.OutboundQuantity += itemQuantity; |
| | | barcodesList.Add(barcodes); |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | UpdateOutboundOrderStatus(request.OrderNo, OutOrderStatusEnum.åºåºå®æ.ObjToInt()); |
| | | |
| | | if(outboundOrder.OrderType != OutOrderTypeEnum.InternalAllocat.ObjToInt()) |
| | | if (outboundOrder.OrderType != OutOrderTypeEnum.InternalAllocat.ObjToInt()) |
| | | { |
| | | _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = request.Barcode, |
| | | Barcode = isUnpacked ? newBarcode : stockDetail?.Barcode, |
| | | Qty = barcodeQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | |
| | | |
| | | var newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = stations[station], |
| | | CurrentAddress = stations.GetValueOrDefault(station) ?? "", |
| | | Grade = 0, |
| | | PalletCode = palletCode, |
| | | NextAddress = "", |
| | | OrderNo = OrderNo, |
| | | Roadway = newLocation.RoadwayNo, |
| | | SourceAddress = stations[station], |
| | | SourceAddress = stations.GetValueOrDefault(station) ?? "", |
| | | TargetAddress = newLocation.LocationCode, |
| | | TaskStatus = (int)TaskStatusEnum.New, |
| | | TaskType = stock.Details.Count > 0 ? (int)TaskTypeEnum.InPick : (int)TaskTypeEnum.InEmpty, |
| | |
| | | _stockInfoRepository.UpdateData(stock); |
| | | _taskRepository.AddData(newTask); |
| | | |
| | | //var moveResult = await _eSSApiService.MoveContainerAsync(new MoveContainerRequest |
| | | //{ |
| | | // slotCode = movestations[station], |
| | | // containerCode = palletCode |
| | | //}); |
| | | var moveResult = await _eSSApiService.MoveContainerAsync(new MoveContainerRequest |
| | | { |
| | | slotCode = movestations[station], |
| | | containerCode = palletCode |
| | | }); |
| | | return content.OK(); |
| | | |
| | | } |