Write a piece of SQL code: find out the sales volume of Huawei in Beijing and Shanghai in 2022. The name of the table is the contract table, and the table fields include date, region, product, quantity, and amount.