You need a lawyer, the consulate is not going to help much. They have to deal with this all say.

You would be interested in rules on opening a business in Spain, which in turn would be the way to secure a work permit. In Spain you need a job offer before you can get the permit.