Near-infrared spectroscopic product and process control