"We will have it by 2018 year" - does it mean before 2018 year or somewhere in this year?
Your example is not grammatical US English.
In US English, you could say, We shall have it by 2018 or We shall have it by the year 2018.
As you have already realized, the construction has a somewhat vague meaning. In fact, it is so vague that I do not remember it being used for periods as long as a year and do not remember it ever being used in a contract for a period even as short as a day.
If someone said to me It will be ready by Tuesday, I would not count on it being ready on Monday. So by Tuesday definitely does not mean before Tuesday. There is a vague implication, however, that it means not too late on Tuesday. That is, if I showed up at 4pm on Tuesday and it was not ready, I would feel aggrieved.
Because it is a vague locution, it must be clarified if exactness is important. The response to It will be ready on Tuesday may well be somerhing like Will it be ready by noon?