The invention discloses an aromatic or aliphatic heterocyclic condensed morphinan compound, a synthesis method thereof, and such applications thereof as opioid receptor agonist or anti-agonist in treating drug abuse and as novel painkiller. The general structural formula of the compound is shown in (I), wherein, R is H, straight chain or branch chain alkyl of C1 to C10, aromatic group or aliphatic heterocyclic or non-heterocyclic substituted alkyl; X is H, -OH, alkoxy, amido, substituted amido, carboxyl, ester group, aminoacyl; Y is H, -OH, alkoxyl, amido, substituted amido, etc., and Z is various substituted pentagon, hexagon or substituted pentagon, hexagon aromatic and aliphatic heterocycle.