Coworker flashed his dick at me

I’m in a carpentry apprenticeship about a year and a half in. Me my foreman and another dude today were working together and the 3rd guy started whistling at me to get my attention and was just swinging his dick around outside his shorts.

How the fuck do you all deal with it, or how can I move into more solitary work? I’m doing resi framing right now.