Zhu Yi, whose family opened the shop after moving from the southern city Guangzhou in 2008, said they had been given ample warning of the work. He acknowledged that the storefront entrance, which led to a basement shop, had not been erected according to any zoning code, but rents in nearby shopping centers are too exorbitant.

“To this government it is illegal,” he said, but added that a shop like theirs should also be “a part of Beijing’s local color.”

As with most government decisions in China, there was no public debate about the campaign, and those affected said there was little they could do to challenge it.

It took root in 2014, with President Xi Jinping’s declaration that Beijing would shift its “noncapital” functions to the surrounding regions. The plan would cap the city’s population at 23 million while expanding Tianjin and other nearby cities, linking them all together to create a megalopolis. With an important Communist Party congress coming in the fall, the local authorities have an added incentive to make the city orderly, if not immaculate.

A less explicit goal is to rid the capital of many of the migrants who have poured into Beijing and other principal cities in recent decades. While they were important contributors to China’s economic boom, officials seem to have calculated that they are not as vital to the new phase of development.