The emergence of renewable energy microgrids (REM)-supported logistics parks reflects the urgent social requirement for sustainability facing energy crisis and climate change. Focusing on the emergency REM capacity planning and dynamic inventory operations problem for a REM-supported cold warehouse, this paper constructs a novel two-stage stochastic optimization method to comprehensively minimise long-term investment and short-term emergency operation costs of the system, while improving the resilience of energy-constrained supply chain management of perishable products. In particular, we formulate the second stage emergency operation problem as a Markov decision process that considers the interaction between energy and operational decisions constrained by intermittent of renewable energy, the randomness of the occurrence time, and the balance between power supply and temperature changes of the cold warehouse. We propose a novel two-phase PSO-based MPC algorithm to solve the entire problem. We also examine the effectiveness of our algorithm via an empirical study based on the data in East China. Nine typical scenarios clustered from the real data suggest different optimal capacity planning and operational policies. The empirical results show that it can reduce an overall 9% of operating costs on average compared to other heuristic policies. Moreover, installing REM can improve the resilience of power systems by 23% (risk impact area reduction ratio) and improve the resilience of inventory systems by 49%.