Integration of Quantum Many-Body Problems by Affine Knizhnik-Zamolodchikov Equations