What is the relationship between the potential obtained through the Poisson equation and the vacuum energy level in semiconductor band diagrams?

The Poisson equation describes the potential energy due to a collection of charges, i.e. v'' = - n, where we are in 1S, using units where the permittivity is 1, the potential is v and n is the charge density. The associated electric field is then E= - v'.

Assume we have a PN homojunction. At thermal equilibrium, the Fermi-level is flat while the conduction, valence and vacuum (V) energy levels bend.

How do I incorporate the potential v into this diagram or, if that is a band thing to do, how are they related? I always assumed v = V, but it seems that the vacuum energy level is the negative of the potential v. This would mean V'' = n. Is this correct, and if so, why?