Self-consistent approach for the thermodynamics of ions in dense plasmas in the superconfiguration approximation