"你睡他那层不就得了吗" what does it mean? “不就得了”
The most important part is that the speaker is impatient now, and want to suggest something simple to stop the conversation.

不: isn't it xxx?
就：imediately become
得: achieve, solve
了: finish indicator
XXX 不就得了 ：If XXX was done, isn't the problem solved?

(let me try another version) Isn't XXX good enough to solve the problem?
(Or simply) Why not just XXX
It would be exchangeable with 不如就XXX！
Example:
A: 我非常不想去这个聚会，里面有不想面对的人。I don't want to go to this party. There is someone I don't want to meet.
B: 不去不就得了。 Why not just not going there.
Or similarly
B: 不如就不去。