We describe a theoretical approach to calculate the electron impact dynamics of atoms/ions placed in a dense plasma. The model takes into consideration that the continuous electron and the guest atom/ion are affected by a recently proposed (dense) plasma shielding parameter potential. As a test case, the present numerical method is employed to study the electron-impact excitation of He-like Ti XXI by using the distorted-wave wavefunction in the framework of the fully relativistic theory. The finite temperature and density effects as well as solid density plasma effects on the excitation energies, transition properties, and integrated cross sections are discussed in detail, which shed light on the shielding parameter potential in resolving practical problems. Results are compared with the available measurements and previous computations. The present work is not only providing a new implementation of the finite-temperature method by a self-consistent methodology, but also of great interest for the high energy density physics community, i.e., our results are of interest to the fusion researches.