A diphenylaminopyrimidine and triazine compound of Formula I, or a pharmaceutically acceptable salt, stereoisomer, hydrate or solvate thereof is disclosedIn formula I, A is C or N; X and Y are independently selected from hydrogen, halo, cyano, trifluoromethyl, alkoxy, alkyl, aryl, alkenyl, alkynyl and nitro; or X and Y, together with the atoms to which they are attached, form a phenyl or an heteroaromatic ring; R1 isR2 is CD3 or CD2CD3; R3 isR4 is hydrogen, methyl, trifluoromethyl, cyano or halo; R5 is hydrogen, alkyl, substituted and unsubstituted phenyl, allyl or propargyl; R6 and R7 are independently selected from hydrogen, alkyl, substituted and unsubstituted phenyl, allyl and propargyl; or R6 and R7, together with the nitrogen atom to which they are attached, form a substituted or unsubstituted heterocycloalkyl group. The compound has pharmacodynamic and pharmacokinetic properties and ALK kinase inhibitory activity.