How to generate lot number?

I am creating a file upload form with user permissions. In screenshot, user1 logged in and can upload an excel file and select the template which is a select field.
There is a Department cmp with a single column of Department name. In this screenshot, we can see as HDFCC000-HDFC-Central-Team a department.

I want to generate a lot number every time a user submit the form and assign that lot number to the user… which will include the file and template column. (Relationships).
I dont know how to generate this Lot number.
It is in form the department-name/month/date/increment number

A Lot Number in back end will look like this -

Would it work to store the previous lot number in the user’s remote_data field (assuming that you’re not using it for anything), and get it, then increment it whenever a lot is uploaded? That field takes a string and is set to text, so it’s huge (roughly 65K).