JAVA development practice and implementation of parking lot management system based on Springboot framework [with source code]

Operating environment: jdk1.8+idea/eclipse+maven3+mysql5.6 

Project technology: Java, Springboot, mybatis, mysql, jquery, html

The system provides the management personnel of the parking lot with the management of vehicles, parking spaces and finances in the parking lot. Operators can flexibly use the relevant permissions to carry out their work. In the management of parking spaces, the parking and driving away of vehicles, payment, parking lot revenue collection and other work are all handed over to the system to achieve efficient management, which can reduce the workload and allow them to participate in other work. Going, it may also save a sum of manpower expenses.


Development system: Windows
JDK version: Java JDK1.8 (recommended)
Development tool: IDEA
Database version: mysql8.0 (recommended)
Database visualization tool: navicat
Server: SpringBoot comes with apache tomcat
Main technologies: Java, Springboot, mybatis, mysql,
Main function realization of jquery, html :
homepage data display ,
order list,
parking lot management
, monthly card list,
user management

 

 

Abstract With
the rapid development of society, we can find that there are more and more cars in the city, and the traffic pressure in the city is also increasing. The centralized management of vehicles in the city is put forward by people to require the order of vehicle entry and exit, the safety of vehicle storage, and the compensation of vehicle storage management. From this, the parking lot management system product came into being, and the system plays a very important role in the modern parking lot management. Intelligent parking management system is usually called parking lot management system or smart parking lot, and is also called "parking lot" by most people in the industry. The parking lot management system uses modern mechanical electronics and communication science and technology, and also integrates control hardware and software. With the rapid development of science and technology, the parking lot management system is also developing at a high speed.
The parking management system is intended to solve the problems of urban parking management, operator revenue, and car owners' parking difficulties, and at the same time create a city-level static traffic management platform for urban traffic managers. Including parking lot, shared parking, three-dimensional garage and on-street parking and other parking scenarios.
The system is developed using Spring Boot technology, and the software hierarchy division model is designed. A database structure model that satisfies the high concurrency requirements during the running of the application program is designed in detail, and the corresponding data dictionary is obtained from it and the database table structure model is created at the same time. The application program function classes and methods for the realization of various functions of the parking management system are designed in detail, and the system program development and interface design are completed.


Background
This parking management system is designed to change the current parking management that uses traditional manual recording methods, so as to optimize efficiency. On this basis, try to save manpower and material resources to the greatest extent. Based on our survey of parking lot managers, I found that the biggest problem with the current parking management system is that the system is too complex. According to the situation I have investigated and the current actual information, this project focuses on building a system with high efficiency and convenient operation as the core elements.
The system provides the management personnel of the parking lot with the management of vehicles, parking spaces and finances in the parking lot. Operators can flexibly use the relevant permissions to carry out their work. In the management of parking spaces, the parking and driving away of vehicles, payment, parking lot revenue collection and other work are all handed over to the system to achieve efficient management, which can reduce the workload and allow them to participate in other work. Going, it may also save a sum of manpower expenses. This is the significance of developing this system.

 

 

Demand analysis
In the management of a parking lot system, the main function is to realize the process of digitally upgrading traditional industries. Next, a detailed analysis of the original parking lot management is required. The original parking lot includes the parking lot site, cashiers, fees Specifications, whether you are an old user (member), daily billing information. After analyzing the traditional industry information, the prototype of the digitized parking lot management system can be obtained.

 

Requirements Description
Parking lot module requirements

This part needs to complete the addition, deletion, modification and query of the parking lot, including the addition of the parking lot contact person, the contact person’s mobile phone number, the parking lot address, the name of the parking lot, the charging standard of the parking lot, and the status of the parking lot.

 

Requirements for the monthly card module
This part needs to complete the addition, deletion, modification and query of the monthly card, including the parking lot to which the monthly card belongs, the creation time, the remaining days, the number of days of the monthly card, etc.

Order Module Requirements

This part needs to complete the additional search of the order, including the parking lot to which the order belongs, creation time, toll collector, toll amount, toll time and other information.

 

Overall Design
System Architecture
A good development architecture plays a vital role in system realization. The choice of architecture is mainly determined by the access mode. At present, the commonly used architectural models are B/S and C/S. The advantages and disadvantages of the two architectural models will be introduced in detail in this chapter. At the same time, in order to realize the separation of functions of each module in the system, the design pattern adopted by this system is MVC, which can realize the characteristics of "high cohesion and low coupling" of the system.


B/S mode
B/S structure, which is the abbreviation of Browser/Server, with the increasing update of network technology, C/S structure has gradually exposed a series of problems in practice, which can no longer effectively meet the demand. , although a certain proportion of transaction logic will also be displayed on the client side, but the transaction logic processing of the C/S mode is displayed on the client side. Compared with the two, this mode can greatly reduce the burden on the client side, and finally can Meet the needs of thin clients [8. It can be accessed only through Browser, and the introduction of B/S mode further improves the convenience of development work.



As one of the important contents of the development, the MVC pattern is to use a certain method to effectively build each component, software, etc. in the development of the system structure . Thousands of components are organically combined to play a better role. When developing, the low coupling of each functional module is an important factor. MVC is one of the most widely used design patterns in program design. The main feature of this pattern is that it can realize the separation of business layer and data layer, front-end user view and The separation of the middle controller and the realization of the back-end database have greatly improved the degree of aggregation among the functional modules, so the design pattern adopted by this system is the MVC design pattern. If one of the levels is changed, in this case, there will be no obvious negative effects on the other levels. The change of each layer will not cause obvious interference to the remaining two layers, showing good flexibility. On the one hand, this structure can improve the reusability of the program, and on the other hand, it can further improve the development efficiency of the designer. MVC also includes 3 layers, the three are Model (Model)-View (View)-Controller (Controller), which is a very representative framework and aims to realize the functional division of the Web.
Detailed Design
Frontend

 

 

 

The front end uses Ajax technology to interact with the back end. Ajax is a new term proposed by Jesse James Garrett in 2005 to describe a 'new' method using a collection of existing technologies. Including: HTML or XHTML, CSS, JavaScript, DOM, XML, XSLT, and most importantly XMLHttpRequest Using Ajax technology web applications can quickly present incremental updates on the user interface without the need to reload (refresh) the entire page, This allows the program to respond more quickly to user actions.

 

/**
     * ajax请求封装
     * @param url 请求的接口地址
     * @param params 传递给后端的数据
     * @param ft 响应成功后的回调函数 callback
     * @param method 请求的方式 GET/POST/PUT/DELETE/..
     * @param headers 请求头
     * @param async 是否异步请求 async的默认方式是true,即异步方式;async设置为false时,为同步方式
     * @param contentType 默认为: application/json; charset=UTF-8
     */
    coreUtil.sendAjax = function (url, params, ft, method, headers, async, contentType) {
        var roleSaveLoading = top.layer.msg('数据提交中,请稍候', {icon: 16, time: false, shade: 0.8});
        layui.jquery.ajax({
            url: url,
            cache: false,
            async: async === undefined ? true : async,
            data: params,
            type: method === undefined ? "POST" : method,
            contentType: contentType === undefined ? 'application/json; charset=UTF-8' : contentType,
            dataType: "json",
            beforeSend: function (request) {
                if (headers) {
                    // headers=true需要header携带token;
                    request.setRequestHeader("Authorization", coreUtil.getLocalData("token"));
                }
            },
            success: function (res) {
                console.info("success")
                top.layer.close(roleSaveLoading);
                if (typeof ft == "function") {
                    console.info(res)
                    switch (res.code) {
                        case 0: // 成功响应
                            if (ft != null && ft !== undefined) {
                                ft(res);
                            }
                            break;
                        case 1002: //token失效
                            layer.msg(res.msg, {icon: 3})
                            setTimeout(function () {
                                window.location.href = "page/login.html"
                            }, 1000)
                            break;
                        case 1001: //token为空
                            layer.msg(res.msg, {icon: 3})
                            setTimeout(function () {
                                window.location.href = "page/login.html"
                            }, 1000)
                            break;
                        default:
                            layer.msg(res.msg, {icon: 2})
                            break;
                    }
                }
            }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                console.info("error")
                top.layer.close(roleSaveLoading);
                if (XMLHttpRequest.status === 404) {
                    // 跳转错误页面
                    top.window.location.href = "/page/error/404.html";
                } else {
                    console.info(XMLHttpRequest)
                    layer.msg("服务器好像除了点问题!请稍后试试");
                }
            }
        });
    };


rear end

The backend uses spring boot to design the API interface. Spring Boot is a new framework provided by the Pivotal team. It is designed to simplify the initial construction and development process of new Spring applications. The framework uses a specific approach to configuration, so that developers no longer need to define boilerplate configuration. In my words, Spring Boot is actually not a new framework. It configures many frameworks by default, just like Maven integrates all Jar packages, and Spring Boot integrates all frameworks.

 

Use swagger interface document Swagger is a RESTFUL interface document online automatic generation + functional testing function software. This article briefly introduces the method of integrating swagger in the project and some common problems. swagger is a standardized and complete framework for generating, describing, invoking and visualizing RESTful style web services. The overall goal is to have the client and the filesystem update at the same rate as the server. Documenting methods, parameters and models is tightly integrated into the server-side code, allowing the API to always stay in sync. Swagger makes deployment management and using powerful APIs easier than ever.

 

 

Summarize

Through this practice, from requirement analysis to overall design, detailed design, database design, understand and learn the whole process of software development, and have a more comprehensive understanding of software engineering, especially the management of software development, such as waterfall model, agile Models, using different software development models allows express iterations of our projects and minimizes the cost of modifications. In the development of this project, I learned the use of layui spring boot technology, especially the solution to cross-domain problems generated after the separation of the front and back ends, the original same-origin policy, and so on.

 

[with source code] private letter blogger (parking lot management system)

Guess you like

Origin blog.csdn.net/qq_27741787/article/details/130426620