| | |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | item.WarehouseCode = matchedCode.WarehouseCode; |
| | | } |
| | | |
| | | //å©ä½å
¥åºæ°éå³èæåºå
¥åºå©ä½å¯åºæ°é |
| | | decimal outQuantity = item.OrderQuantity - item.ReceiptQuantity; |
| | |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = item.Barcode, |
| | | Qty = item.BarcodeQty, |
| | | Qty = item.OrderQuantity, |
| | | SupplyCode = item?.SupplyCode ?? "", |
| | | BatchNo = item?.BatchNo ?? "", |
| | | Unit = item?.Unit ?? "" |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"åºåºåæç»æ°é溢åº{matchedCode.OrderQuantity - matchedCode.LockQuantity-matchedCode.NoStockOutQty-matchedCode.MoveQty}"); |
| | | } |
| | | item.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt(); |
| | | |
| | | outDetails.Add(matchedCode); |
| | | } |
| | |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = matchedDetail.Barcode, |
| | | Qty = matchedDetail.BarcodeQty, |
| | | Qty = matchedDetail.OrderQuantity, |
| | | SupplyCode = matchedDetail?.SupplyCode ?? "", |
| | | BatchNo = matchedDetail?.BatchNo ?? "", |
| | | Unit = matchedDetail?.Unit ?? "" |
| | |
| | | NoStockOutBatchInOrderFeedbackToMes(orderId, barCodeList); |
| | | } |
| | | |
| | | |
| | | //åªå¯¹åºåºæ¡ç çåºåºåæç»è¿è¡è®¡ç®åä¼ |
| | | List<Dt_OutboundOrderDetail> outboundOrderDetail = outboundOrder.Details |
| | | .Where(x => !string.IsNullOrWhiteSpace(x.documentsNO) |
| | |
| | | |
| | | foreach (var item in outboundOrderDetail) |
| | | { |
| | | item.LockQuantity = item.NoStockOutQty; |
| | | item.OverOutQuantity = item.NoStockOutQty; |
| | | item.CurrentDeliveryQty = item.OverOutQuantity; |
| | | item.LockQuantity += item.NoStockOutQty; |
| | | item.OverOutQuantity += item.NoStockOutQty; |
| | | item.CurrentDeliveryQty = item.NoStockOutQty; |
| | | //æ·»å åä¼ MESåæ° |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | List<Barcodes> documentsNOList = new List<Barcodes>(); |
| | |
| | | TaskNum = 0, |
| | | ChangeType = (int)StockChangeTypeEnum.Inbound, |
| | | ChangeQuantity = -item.NoStockOutQty, |
| | | BeforeQuantity = item.OrderQuantity - item.OverOutQuantity-item.MoveQty, |
| | | AfterQuantity = item.OrderQuantity - item.OverOutQuantity - item.MoveQty - item.NoStockOutQty, |
| | | BeforeQuantity = item.OrderQuantity, |
| | | AfterQuantity = item.OrderQuantity - item.OverOutQuantity, |
| | | SupplyCode = item.SupplyCode ?? "", |
| | | WarehouseCode = item.WarehouseCode ?? "", |
| | | Remark = $"èæåºåº" |
| | |
| | | if (CheckOutboundOrderCompleted(outboundOrder.OrderNo)) |
| | | { |
| | | outboundOrder.OrderStatus = OutOrderStatusEnum.åºåºå®æ.ObjToInt(); |
| | | _outboundOrderService.UpdateData(outboundOrder); |
| | | |
| | | } |
| | | else |
| | | { |
| | | outboundOrder.OrderStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | } |
| | | _outboundOrderService.UpdateData(outboundOrder); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //åºåºåä¼ MES |
| | | _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo); |
| | |
| | | if (response != null && response.IsSuccess) |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | .Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | .Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus =2}) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | return content.Error("åä¼ MES失败"); |
| | | } |
| | | } |
| | |
| | | if (response != null && response.IsSuccess) |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | .Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }).Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }).Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | return content.Error("åä¼ MES失败"); |
| | |
| | | }).ToList(); |
| | | return groupedData; |
| | | } |
| | | public List<FeedbackInboundDetailsModel> NoStockOutFeedbackInboundDetailsModelDto(List<Dt_InboundOrderDetail> inboundOrderDetails) |
| | | public List<FeedbackInboundDetailsModel> NoStockOutFeedbackInboundDetailsModelDto(List<Dt_InboundOrderDetail> inboundOrderDetails ) |
| | | { |
| | | var groupedData = inboundOrderDetails.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new FeedbackInboundDetailsModel |