Beijing's city government ordered 1,200 factories, including a refinery run by oil giant Sinopec, to shut or cut output.