7. Given the sequence $\left\{a_{n}\right\}$ satisfies
$$
a_{1}=1, a_{n+1}=\frac{n a_{n}+2(n+1)^{2}}{n+2} \text {. }
$$

Then the general term formula of the sequence $\left\{a_{n}\right\}$ is $\qquad$
7. $\frac{1}{6} n(n+1)(n+2)$.

From the given, we have
$$
\begin{array}{l}
(n+2) a_{n+1}=n a_{n}+2(n+1)^{2} \\
\Rightarrow(n+1)(n+2) a_{n+1} \\
\quad=n(n+1) a_{n}+2(n+1)^{3} .
\end{array}
$$

Let $b_{n}=n(n+1) a_{n}$. Then
$$
b_{1}=2, b_{n+1}=b_{n}+2(n+1)^{3} \text {. }
$$

Thus, $b_{n}=b_{1}+\sum_{i=1}^{n-1}\left(b_{i+1}-b_{i}\right)$
$$
\begin{array}{l}
=2\left(1+2^{3}+3^{3}+\cdots+n^{3}\right) \\
=\frac{1}{2} n^{2}(n+1)^{2} .
\end{array}
$$

Therefore, the general term of the sequence $\left\{a_{n}\right\}$ is
$$
a_{n}=\frac{b_{n}}{n(n+1)}=\frac{1}{2} n(n+1) \text {. }
$$

Hence, the sum of the first $n$ terms is
$$
\begin{array}{l}
S_{n}=\frac{1}{2}\left(\sum_{k=1}^{n} k^{2}+\sum_{k=1}^{n} k\right) \\
=\frac{1}{2}\left[\frac{n(n+1)(2 n+1)}{6}+\frac{n(n+1)}{2}\right] \\
=\frac{1}{6} n(n+1)(n+2) .
\end{array}
$$