I own an iPhone 7 like yours, and mine it's working fine.
I would suggest that you try all the basic troubleshooting steps. Test your device after each step.
1. Force restart your iP7 (press and hold your Power and Volume down buttons untill the Apple logo appears, then relaase both buttons).
2. Install a fresh copy of the current iOS (now 11.2.1). Make a full backup of your device, then connect it to a computer running the latest iTunes version (12.7.2). Follow the steps provided in this support guide, and at the end set your iP7 up as new: Restore your iPhone, iPad, or iPod to factory settings - Apple Support
3. Test it for a while, without restoring from your backup. If the device is working fine, you can exclude that your hardware is compromised.
4. Then restore it from your previously made backup Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
If it works fine, everything is ok. Shouldn't be this case, your software could be corrupted.
If this doesn't help you, contact your nearest Apple Store and have your device inspected.
Regards
Giulio