Actual combat - Talking about how to do a good job of design when the demand comes 2

Follow up on the needs of the previous issue

 

The original design mentioned by others is this:

For project information, design a master table, and then design several slave tables, a table of main parameters, a table of equipment resources, a table of human resources, a table of main material consumption, a table of efficiency construction period, etc.

Contract income: one main table; the same as the collection income table, word end type 1 type 2 type 3...80 fields; one other income table has 9 fields

Contract cost: one master table; one detailed information table, 200 fields are built according to the fields of the account. . . . . Forehead! Can't stop a bit, so? The brain hole is divided into tables, which are divided into 7 tables and sub-tables according to the categories.

     Depend on! There are only three functions, and more than 20 tables with about 400 fields have been created. Whoever goes to name the field, I have less culture and poorer English.

        We carefully analyze the requirements, and it is not difficult to find that the bidding project information is the same as the actual project information, then it is OK to show that it is public. I am wondering how to adjust these 100 fields? Why not convert him into a vertical column, how to convert it?

        The collection revenue of contract revenue, other revenue is the same as the actual project budget revenue, and the actual project actual revenue is the same, then the public is OK

Now, since there are so many fields of collected income, and the user does not confirm it, how to do it?

       There seem to be many types of project costs, but in fact, its real core lies in the subject tree, and the others are divided into regular tables by category.

Then I'll take the picture above, and then talk about each table. Welcome to Paizhuan, and the pictures can be downloaded.



 

Now let's talk about the core table: the account tree table, which stores project information and cost information by type. There is a field that is a formula. For example, labor fee = employee fee + contract labor + zero-hour labor, then the data can be calculated after filling in the parent node of the child node. Write a public method to avoid the need to calculate every query.

Project comprehensive information table, the structure of K_V storing the account tree and value

Collection income table: There are 40 columns of initial data by default. Every time you add new income, copy one copy and then modify it to ensure that each document has 40 entries.

Cost Schedule: The structure of K_V, plus a header field (collection period, severance period, relocation period, quantity, etc.). If the account tree has 200 rows, then a contract cost has 200 rows for the acquisition period and 200 for the severance period. . . Quantity 200, remarks 200, a total of about 1000 lines. The actual cost of the project is 200 domestic, 200 international, and 200 last year. I just need to write a method in the background, you pass in those headers, and I will combine all the data of these headers into a tree for you.

 

I won't say anything else. Typing is very tiring. There are things that I don't understand and optimization. Welcome to make progress together.

There are still some development problems later, such as how to improve performance, code coupling and cohesion, etc. . .

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326686560&siteId=291194637