Well, if something went wrong with the surgery it might. I'm not an expert on hernia surgery, but if there was a complication, it might cause an infection.
I mean, do the blood test for herpes, but make sure it's an IgG, not an IgM. At least rule it out, I guess. It won't tell you that it's causing your symptoms. Herpes doesn't cause cramping, though.
Ask the urologist for an ultrasound at least.