Under investigation in this paper is a generalized (3+1)-dimensional Kadomtsev–Petviashvili equation in fluid dynamics and plasma physics. Soliton and one-periodic-wave solutions are obtained via the Hirota bilinear method and Hirota–Riemann method. Magnitude and velocity of the one soliton are derived. Graphs are presented to discuss the solitons and one-periodic waves: the coefficients in the equation can determine the velocity components of the one soliton, but cannot alter the soliton magnitude; the interaction between the two solitons is elastic; the coefficients in the equation can influence the periods and velocities of the periodic waves. Relation between the one-soliton solution and one-periodic wave solution is investigated.