| | |
| | | { |
| | | return content.Error("æªæ¾å°è¯¥çç¹åæ®"); |
| | | } |
| | | var stock = _stockInfoRepository.QueryFirst(x => x.PalletCode == boxNo); |
| | | var stock = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == boxNo).Includes(x=>x.Details).First(); |
| | | |
| | | if (stock == null) |
| | | { |
| | |
| | | PalletType = stock.PalletType, |
| | | WarehouseId = stock.WarehouseId |
| | | }; |
| | | if (stock.Details.Count <= 0) |
| | | { |
| | | stock.PalletType = (int)PalletTypeEnum.Empty; |
| | | newTask.TaskType = TaskTypeEnum.InEmpty.ObjToInt(); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockInfoRepository.UpdateData(stock); |
| | | _takeStockOrder.UpdateData(takeStockOrder); |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥çç¹å·®å¼æ°æ®"); |
| | | } |
| | | //if(takeStockOrderDetail.Remark == "çç") |
| | | //{ |
| | | // Dt_InboundOrderDetail inboundOrderDetail = _inboundOrderDetailRepository.QueryFirst(x => x.Id == orderId); |
| | | // if(inboundOrderDetail == null) |
| | | // { |
| | | // return WebResponseContent.Instance.Error("æªæ¾å°éæ©çææ¶å¹³è´¦åæ®"); |
| | | // } |
| | | // Dt_InboundOrder inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x=>x.Id == inboundOrderDetail.OrderId).Includes(x=>x.Details).First(); |
| | | // Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x=>x.PalletCode == takeStockOrderDetail.TakePalletCode && x.StockStatus == StockStatusEmun.çç¹åºå宿.ObjToInt()).Includes(x=>x.Details).First(); |
| | | // if(stockInfo== null) |
| | | // { |
| | | // return WebResponseContent.Instance.Error($"çç¹æç{takeStockOrderDetail.TakePalletCode}çåºåä¿¡æ¯æªæ¾å°ï¼ææçç¶æä¸æ£ç¡®"); |
| | | // } |
| | | // var datevaliDate = _inboundOrderRepository.Db.Queryable<Dt_MaterialExpirationDate>().Where(x => x.MaterialCode.Contains(inboundOrderDetail.MaterielCode.Substring(0, 6))).First(); |
| | | // var newStockDetail = new Dt_StockInfoDetail |
| | | // { |
| | | // StockId = stockInfo == null ? 0 : stockInfo.Id, |
| | | // Barcode = inboundOrderDetail.Barcode, |
| | | // MaterielCode = inboundOrderDetail.MaterielCode, |
| | | // MaterielName = inboundOrderDetail.MaterielName, |
| | | // BatchNo = inboundOrderDetail.BatchNo, |
| | | // Unit = inboundOrderDetail.Unit, |
| | | // InboundOrderRowNo = inboundOrderDetail.lineNo, |
| | | // SupplyCode = inboundOrderDetail.SupplyCode, |
| | | // WarehouseCode = inboundOrderDetail.WarehouseCode, |
| | | // StockQuantity = inboundOrderDetail.OrderQuantity, |
| | | // BarcodeQty = inboundOrderDetail.BarcodeQty, |
| | | // BarcodeUnit = inboundOrderDetail.BarcodeUnit, |
| | | // FactoryArea = inboundOrder.FactoryArea, |
| | | // Status = 0, |
| | | // OrderNo = inboundOrder.InboundOrderNo, |
| | | // BusinessType = inboundOrder.BusinessType, |
| | | // ValidDate = inboundOrder.BusinessType == BusinessTypeEnum.å¤é¨ä»åºè°æºä».ToString() ? inboundOrderDetail.ValidDate : datevaliDate == null ? null : Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.ValidityDays)), |
| | | // }; |
| | | // stockInfo.Details.Add(newStockDetail); |
| | | |
| | | // inboundOrderDetail.ReceiptQuantity = inboundOrderDetail.OrderQuantity; |
| | | // inboundOrderDetail.OverInQuantity = inboundOrderDetail.OrderQuantity; |
| | | // inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); |
| | | // int overCount = 1; |
| | | // int moreOverCount = inboundOrder.Details.Count(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()); |
| | | // if (inboundOrder.Details.Count() == overCount + moreOverCount) |
| | | // { |
| | | // inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | // } |
| | | // else |
| | | // { |
| | | // inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | // } |
| | | // takeStockOrderDetail.DifferenceQty -= inboundOrderDetail.OrderQuantity; |
| | | // if(takeStockOrderDetail.DifferenceQty > 0) |
| | | // { |
| | | // takeStockOrderDetail.TakeDetalStatus = TakeStockDetailStatusEnum.ææ¶æå平账å¤çä¸.ObjToInt(); |
| | | // } |
| | | // else if (takeStockOrderDetail.DifferenceQty == 0) |
| | | // { |
| | | // takeStockOrderDetail.TakeDetalStatus = TakeStockDetailStatusEnum.ææ¶æå平账å¤ç.ObjToInt(); |
| | | // } |
| | | // else |
| | | // { |
| | | // return WebResponseContent.Instance.Error("è¯¥ææ¶åæ®æç»æ¡ç æ°é大äºå¾
平账æ°éï¼è¯·å¦éå
¶ä»åæ®å¹³è´¦"); |
| | | // } |
| | | |
| | | // _unitOfWorkManage.BeginTran(); |
| | | // _inboundOrderRepository.UpdateData(inboundOrder); |
| | | // _inboundOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | // _takeStockOrderDetail.UpdateData(takeStockOrderDetail); |
| | | // BaseDal.Db.Insertable(newStockDetail).ExecuteCommand(); |
| | | // _unitOfWorkManage.CommitTran(); |
| | | // List<string> barcodes = new List<string>(); |
| | | // barcodes.Add(inboundOrderDetail.Barcode); |
| | | // _outboundPickingService.NoStockOutBatchInOrderFeedbackToMes(inboundOrder.Id, barcodes); |
| | | |
| | | |
| | | //} |
| | | //else |
| | | //{ |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundOrderDetailRepository.QueryFirst(x => x.Remark == takeStockOrderDetail.TakeStockNo && (x.OrderQuantity-x.LockQuantity-x.MoveQty)>0); |
| | | if (outboundOrderDetail == null) |
| | | { |
| | |
| | | if (!string.IsNullOrEmpty(newBarcode)) |
| | | { |
| | | // ç©ææ°æ¡ç åä¼ |
| | | //_feedbackMesService.BarcodeFeedback(newBarcode); |
| | | _feedbackMesService.BarcodeFeedback(newBarcode); |
| | | } |
| | | |
| | | //_feedbackMesService.OutboundFeedback(outboundOrder.OrderNo); |
| | | List<Dt_OutboundOrderDetail> details = _outboundOrderDetailRepository.QueryData(x => x.OrderId == outboundOrder.Id); |
| | | if(details.All(x => x.OverOutQuantity >= x.OrderQuantity - x.MoveQty)) |
| | | { |
| | | _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo); |
| | | outboundOrder.OrderStatus = OutOrderStatusEnum.åºåºå®æ.ObjToInt(); |
| | | _outboundOrderRepository.UpdateData(outboundOrder); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |