Any electricians in the house?
But back to what the OP is wanting an answer for....
He needs to have a transfer switch for each sub panel.
He needs to have an Auto Paralleling Switch between the Genset and the batteries Inverter and charger.
The Solar Array sends its 50 Volts DC, to the inverter and the inverter sends power to keep the batteries charged. The inverter will also send Solar and battery power to the Paralleing switch in a POWER OUTAGE as 120 VDC or 240 VDC. It will match the phase of the Genset so some Inverter power will feed with the Genset power.
This is a huge project and to do a Round Robin system is not for novices. It needs some engineering and knowledge of codes
In my quick Jpeg, I left out Grounding/Earth. Everything needs to be grounded and bonded per CODE.