Piezotronic devices have attracted a great deal of attention due to their potential applications in self-powered tactile sensing, nano-device memory, human-electronic interface, etc. As the size of piezotronic devices shrinks, some interesting quantum effects begin to appear. In this paper, we establish a theory oriented to the engineering application of piezoelectric semiconductors, called quantum-corrected phenomenological (QCP) theory, by coupling the density-gradient theory and the linear piezoelectricity theory through Gauss's law. For numerical verification, we specifically studied the electromechanical behaviors in GaN/AlGaN heterostructure quantum wells (QWs) with both infinite and finite barrier height. The results of electron density, electric potential, and quantum potential are provided, and their dependence on the doping density, the applied stress, and the Al mole fraction is investigated. Some interesting quantum effects are revealed, and their influencing mechanisms are well investigated from a macroscopic perspective. Not only do the conclusions drawn in this paper enrich the fundamental understanding of the piezotronic effect in a QW structure, but also the proposed QCP theory can serve as a valuable tool for future device engineering.