| | |
| | | List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>(); |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>(); |
| | | |
| | | List<Dt_NewOutboundOrderDetail> outboundOrderDetails = _outboundService.NewOutboundOrderDetailService.Repository.QueryData(x => keys.Contains(x.OrderId)); |
| | | List<Dt_NewOutboundOrderDetail> outboundOrderDetails = _outboundService.NewOutboundOrderDetailService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | if (outboundOrderDetails == null || outboundOrderDetails.Count == 0) |
| | | { |
| | | throw new Exception("未找到出库单明细信息"); |
| | |
| | | { |
| | | throw new Exception("所选出库单明细存在出库中或已完成"); |
| | | } |
| | | List<Dt_NewOutboundOrder> outboundOrders = _outboundService.NewOutboundOrderService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | List<Dt_NewOutboundOrder> outboundOrders = _outboundService.NewOutboundOrderService.Repository.QueryData(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId); |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.Repository.QueryData(x => outboundOrderDetails.Select(s => s.LPNNo).Contains(x.PalletCode)); |
| | | if (outboundOrderDetails == null || outboundOrderDetails.Count == 0) |
| | | { |
| | |
| | | stockInfoDetail.OutboundQuantity += item.OrderQuantity; |
| | | item.LockQuantity += item.OrderQuantity; |
| | | var outboundOrder = outboundOrders.FirstOrDefault(x => x.Id == item.OrderId); |
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundService.OutboundStockLockInfoService.GetOutStockLockInfo(outboundOrder, item, stockInfo, item.OrderQuantity); |
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundService.OutboundStockLockInfoService.GetOutStockLockInfo(outboundOrder, item, stockInfo, stockInfoDetail, item.OrderQuantity); |
| | | outStockLockInfo.Status = OutStockStatus.出库中.ObjToInt(); |
| | | item.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | outboundOrder.OrderStatus = OutboundStatusEnum.出库中.ObjToInt(); |
| | | stockInfo.StockStatus = StockStatusEmun.出库锁定.ObjToInt(); |
| | | var task = Newtasks.FirstOrDefault(x => x.PalletCode == item.LPNNo); |
| | | task.OrderNo = outboundOrder.OrderNo; |
| | | tasks.Add(task); |
| | |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | //将任务推送到WCS |
| | | return PushTasksToWCS(tasks); |
| | | return PushTasksWCS(tasks); |
| | | } |
| | | catch (Exception ex) |
| | | { |