"having to do with XX" means "concerning XX", "about XX", or "related to XX".
So "we make a deal with China having to do with other things" is like "we make a deal with China about other things'.
Grammatically, you can think of it this way.
1. "have to do with XX" means "(something) concerns XX" or "is related to XX".
ex) The problem of the house has to do with its foundation. (the problem is related to its foundation)
2. a verb can be converted to an adjective by adding -ing to it (-ing form is called a present participle)
ex) A car moves fast => There is a car [moving fast]. - "moving fast" describes "a car".
3. If we apply this '-ing' form to "have to do with ...", we get "having to do with ...".
A: We make a DEAL with China.
B: The DEAL has to do with other things.
C: (Combine A and B) We make a deal with China having to do with other things.