@[toc]
1. Project Overview (download included)
Based on Gitee’s open source project Quella, this project has carried out secondary development of some functions.
Original project address: gitee.com/quella01/Qu…
Address of this project: gitee.com/ZXAcademy/C…
Project agreement: Apache-2.0
The last update to the original project was released in January 2019, so some of the dependencies are a bit dated.
However, this scaffolding integrates some general background functions, such as menu setting, permission control, etc., as well as the integration of commonly used third-party services, such as Qniu cloud storage, third-party payment, etc., its development mode is worth learning and reference.
In addition, the use of this scaffolding can quickly carry out the development of background management system, very suitable for agile development.
The following is the secondary development based on this framework and records the detailed development process.
The following sections are drawn from the original repository’s documentation and official development documentation.
2. Project demonstration
The following functions are the functions of the original system.
1. Background Login page:
The default password is admin
2. Background Home page:
Click the user name SSRS in the upper right corner, and click Settings to switch to the select card view, which is the following style with an X on each page.
3. Menu Settings:
4. Permission Setting:
5. Administrator Settings:
6. Role setting:
The following functions are secondary developments in the original framework.
7. Classroom information management
8. Device Information Management:
9. New devices:
10. Fuzzy query:
11. Chart statistics:
3. Rapid deployment
3.1 Architecture
- Front-end framework: Layui-based Kit-Admin
- Page template: Use FreeMaker and JSP dual view
- Back-end main framework: Spring + SpringMVC + MybatisPlus + Shiro + Redis
- Redis: distributed session and distributed cache
- Quartz: Task scheduling scheme
- ElasticSearch: Full text search and data analysis solution
3.2 Environment Description
- JDK 1.8
- Tomcat 7.0 or above
- MySQL 5.7
- Redis 3.0 and above
- ElasticSearch 6.4.2 (Not required)
- Development tool IDEA (requires Lombok plug-in installation)
The above environment, in addition to JDK, Tomcat, MySQL is required, Redis is also required, otherwise cannot log in the system.
ElasticSearch is not required.
For Windows, one-click Redis is recommended.
Address: github.com/MicrosoftAr…
Download mSI 3.2 or 3.0 for one-click installation.
Recommended Redis database visualization tool: gitee.com/qishibo/Ano…
3.3 Detailed process of project construction
1. Clone the project to the local;
2. Import the project with IDEA;
3. Select the Maven project type;
4. Check Maven Automatic Import;
5. Select the Maven project to be imported;
6. Select the JDK version.
7. Set the project name;
8. Complete structure of the imported project;
9. Right-click the Resources folder and set it to the resource Root directory (right click →Make Dictionary as→Resources Root).
10, right-click the Test folder and set it as the Test source Root directory (right click →Make Dictionary as→Test Sources Root);
11. Configure Tomcat.
12. Import SQL script files to your own database;
13. Configure database information;
14. Configure Redis information (generally no modification is required);
15, start the Redis service (generally, after the installation is complete, automatically start);
16. Run the project;
17. The login page is displayed.
4. Get started
How can you quickly develop the tables you need to manage?
Here are some answers to your questions.
4.1 Some Suggestions
The new table:
The default system table prefix is SSRS. To distinguish the new table from the system table, you are advised to use other prefixes, such as table in the example.
Background development:
The system default background project files, such as controller and Model, are in the com. SSRS package.
In order to be different from the system files, create a new package named dev in the com.ssrs directory. You are advised to write the new files such as model, service and controller here, as shown in the figure below:
Front-end development:
Under the WebApp folder, there are some static resources, such as CSS, JS, etc., which are public.
Under the webapp/WEB-INF/ FTL directory, there are some system default pages.
In order to distinguish the default page from the system, create a new folder called devPages in this directory. You are advised to write the new page in this folder, as shown in the figure below:
4.2 Adding Menus
After starting the project, you can enter the background of the project.
In the background page of the project, visit System Settings >> Menu Settings and click Add to add a menu to the left menu bar of the system, as shown in the picture below:
Note here that there are two types of new menus: top-level menus and secondary menus.
If a new top-level menu is added, it will not be displayed on the left without adding a secondary menu.
Example of filling in a top-level menu:
Example of filling in the secondary menu:
Link title, sort, permission name, can be arbitrary filling.
The address of the link must correspond to the RequestMapping in the Controller. Otherwise, the response and page loading cannot be implemented.
4.3 Setting Permissions
Every request (that is, every link) in the system can be set to its permission.
In general, you need to set permissions for adding, deleting, modifying, and querying a form, and assign different permissions to each role based on actual requirements.
In the background page of the project, visit System Settings >> Permission Settings and click “Add” to add permissions for links in the system:
It is important to note that the permission Action is filled in the same way as the Action of adding the secondary menu above.
These permissions can then be assigned to each role, as shown below:
Click the input box (not *) of the permission obtained in the above image to expand the permission tree and check “Submit”.
4.4 Generate code using reverse engineering
When a new form is added to our database, the files such as Model, Service, mapper and controller for this form do not need to be created manually. Instead, we can directly use the code provided by the project to generate samples with one key.
First use and modify the information, as shown in the figure below:
Then right click and run to generate the individual files.
The six files generated by the sample code above are shown below:
Finally, and most importantly, comment out the part of the XML file that turns on level 2 caching! , as shown below:
4.5 Adding front-end Pages
In the devPages directory, you can add your own pages, such as add page, update page, and so on. Note that the suffix of the added page should be FTL format.
So far, some of the general use of this framework and matters needing attention, the basic introduction is finished.