No bill or claim for any such work shall be allowed by any officer of a state agency or public corporation or be paid out of its funds, unless it appears that the work was executed within the state or that the execution thereof within the state could not have been procured, or procured at reasonable and competitive rates, and no action shall be maintained against such corporation or its officers upon any contract for such work unless it is alleged and proved that the work was done within the state or that the bids received therefor were unreasonable or not truly competitive.