The problems of debt value and optimal capital structure of enterprises are the main issues in corporate finance research. Under the ESG rating mechanism, the article first utilizes the real option theory to study the optimal capital structure and investment and financing decision-making methods of enterprises. Then it puts forward model assumptions and combines the jump diffusion model for the construction of enterprise project investment and financing decision-making model and the dynamic planning adjustment of capital structure. Finally, through specific numerical experiments, the influence process of each variable in the model on the enterprise investment and financing decision is analyzed, and the agency problem is analyzed.Through the experiment, it can be obtained that when the residual value after stopping production, the risk-free interest rate, the variable production cost and the tax rate are set to γ = 1, r = 0.1, ξ = 0.1, θ = 0.2, respectively, with the increase of the frequency of the jump, the investment price of the positive-jump model gradually decreases, and the investment price of the negative-jump model gradually increases, which can be obtained that the reasonable simulation estimation of the relevant parameters has an important impact on the enterprise’s investment strategy, so the enterprise should make a more accurate assessment of the parameters, otherwise they will lose part of the benefits or lose good investment opportunities.