Peak-shaving and frequency-regulating energy storage company factory operation