So $\{a,b,c,d,e,f,g\}=\{1,2,3,4,5,6,7\}$. Clearly the expression is greater than $3$ and hence must be odd and not divisible by $3$. But clearly one of the factors is even, so exactly one must be even and the other one odd. So the even factor contains all the three even numbers $2,4,6$ and hence is divisible by $3$ so it must contain all the multiples of $3$ hence also the factor $3$. So it must be $abcd$ and we find that $\{a,b,c,d\}=\{2,3,4,6\}$ and $\{e,f,g\}=\{1,5,7\}$ and $abcd+efg=144+35=179$ which is indeed a prime.