If it's a restaurant or canteen, light a white candle, and the flies will naturally fly away if they are afraid of the smell.
If it is a place with sufficient light, you can consider hanging water bags above the corners and windows, that is, the kind that uses plastic film to hold water, which should be crystal clear. Because flies have compound eyes, they immediately see more than N shiny light sources in their eyes, so they get dizzy and fly away as soon as possible.
-the above two tricks are very effective, because a friend is engaged in catering industry, and they don't kill animals, and they don't need to install fly swatter, ultraviolet ray fly killer and other equipment. For your reference.