| | |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = item.Barcode, |
| | | Qty = item.BarcodeQty, |
| | | Qty = item.OrderQuantity, |
| | | SupplyCode = item?.SupplyCode ?? "", |
| | | BatchNo = item?.BatchNo ?? "", |
| | | Unit = item?.Unit ?? "" |
| | |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = matchedDetail.Barcode, |
| | | Qty = matchedDetail.BarcodeQty, |
| | | Qty = matchedDetail.OrderQuantity, |
| | | SupplyCode = matchedDetail?.SupplyCode ?? "", |
| | | BatchNo = matchedDetail?.BatchNo ?? "", |
| | | Unit = matchedDetail?.Unit ?? "" |
| | |
| | | _inboundOrderService.Db.Updateable(updateInboundOrders.Values.ToList()).ExecuteCommand(); |
| | | } |
| | | |
| | | // 7. 寰幆鍒嗙粍缁撴灉锛岃皟鐢∕ES鍥炰紶鏂规硶锛堟寜鍏ュ簱鍗曞垎缁勫洖浼狅級 |
| | | foreach (var kvp in orderIdBarCodeDict) |
| | | { |
| | | int orderId = kvp.Key; |
| | | List<string> barCodeList = kvp.Value; |
| | | //鍏ュ簱鍥炰紶MES |
| | | 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 = $"铏氭嫙鍑哄簱" |
| | |
| | | _outboundOrderService.UpdateData(outboundOrder); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | // 7. 寰幆鍒嗙粍缁撴灉锛岃皟鐢∕ES鍥炰紶鏂规硶锛堟寜鍏ュ簱鍗曞垎缁勫洖浼狅級 |
| | | foreach (var kvp in orderIdBarCodeDict) |
| | | { |
| | | int orderId = kvp.Key; |
| | | List<string> barCodeList = kvp.Value; |
| | | //鍏ュ簱鍥炰紶MES |
| | | NoStockOutBatchInOrderFeedbackToMes(orderId, barCodeList); |
| | | } |
| | | //鍑哄簱鍥炰紶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澶辫触"); |