New Zealand dairy exporter Fonterra Co-operative Group Ltd has agreed to buy 43% of a Chinese dairy firm for $152 million.