The PSWD on-grid and off-grid switch cabinet system consists of AC power distribution cabinet, photovoltaic inverter (optional), local load and energy storage converter to form a set of AC micro-grid system. The microgrid switching cabinet can work in different modes as required.