From the tip of a needle to the smoothness of the buckle, record those BT needs

Foreword:

        Recently, I was a bit uncomfortable with a "simple" request. The demand is actually very simple, which is to record the production process data of a certain finished product and then display it, but the demand department is the management department. In order to obtain enough parameters to improve production efficiency and research and development progress. Therefore, production is required to statistically collect parameters corresponding to the production process, such as collecting a certain reaction order number, when the reactor started, and parameters corresponding to the reaction at the beginning, such as temperature, PH, current, stirring frequency, ammonia concentration, There are no less than 40 test items such as particle size, etc., so it is conceivable that this collection list is smelly and long. So the final product will probably look like this.

 It can be seen from the picture that there are many, many parameters that are not shown later.

1. Point of needle against wheat awn

        1. The discussion at the meeting was as fierce as a tiger, and the only thing left was whether it could be done

        From the picture above, we can imagine that when the management department promotes production to make input applications, the production director will definitely complain that there is too much input content, whether the data can be brought out automatically, whether it can be fool-proof, etc. Therefore, in the first trial operation meeting, there was a scene of tit-for-tat versus wheat-mang. After a final confrontation, we came to our side with demands that could not be changed in three years. Hahahaha, it’s really a fight between the snipe and the clam, and IT “profits”.

       The final main demand points raised are:

        1. Can the date be brought out automatically, can the time be automatically accumulated and changed, and can the response time be automatically changed?

        2. Can you just pull the data and change it like EXCEL?

        3. Can the date automatically change according to the time I enter? Some values ​​are fixed, can they be filled in automatically?

        4. Can the data be imported through EXCEL at one time?

        5. Can data entry verification be done? For example, characters cannot be recorded where data is recorded?

        6. Can you set required fields so that the important information is more complete?

        7. Can the input content be stipulated? For example, only "yes" or "no" can be entered, and other items cannot be entered, such as adding a space?

        8. Can...?

      2. Can it? cannot? That must be possible

        2.1. Inner emo

        Hahaha, can the above meal really make me numb? I was completely emo. From the passionate analysis at the beginning, to the later ones, I tried to think of ways, but in the end I didn't even bother to speak. Then when they saw that I didn’t answer, the friend next to me directly said something and wrote it down, and we went back to study it. I really want to thank you from my heart.

        In fact, the source of all this evil is that digital construction requires a long process. However, during the construction period, the business department needs to carry out business and also wants to improve efficiency. Therefore, it wants to enter the data manually first, solidify the business first, and put the standard rules into practice. In practice, at least the data is online and shared. There will no longer be N versions of data, and there is no need to push data across departments. Overall it's good. Therefore, for IT personnel, it can indeed reflect our value. In addition, IT personnel are all enthusiastic, so it is possible, it is amazing! Hahahaha, let’s see how it is implemented.

        2.2. A little idea

        Because there are so many requirements, here are a few typical implementation ideas.

        Because the entry personnel in different processes were unwilling to enter in one large table, we split the first large table into three small tables, as shown in the figure below, small test, pilot test, and quantitative test.

         If we split the quiz into this, by default we will bring out the response level as quiz, and by default bring out the date of the day. By default, deletion operations, etc. cannot be performed when data is not entered.

         In order to ensure data quality, set required prompts and color-mark required items to remind users which items are required, etc.

 2. Something a bit AI

        In fact, due to the recent influence of AI, the following 40 or 50-year-old men watch short videos every day, asking whether this can be automatically brought out, whether that can be automatically calculated, and whether it can automatically check for duplication. . . Wait, the main thing is an automatic, the main thing is a hands-free. Regarding the aforementioned "Can the date be brought out automatically, can the time be automatically accumulated and changed, and can the response time be automatically changed?", let's talk about this somewhat AI thing.

        1. AI evolution theory

        First, look at the date that is automatically brought out. There is a BT point, that is, when the user enters data, the current day's date is automatically brought out, and the next day's date is brought out after 12 o'clock. This requirement is relatively simple to implement, and the default is When empty, assign the value to the today() function to obtain the system date. But there is a BT point that when the user enters the data at 23 o'clock on a certain date and then clicks Add, it needs to change to the next day's date and time. Because the time needs to be set in 24-hour format. And the date needs to be rounded up by 1 day. How do you think this need should be achieved?

Let’s look at the effect first

  renderings

As shown in the figure above, when we select the time as 00:57 and click the insert line, it automatically changes to 01:57, and the response time automatically accumulates.

Of course, the shifts are automatically determined based on the time. 0:00 to 8:30 is the morning shift, 8:30 to 17:00 is the mid-day shift, and the rest are the evening shift. Of course, these are relatively simple. The complicated thing is that when the time automatically jumps beyond 23 o'clock, it automatically returns to 0 and the date is added by 1 day. Therefore, we select the time by intercepting: the hour on the left, or the corresponding hour. When clicking to insert a row, the hour is automatically added by 1, and then when the time is judged to be less than 10 hours, if it is less than 10 hours, a 0 is filled in front to become 01 02 03. . 09. Then splice it with the following minutes. This basically realizes the automatic jump of hour plus 1. Finally, mod(hour,24) is used to automatically change the hour from 0 to 23. In fact, the date change at this time becomes simple. As long as the hour in the previous line changes to 23, the date will be automatically +1.

        We can watch the video for specific dynamic effects.

20230816_225117

        2. Evolution 2.0

        Careful friends may find that when inserting a row, the value of the next row is automatically filled in based on the value of the previous row. Therefore, if we click on something other than the last row, the filled data will be incorrect, so the user starts to emo. .

         Therefore, users need a function that can automatically fill in multiple rows without worrying about filling errors. To be honest, this is the first time I have encountered such a need for BT, so I studied hard and came up with a data positioning function to allow function buttons The last row can be located every time. Clicking insert at this time will not cause data insertion errors. Just click without thinking. Of course, if there is an insertion, it will inevitably lead to more insertions because the insertion point is relatively high, so it is also necessary. A brainless deletion function, you only need to click delete to delete the last line. Therefore, the data location is finally determined through JS, and this requirement is achieved by inserting and deleting data from the last row each time. The final functional interface looks like this.

Position the inserted row position, automatically position each time, delete/insert the last row

3. Do you think this is the end?

        After many iterations, the above requirements were finally completed, but I never expected that an emo requirement would arise. Because there are two tables above and below, the data exists in two tables. In order to prevent the data from being accidentally deleted, the data They are not actually deleted, but a deletion mark is used to record whether they have been deleted. For example, when the deletion mark dr=0, it means that it has not been deleted, and dr=1 means that it has been deleted. Because they did not consider that they would modify or re-enter the deleted data, a scenario finally appeared. There was no data in the main table, but there was data in the detailed table. We called it the headless warrior. I really laughed out loud. This also added a little comfort to my endless needs. Hahaha, what a happy day~

 

Guess you like

Origin blog.csdn.net/qq_29061315/article/details/132304101