1) If you have worked in HK or not is not important and has nothing to do with a CHINA work visa.
2) Applying a correct working visa for Shanghai this must be done in Shanghai together with the application for your residence permit.
3) This also includes some work from your employer - they need to provide all the company registration proof + your contract and an explanation of your job duties etc.
4) Best is to do this through FESCO in Shanghai
.......:[EFESCO]:........
5) And you also must make a health check there in Shanghai.
6) This all takes around 6 weeks until all procedures is finished.
7) It is the duty of your employer to take care of this - and if they do not know about this better be careful and make sure everything is correct and legal with your new company.