Since 1979, Chinese military has revolutionized itself through modernization and downsizing. I do think that Vietnam is a good testing ground to try new strategies and tactics, while minimizing casualties. They have no way of matching China's air and naval power, thus we can bombard them from the sky and sea with impunity. Once their major command and communication structures are taken out, ground forces can mop up any disorganized resistance. I predict no more than 2000 casualties in total, compared to nearly 30,000 in 1979.
Also, a short war will put a dent into their economic growth, while driving up their inflation. They will have no choice but to further depend on China in the future to stay afloat. A military loss would lead to massive unrest against the Vietnamese government, draining their resources away from South China Sea. It also serves as a warning to Philippines of the potential consequences. For these reasons, I think a short campaign lasting no more than a month would be acceptable to China.