I believe that there are barn designs that capture urine.
...this had led to a number of accidents, the latest I recall was where the floor collapsed and dozens of cows ended up in the cesspit below. Others involve people falling in and dying from the fumes.