Punch-in Statistics System for “Xuexi Qiangguo”
The project is purely software
At present, the drilling of learning ability is realized in the form of website. Its original design purpose is to improve the accuracy of statistics and facilitate the students on duty to watch the clock in every day, thus producing the idea of making this system. It has been put into use
System architecture
The system architecture is expanded based on MVC development mode, including database data layer, model layer, Dao data persistence layer, service business logic layer and controller / servlet controller. The division of labor at each level is clear and the coupling degree of levels is reduced.
View layer
The system adopts B / S mode. Most display pages are JSP / HTML. In order to meet the display of page UI, ajax data exchange is in JSON format. This layer is closely combined with the control layer, and they need to work together.
Controller layer
The controller layer is responsible for the control of specific business module processes, which not only makes the program structure clear, but also greatly reduces the amount of code.
The control layer is mainly used to respond to client requests. Whenever a request is sent to the system, the control layer will call the corresponding business logic. There are many kinds of requests, such as ajax data request, page request, file upload and file download. The control layer will make corresponding data return, page Jump and stream return.
Data persistence layer
The Dao layer mainly does the work of the data persistence layer, and some tasks responsible for contacting the database are encapsulated here. The design of the Dao layer first designs the Dao interface, and then designs the implementation class.
Contact of each layer
The Dao layer can be developed independently with low mutual coupling, and can be carried out independently. Such a mode has particular advantages in the process of developing large projects. The controller and view layers need to be developed together because of their high coupling, but they can also be developed as a whole independent of the first two layers. In this way, we only need to know the definition of the interface between layers, and call the interface to complete the required logical unit application. Everything is very clear and simple.
The following figure shows the current website functional architecture
Gitee download address, click here directly,This code is still the code with bug before. Understanding the code and making corresponding modifications will make great progress.
The code here is developed using the following software:Development tool:MyEclipse10,Database:MySQL 5.1.32-community,Graphical interface database operation:navicat,Java environment:jdk1.8.0_131.
Later, I used eclipse to develop,When JDK6 is changed to a higher version in MyEclipse, some errors will occur in MyEclipse. There is no file class requested by image processing. Anyway, if two jdk version exist, it will causing some code bugs; Like not executing identification codes or something.
Bug in the orignal project
- The number of clocking days is increased to 100 when it reaches 99 days, and the data of 99 days is checked and modified all the time.
The process and Realization of clock in days
- In the point entry interface, fill in the scores, or upload pictures for identification. After there is content in the input box, click upload, and the clock in days will increase automatically.
- The personal design is realized by comparing the time. The registration time will be automatically recorded during registration, and then the clock in days will be calculated by comparing with the registration time.
Three cases:
- Clock in on the day of registration
- Didn't clock in on the day of registration
- Clock in after registration
- The details should be combined with the code
The reason for the bug is when designing the database,The data type is varchar(255), And then on day 99, The code always judges 99 as the maximum number of days. My personal idea to solve this bug is(Judge the latest clock in number, because the clock in number increases automatically and the data type is int).When I write here, I suddenly remember that the number of branch days seems to be of varchar type. I'll change this when I'm free.
When the project is uploaded to the server and run, the bugs are more interesting.
-
No problem with local database entry. But when the server uploads Chinese into the database, it is garbled.(Add useunicode = true & characterencoding = UTF-8 in db.properties to solve the problem)Problem solving link
-
The JDK of Tomcat 7 version is only 1.7. The algorithms of image processing cannot be used. As shown in the figure, an error will be reported
-
The tomacat 8 version is finally ready for JDK1.8, and the feelings entered in the result are all ?????(garbled),Check the data on the Internet and find that tomcat8 can directly help you deal with the problem of characters. It defaults to UTF-8. My method transcodes the tomcat7 version into iso-8859-1. In order not to cause great changes, I changed the code to ISO-8859-1。Problem solving link
4.The best bug is nothing more than this. I developed this project using the windows operating system. The storage directory path is shown as the forward slash“\”
However, the actual server is a Linux system. Let's take a look at the server without changing the code(See the figure below) img\学号\图片名 (Surprise, it has created a strange folder that can't be accessed yet). Next, let's look at the actual storage path of the server. As shown in the figure, the backslash "/" is used for storage.As a result, storage problems arise,The solution is to change the forward slash to the backslash
Places to be promoted
In the points interface, you can add number of days to punch to compare with the actual number of days to punch.In fact, I wrote this part of the code method myself, but there were a few small problems when I actually wrote it on the front end, and I don't have time to solve them yet.
This website can actually be converted into wechat applet to clock in,Capable students or students who want to have this ability can learn from the database structure and code written by my back-end and use them to achieve.
Genius can be ignored and developed directly on demand.
I implement image processing here by using the API provided by others. Low recognition rate is a problemThis is also the knowledge what I lack
You can add functions such as meeting sign in. Make the software more rich and humanized
Finally, I attached the supply and demand analysis of the small program I wanted to make at that time
The above is written on November 3, 2020. If there is any supplement, follow up