Julia Goerges beat World Number One Caroline Wozniacki in Stuttgart to win her first title of the year.