Germany's highest court has ruled in favour of upholding restrictions on shop opening hours despite objections from one major retailer.