Thanks for your query.Based on the facts that you have posted it appears that you have you have infection of Foreskin and Glans Penis
Please check your blood sugar levels to rule out Diabetes
as this is one of the presenting symptom os Diabetes.
In the mean while take some antibiotics like Doxycycline twice daily for 5 days.You can use local soothing gel for mouth ulcers. It should get cured.