In 1976, Congress passed an incredibly stupid law giving the president the power to declare a national emergency with almost no limitation as to what could constitute an emergency, in a ham-handed attempt to limit the length of time such presidential emergency powers could last. Believe it or not, Trump will therefore win an initial court analysis based on that statute. It’s pretty shocking.
On the other hand, once the courts proceed, as they will, to the broader separation of powers and constitutional issues, there is a more important constitutional precedent, Youngstown Sheet & Tube Co. v. Sawyer, 343 U.S. 579 (1952), that was set when President Truman tried to seize the steel mills in order to control the economy. The Supreme Court slapped him down. Thankfully, that’s what will likely happen in this case, although as I note in a detailed explanation in my comment below, this is not at all certain.