In my experience, the best solution is to stockpile the raw ingredients so that you have to walk past the prepared meals to reach the raw ingredients. As long as the raw food is further from the dwarves than the prepared food, they should go for the prepared food. The dwarves in your kitchen area might get hungry while they're cooking, causing them to grab raw food, but everyone else should always be closer to your prepared food. It should look like this:
R: Raw food stockpile, Kitchens, etc
P: Prepared food stockpile
D: Dining Hall
S: Stairwell
. : Walls
Top-down view
...................
.RRRR.PPPP.DDDD.SS.
.RRRRRPPPPDDDDDDSS.
.RRRR.PPPP.DDDD.SS.
...................
A couple of caveats: You'll have to include ALL raw food in your fort behind a prepared food stockpile like this if you don't want dwarves to eat it raw. This includes butchered animal meat as well as edible plants. If you want to keep dwarves from having to haul a bunch of crap around, that means putting your raw food, your farms, your plant stockpiles, your brewers, your animal corpse stockpiles, your butchery, maybe a bone carving workshop, and your fishery all behind that prepared food stockpile. This also increases the number of dwarves who are going to be near raw food at any given time, increasing the chance that THOSE dwarves will eat raw food. Ultimately some jobs are just going to be near raw food any way you do things. If you plan around this pathing though, you can makes sure that all the dwarves who don't have to be near raw food avoid it.
Even if you don't go all-in, putting your raw food stockpiles behind the prepared food stockpiles should drastically reduce the number of dwarves eating raw food.