It was explicitly not China's objective to take cities. They just wanted to settle the border conflict and demilitarize Vietnam.
China also needed to showcase it's land forces, to show that if US or USSR invaded, China could make Korea happen again, or repel them to an even greater extent.
7000 irretrievable casualties to 60-100 000 is an absolute beating. It's a stronger performance than what Russia is doing in Ukraine.
If you doubt the numbers, there is irrefutable proof in that despite China being the attacking side in the notoriously unfriendly Vietnamese territory, China still took an order of magnitude more prisoners than Vietnam.
Ultimately, the war settled border disputes in China's favor, prevented Vietnam from expanding it's national power indefintely, and China showed that the spirit of Korea, the ability of the PLA to wreck larger forces through inventive tactics, was alive and well. And as such, neither the USSR or US dared to invade, despite tense moments such as the Taiwan strait crisis.