In this paper, we model the surplus process as a compound Poisson process perturbed by diffusion and allow the insurer to ask its customers for input to minimize the distance from some prescribed target path and the total discounted cost on a fixed interval. The problem is reduced to a version of a linear quadratic regulator under jump-diffusion processes. It is treated using three methods: dynamic programming, completion of square and the stochastic maximum principle. The analytic solutions to the optimal control and the corresponding optimal value function are obtained.