In this paper, we establish an SIVR model with diffusion, spatially heterogeneous, latent infection, and incomplete immunity in the Neumann boundary condition. Firstly, the threshold dynamic behavior of the model is proved by using the operator semigroup method, the well-posedness of the solution and the basic reproduction number $\Re _{0}$
ℜ
0
are given. When $\Re _{0}<1$
ℜ
0
<
1
, the disease-free equilibrium is globally asymptotically stable, the disease will be extinct; when $\Re _{0}>1$
ℜ
0
>
1
, the epidemic equilibrium is globally asymptotically stable, the disease will persist with probability one. Then, we introduce the patient’s treatment into the system as the control parameter, and the optimal control of the system is discussed by applying the Hamiltonian function and the adjoint equation. Finally, the theoretical results are verified by numerical simulation.