Reference: http://www.alfawzan.af.org.sa/node/16159
Question: A man took a bath [or shower] on the day of jumu’ah, with the intention he is bathing due to janaabah (major ritual impurity); so is he required to do wudhoo?
Response: If he made the intention to enter [the state of] wudhoo whilst having a bath [or shower] – and in doing so he made sure water passed all over his body, then there is no harm [in him having done so]; this is based upon his ﷺ saying:
«Indeed, actions are by intentions, and for every person is what he intended…» [the authenticity of this narration is agreed upon by both al-Bukhaaree and Muslim].
If, however, he did not make the intention to enter [the state of] wudhoo whilst having a bath [or shower], then he is required to do wudhoo.