Battery-swapping stations (BSSs) are one of the main types of electric vehicle (EV) refueling facilities. By battery swapping, EVs first replace their depleted batteries (DBs) with fully charged ones, and then, the demounted DBs can be recharged in charging facilities in a stand-alone mode, leading to a decouple between batteries and EVs during refueling. This article targets the planning and operation of a network of geographically distributed BSSs, termed BSS-Net. In particular, we focus on two important decisions being made within two different timescales, namely, a long-term decision on planning the initial inventory in each individual BSS and a short-term decision on real-time vehicle-to-station (V2S) routing of EVs. We formulate a two-stage optimization problem and propose a two-step solution scheme. Specifically, in the first step, we determine the long-term initial inventory by sample average approximation, and the resulting planning decision leads to a maximized total expected revenue for the BSS-Net. Based on the optimal initial inventory, we design a randomized online algorithm in the second step to perform real-time V2S routing, without assuming any future EV arrival information. We rigorously prove that the worst case performance of the randomized online algorithm is theoretically bounded by a closed-form competitive ratio.