Large-scale electrification of urban bus fleets requires coordinated depot siting, route assignment, photovoltaic (PV) deployment, charging infrastructure, and battery storage operation. A two-stage framework is developed for planning and operating PV-assisted electric bus depots. Stage 1 uses a lexicographic mixed-integer linear programming model that first minimizes depot construction investment and then minimizes route-depot deadheading energy cost within the minimum-investment solution class. Stage 2 uses depot-level dynamic programming to schedule hourly PV generation, bus charging loads, station batteries, and grid exchange while enforcing energy balance, state-of-charge (SOC) continuity and limits, power limits, terminal SOC restoration, zero unserved demand, mutually exclusive battery charging and discharging, and no simultaneous grid buying and selling. Controlled low-price grid-to-battery charging is allowed only after direct PV-to-bus, PV-to-battery, battery-to-bus, and grid-to-bus supply are accounted for. Using site-specific PV estimates for 44 Haidian depots and operating data for 52 routes, the solution selects 12 depots, 140 charging piles, and 11,333.6 kWh of storage. The selected depots provide 68,107.4 kWh/day of PV potential for 67,671.6 kWh/day of assigned charging demand. The daily net dispatch cost is 1,209.9 yuan/day, unserved demand is zero, and the 25-year lifecycle cost is 105.28 million yuan. Storage lowers lifecycle cost by about 25.5 million yuan in the total-cost and construction-cost schemes. The charging-cost-oriented sensitivity case also shows that export-capacity or PV-deployment constraints are required when many PV-rich depots are opened.