In this study, a novel system was set up by preparing a magnetic flocculant combining with ultraviolet/H2O2 to realize the rapid enrichment and degradation of diclofenac sodium (DCFS). For the magnetic flocculant, template anion polyacrylamide (TAPAM) with anion micro-block structure was prepared. Thereafter, polydopamine was used to modify TAPAM, Fe3O4 nanoparticles was grafted to the modified TAPAM by chelation, named template anion polyacrylamide-polydopamine-Fe3O4 (TAPAM-PDA-Fe3O4). Furthermore, the TAPAM-PDA-Fe3O4 preparation protocol was optimized by the response surface method (RSM). In the DCFS enrichment section, the rapid separation of flocs from water was realized by an external magnetic field and it indicated that the π–π stacking effect was dominant in neutral/alkaline condition, whereas charge neutralization was favored in acidic conditions. Meanwhile, a DCFS enrichment kinetic curve was much fitted by the pseudo-second-order kinetic model and DCFS enrichment isothermal curve was close to the Freundlich isothermal model, indicating the dependence of DCFS quantity enriched by TAPAM-PDA-Fe3O4 and a multilayer heterogeneous enrichment process. The degradation experiment confirmed that DCFS was effectively degraded by ultraviolet/H2O2/TAPAM-PDA-Fe3O4 and the maximum value of DCFS degradation efficiency reached 98.1%. Furthermore, the regeneration experiment showed that the enrichment and degradation efficiency of DCFS could maintain a relatively high level in the initial three recycles.