When you say you "get" 342, what are you referring to? Actual miles driven until the battery goes to zero, or the "miles remaining" indication on the cockpit panel?
Pay no attention to Miles Remaining. It's not based on any sort of reality. Switch to Percentage of the battery and don't look back.
Your battery is guaranteed to keep 80% of its capacity over 8 years. Any less than that, and you'll get a free new one. EVs haven't been around that long, but thus far most companies are finding batteries are doing better long-term than expected. There are a lot of folks holding on to older EVs for 10+ years and still doing well with their batteries. Not the same as new, obviously, but still going well within that 80%.
The biggest drop off for many seems to be in that first year, where you may lose a bit of capacity. Seems scary. But subsequent years you tend to lose less. At least that's been my experience thus far. And what I've seen from other friends who have had EVs for a while.