Thanks for your query.Based on the facts that you have posted it appears that you have acquired fungal infection of foreskin and glans penis called as Mucocutaneous candidiasis
..However this can be confirmed only on clinical examination .
Please consult qualified urologist
to confirm the diagnosis.
This is very common in a person having Diabetes . Please get your blood sugar levels done to rule out Diabetes
Take some anti fungal medication
like Fluconazole along with topical anti fungal gel for local application twice daily.
Observe good personal hygiene by cleaning the foreskin and glans with warm water twice daily.