And before that, the Ming banned coastal trade. https://en.wikipedia.org/wiki/Haijin
I don't think this can really be a complete description of the situation. You can't stop smuggling as a phenomenon, because you can't oversee everything that happens everywhere. So, as much as you might wish it would, the law doesn't really apply to random smugglers.
But by the time you're one of the 100 richest men in China, the law certainly does apply to you. A ban on trade that's "less than 100% effective" is more than enough to stop someone from doing so much trade that they become personally more powerful than the court, as long as "less than 100%" still means "more than 0%".
In reality, the people who were trading mostly continued to do so, becoming pirates and smugglers themselves in the process, and Ming China simultaneously lost a bunch of tax revenue from trade as well as tying up a huge part of the labor force in enforcing a sea ban.
The Qing policy was more successful but also required all property destroyed within 30 miles of the coast or face the death penalty, which is extreme to say the least.
It is documented in the Tang Dynasty that boats from Japan bound for China would sometimes land along the coast of Jiangsu then the occupants would move inland. IIRC if riverborne the first small town they would reach was Nantong, and the first major town up-river would be Yangzhou. Approaching overland, they would no doubt be escorted directly to Yangzhou. Jiangsu seems to have essentially consisted of a vast canal network and agricultural lands. Presumably the Koreans hit Shandong (dodging pirates), and the South (India) and Southeast Asians (Philippines, Sumatra, Borneo, Vietnam, Thailand, Malaysia) hit Guangdong or Guangxi. Fujian, in the middle of these landing zones, had sometimes in history a flourishing trading culture, with Quanzhou IIRC the town from which historically attested Chinese Zhenghe expeditions departed as far as Southeast Asia, India, Arabia and Africa, and global religious communities are attested.
Zhenghe was himself a sufi muslim Eunuch born inland in the Himalayas at ~2200m altitude, last bastion of the purged Mongol-era ruling family of Yunnan, descended from the pre-Mongol invasion Emir of Bokhara, Uzbekistan, and through his family thought to be fluent in Persian, which was then something of a pan-regional lingua franca.
Despite this, the modern Chinese state narrative is that everyone is flat "Chinese". Further leaning on the Central Asian cultural nexus, it is worth re-stating that Li Bai, arguably classical China's most famous poet, was actually born in Kyrgyzstan and after moving to China lived primarily in the then-remote province of Sichuan, quite peripheral to northern Chinese culture, in fact the province was contemporaneously successfully invaded by the Tibeto-Burman rival kingdom of Nanzhao, whose still visible legacy includes undeniably Hindu grottoes carved in Sanskrit.
If you want to learn history, don't look at modern textbooks.
Bullet train takes nearly 2 hours. So I assume it would take about half a day by boat. But still good point.
Another thing to consider is the long historical record of Yangtze flooding and the depositing of silt and debris in the delta. Until good flood control structures were built, Shanghai is not really in a good place to grow.