| | |
| | | foreach (var detail in inboundOrder.Details) |
| | | { |
| | | if (detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt() && |
| | | !string.IsNullOrEmpty(detail.Barcode)) |
| | | !string.IsNullOrEmpty(detail.Barcode)&& detail.OutBoxbarcodes == noStockOut.barCode) |
| | | { |
| | | detailLists.Add(detail); |
| | | } |
| | |
| | | { |
| | | item.NoStockOutQty = 0; |
| | | |
| | | var matchedCode = outboundOrder.Details.FirstOrDefault(detail => detail.MaterielCode == item.MaterielCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt() && (detail.OrderQuantity-detail.LockQuantity-detail.MoveQty-detail.NoStockOutQty)>0); |
| | | var matchedCode = outboundOrder.Details.FirstOrDefault(detail => detail.MaterielCode == item.MaterielCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt()&& detail.OrderQuantity - detail.LockQuantity - detail.MoveQty - detail.NoStockOutQty > 0); |
| | | |
| | | if (matchedCode == null) |
| | | if (matchedCode != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å¨åºåºåçç©æç¼ç 䏿ªæ¾å°ä¸éè´åä¸ç{item.MaterielCode} 对åºçç©æã"); |
| | | if(matchedCode.OrderQuantity - matchedCode.LockQuantity - matchedCode.MoveQty - matchedCode.NoStockOutQty < 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç©æ{item.MaterielCode}å¯åºæ°é溢åº{(matchedCode.LockQuantity + matchedCode.MoveQty + matchedCode.NoStockOutQty) - matchedCode.OrderQuantity}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"å¨åºåºåçç©æç¼ç 䏿ªæ¾å°ä¸éè´åä¸ç{item.MaterielCode} 对åºçç©æ"); |
| | | } |
| | | if (!matchedCode.BatchNo.IsNullOrEmpty() && matchedCode.BatchNo != "") |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error($"该æ¡ç {item.Barcode}对åºçåæ®ååºä¸åºåºåæ®ä¸ä¸è´ï¼ä¸å
许åºåºã"); |
| | | } |
| | | } |
| | | if (!matchedCode.WarehouseCode.IsNullOrEmpty() && matchedCode.WarehouseCode != "") |
| | | if(inboundOrder.BusinessType != "11") |
| | | { |
| | | var matcheBatch = outboundOrder.Details.FirstOrDefault(detail => detail.WarehouseCode == item.WarehouseCode); |
| | | if (matcheBatch == null) |
| | | if (!matchedCode.WarehouseCode.IsNullOrEmpty() && matchedCode.WarehouseCode != "") |
| | | { |
| | | return WebResponseContent.Instance.Error($"ä»åºä¸ä¸è´ï¼å¨åºåºåçç©æç¼ç 䏿ªæ¾å°ä¸éè´åä»åºä¸ç{item.WarehouseCode} 对åºçç©æã"); |
| | | var matcheBatch = outboundOrder.Details.FirstOrDefault(detail => detail.WarehouseCode == item.WarehouseCode); |
| | | if (matcheBatch == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ä»åºä¸ä¸è´ï¼å¨åºåºåçç©æç¼ç 䏿ªæ¾å°ä¸éè´åä»åºä¸ç{item.WarehouseCode} 对åºçç©æã"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | item.LockQuantity = item.NoStockOutQty; |
| | | item.OverOutQuantity = item.NoStockOutQty; |
| | | item.CurrentDeliveryQty = item.OverOutQuantity; |
| | | //æ·»å åä¼ MESåæ° |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | List<Barcodes> documentsNOList = new List<Barcodes>(); |
| | |
| | | BusinessType = "3", |
| | | FactoryArea = inboundOrder.FactoryArea, |
| | | OperationType = 1, |
| | | Operator = inboundOrder.Operator, |
| | | Operator = App.User.UserName, |
| | | OrderNo = inboundOrder.UpperOrderNo, |
| | | fromWarehouse = allocate?.FromWarehouse ?? "", |
| | | toWarehouse = allocate?.ToWarehouse ?? "", |
| | |
| | | |
| | | if (response != null && response.IsSuccess) |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | return content.Error("åä¼ MES失败"); |
| | | } |
| | | } |
| | |
| | | business_type = inboundOrder.BusinessType, |
| | | factoryArea = inboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = inboundOrder.Operator, |
| | | Operator = App.User.UserName, |
| | | orderNo = inboundOrder.UpperOrderNo, |
| | | status = inboundOrder.OrderStatus, |
| | | details = NoStockOutFeedbackInboundDetailsModelDto(detail) |
| | |
| | | |
| | | if (response != null && response.IsSuccess) |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).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 }); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }).Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | return content.Error("åä¼ MES失败"); |
| | | } |
| | | } |