Try this:-
You can force Galaxy S7 or S7 edge to power off without unlocking the phone by following these steps:
Step 1: Connect Galaxy S7 and S7 edge to wall charger with the USB cable and make sure it is charging.
Step 2: Press and hold Volume down button and Power button (holding two buttons) for about 7 seconds.
Step 3: Release power button, then volume down button.
Now, Galaxy S7 or S7 edge should be powered off. You can wake up the screen to verify. It should show a charging battery icon.