(with source code) springboot design and implementation of java-based property management system of Kangtai Community Computer Completion 101926

Springboot Kangtai Residential Property Management System

Summary

With the advent of the Internet trend, all walks of life are considering using the Internet to promote themselves. The best way is to establish their own Internet system and maintain and manage it. In actual application, the working rules and development steps of the application software are used to build the property management system of Kangtai Community by using Java technology.

This design mainly realizes the property management system of Kangtai Community, which integrates the advantages of humanization, high efficiency and convenience, and completes the functional modules such as owner management, house management, announcement management, property payment management, repair report management, parking space management, and parking fee management. The system communicates with the server through the browser to realize data interaction and change. Just use a computer and move your fingers to operate the system and realize data communication management. The design process of the whole system has fully considered the security, stability and reliability of data, and the operation process is simple. The system improves work efficiency and reduces errors and omissions in data storage through scientific management methods and convenient services.

The property management system of Kangtai Community uses Java language, developed based on Springboot framework and Java technology, and written with MyEclipse 2017 CI 10 compiler. In terms of data, it mainly uses Microsoft's MySQL relational database as the data storage medium, and cooperates with the front desk HTML+ CSS technology completes the development of the system.

Keywords: data communication; Java language; relational database; data storage

Springboot Kangtai community property management system

Abstract

With the advent of the Internet trend, all walks of life are considering using the Internet to promote themselves. The best way is to establish their own Internet system and maintain and manage it. In practical application, according to the working rules and development steps of the application software, Java technology is used to build the property management system of Kangtai community.

This design mainly realizes the Kangtai community property management system integrating the advantages of humanization, high efficiency and convenience, and completes the functional modules of owner management, housing management, announcement management, property payment management, repair application management, parking space management, parking space charge management and so on. The system communicates with the server through the browser to realize the interaction and change of data. You can operate the system and realize data communication management by moving your fingers through a computer. The safety, stability and reliability of data are fully considered in the design process of the whole system, and the operation process is simple. Through scientific management and convenient service, the system improves work efficiency and reduces errors and omissions in data storage.

The property management system of Kangtai community uses Java language, is developed based on springboot framework and Java technology, and is written with MyEclipse 2017 CI 10 compiler. In terms of data, Microsoft's MySQL relational database is mainly used as the data storage medium, and the system development is completed with the foreground HTML + CSS technology

Key words:Data communication; The Java language. Relational database; Data is stored

Table of contents

Chapter 1 Introduction

1.1  Research Background

1.2  Development Status

1.3  Organizational structure of this article

Chapter 2 Introduction to Related Technologies

2.1 J2EE technology

2.2 MVVM pattern

2.3 B/S structure

2.4 Spring boot framework

2.5 Mysql database

2. 6 B/S system working principle 

Chapter 3 System Analysis

3.1  Feasibility analysis

3.1.1  Technical Feasibility Analysis

3.1.2  Economic Feasibility Analysis

3.1.3  Operation Feasibility Analysis

3.2  Analysis of Functional Requirements

3.3  Analysis of non-functional requirements

3.4  Data flow analysis

Chapter 4 System Design

4.1  System architecture design

4.2  System function structure

4.3  Functional module design

4.4  Database design

4.4.1  Conceptual Model

4.4.2  Relational Model

4.4.3  Data Sheet

Chapter 5 System Implementation

5.1  Implementation of login module

5.2  Realization of user subsystem module

5.3  Implementation of the administrator subsystem module

Chapter 6 System Testing

6.1  Test purpose

6.2  Testing process

6.3  Test results

Chapter 7 Summary and Outlook

references

thank you

  1. introduction
    1. Research Background

The fierce competition in information management has led the world into the stage of information society.

The popularization of computers to individuals is the inevitable result of the rapid development of information technology. The development of client, server technology, database technology, and especially Internet technology has catalyzed the possibility of a computer management system for residential property management. More and more communities have begun to use and rely on community property management software to varying degrees, which can greatly improve the efficiency of community property management while obtaining scientific and regular management.

For smaller property management companies, the traditional artificial community property management model can still meet daily work needs. However, with the continuous development of the industry and increasingly fierce competition, improving the working level and efficiency of property management and providing better services for owners has become a problem that property management companies must consider at present. It will be a good solution to introduce computers into the management mechanism. Therefore, it is meaningful to develop a community property management information system that conforms to the characteristics of modern community property management.

    1. development status

First of all, from a domestic point of view, it is a relatively new industry in this area, and the development of this system is also relatively cautious. The existing residential property management systems are basically divided into two situations: (1) Standard configuration type. Most of the Kangtai community property management systems are stand-alone or C/S structures, and their functions are of a large and comprehensive type. Basically, the property-related content of common communities is included in the software modules. (2) Special customized type. This kind of property management system of Kangtai Community is mostly B/S or C/S structure. The software development company conducts targeted development of functional modules according to the specific needs of the community, and reserves corresponding expansion data interfaces. However, the penetration rate of these two systems in China is not very high, which may be related to many reasons, and will not be analyzed here. But in the long run, with the popularization of the Internet and the improvement of people's quality, this system will eventually settle in every community and become an indispensable part of people's life.

From the perspective of the existing development situation in foreign countries, in developed countries, because there are relatively few large-scale residential areas, this system is often used in smart office buildings, and its content is also different from this system. The management system in smart office buildings It is relatively complicated, with functions such as security monitoring. In some moderately developed countries with better construction of intelligent communities, there is still a certain demand for community property management systems. Generally speaking, there is not much software development and utilization of this kind of community property management system in foreign countries. It can be said that this kind of community property management system is a system that is more in line with our national conditions.

This system is a convenient system. With the continuous improvement of people's living standards, it will completely enter our lives in the near future and change our lives along with the Internet.

    1. Organization of this article

The first chapter is the introduction, the beginning of this article, some textual descriptions of the research background and research significance of this topic.

The second chapter studies the development technology and tools used in the property management system of Kangtai Community.

The third chapter is the system analysis part, including the description of the overall requirements of the system, the analysis of system requirements from a functional point of view, and the non-functional analysis of whether the system can be realized.

The fourth chapter is the system design part, an important part of this article, which provides the detailed design of the system architecture and the design description of some main functional modules.

The fifth chapter is the specific realization of the system, introducing the specific realization of each module of the system.

The sixth chapter tests and runs the system on the basis of the previous chapters.

Finally, the system is seriously summarized, so as to have a new prospect for the future.

  1. Related technology introduction
    1. J2EE technology

People can master many foreign languages, but what a computer scientist is proficient in is mostly programming languages, which are not human natural languages, such as C language, Java, Perl and so on. Since the "middleware" developed by different companies is not standardized enough, Sun launched J2EE and used this standard to solve the ills. It provides a good mechanism, allowing each layer to allow the corresponding server and components to run, making the system stable and usable, efficient in development, and easy to maintain.

    1. MVVM pattern

The MVVM model is a commonly used development model, which is mainly divided into M layer, V layer and C layer in terms of code implementation.

View (View) represents the user interaction interface. A web application may have many interfaces. In the MVVM mode, the view only deals with data collection, processing, and user requests, and does not include the processing of business processes and business processes. Handled by the Model.

Model (Model) is the processing of business processes/states and the formulation of business rules. The process of the model processing the business process cannot be seen by other layers. It is like a black box. After receiving the data requested by the view, it returns the final processing result. The main core of MVVM is the design of the business model. A typical application example is the popular EJB model. It further divides the model from the perspective of application technology implementation in order to make full use of existing components, but it cannot be used as a A framework for applying design models.

The controller (Controller) can be understood as receiving the user's request, and then the view and the model are matched together to complete the user's request together. It has a very obvious role in dividing the control layer, and can clearly tell you that it is a distributor, which model and view to choose, and what kind of request from the user can be completed. The control layer does not do all the data processing, for example: the user clicks a connection, after the control layer receives the request, it does not process the business information, it just transmits the user's information to the model, and tells the model what to do, and then chooses the one that meets the requirements The view is returned to the user.

    1. B/S structure

B/S (Browser/Server) is a more convenient architecture than its predecessor architecture. It uses the Web server to complete the data transfer and exchange. You only need to download the browser as the client, then the work will achieve a "slimming" effect, and there is no need to consider the problem of non-stop installation of software.

    1. Spring boot framework

The Spring framework is an open source application framework on the Java platform that provides a container with inversion of control features. Although the Spring framework itself has no restrictions on the programming model, its frequent use in Java applications made it so popular that it was later used as a supplement or even a substitute for the EJB (EnterpriseJavaBeans) model. The Spring framework provides a series of solutions for development, such as using the core features of inversion of control, and implementing inversion of control through dependency injection to realize the containerization of the management object life cycle, using aspect-oriented programming for declarative transaction management, and integrating A variety of persistence technologies manage data access, provide a large number of excellent web frameworks to facilitate development, and so on. The Spring framework has the feature of inversion of control (IOC). IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through the Java reflection mechanism. The Spring framework uses the container to manage the life cycle of objects. The container can configure objects by scanning XML files or specific Java annotations on classes. Developers can obtain objects through dependency lookup or dependency injection. Aspect Oriented Programming(AOP) framework, the Spring AOP framework is based on the proxy mode, and can be configured at runtime; the AOP framework is mainly modularized for the cross concerns between modules. The AOP framework of the Spring framework only provides basic AOP features. Although it cannot be compared with the AspectJ framework, it can also meet the basic needs through integration with AspectJ. Functions such as transaction management and remote access under the Spring framework can be realized by using Spring AOP technology. Spring's transaction management framework brings an abstraction mechanism to the Java platform that enables local and global transactions, as well as nested transactions, to work with savepoints and in almost any environment on the Java platform. Spring integrates multiple transaction templates. The system can configure transactions through transaction templates, XML or Java annotations, and the transaction framework integrates functions such as messaging and caching. Spring's data access framework addresses common difficulties developers encounter when using databases in their applications. It not only provides support for all popular data access frameworks such as Java: JDBC, iBATS/MyBATIs, Hibernate, Java Data Objects (JDO), ApacheOJB and Apache Cayne, but also can be used with Spring's transaction management to provide data access Flexible abstraction. The Spring framework initially did not intend to build its own Web MVC framework . During the development process, its developers believed that the separation between the presentation layer and the request processing layer of the existing Struts Web framework and between the request processing layer and the model was not enough, so they created Spring MVC.

    1. Mysql database

Mysql has been updated many times, and the functional level has been very rich and perfect. From Mysql4 version to 5 version, a relatively large update has been made, and it has achieved good practical application results in actual commercial use. The latest version of Mysql supports the compression of information, and at the same time, it can also perform encryption to better meet the needs of information security. At the same time, after multiple updates of the system, the mirroring function of the database itself has also been greatly enhanced, the smoothness of operation and ease of use have been greatly improved, and the use and creation of drivers are also more efficient and faster. The biggest change is the optimization of the display of spatial information, which makes it easier to label and calculate coordinates on the application map. The powerful backup function also ensures that users will feel more at ease during the use process, and the supported Office features also support users' self-installation and use. The display form of information has also been greatly updated, and two very useful display areas have been added, one is the information area, which has classified tables and text, and the display of the interface is more refreshing and specific. The second is the information control of the instrument, which can display information in the instrument information area and compare multiple information at the same time, which brings great convenience to the actual use of users.

In the actual implementation process of the Kangtai Kangtai community property management system designed in this article, the main reason for finally choosing the Mysql database is that there will be a large number of databases that are frequently operated during the application and development of the enterprise application system, and the data Security requirements are also very high. Combining these factors, Mysql, which has a relatively high safety factor, is finally selected to store the background data of the property management system of Kangtai Kangtai Community.

    1. Working principle of B/S system

The B/S architecture adopts the working mode of browser request and server response.

Users can access information such as text, data, pictures, animation, video on demand and sound generated by the web server on the Internet through a browser;

And each web server can be connected with the database server in various ways, and a large amount of data is actually stored in the database server;

Download the program from the Web server to execute locally. If an instruction related to the database is encountered during the download process, the Web server will hand it over to the database server for interpretation and execution, and return it to the Web server, and the Web server will return it to the user. In this structure, many networks are connected together to form a huge network, that is, the global network. Each enterprise can build its own Internet on the basis of this structure.

In the B/S mode, the user requests access to many servers distributed on the network through the browser. The browser's request is processed by the server, and the processing result and corresponding information are returned to the browser. Other data Processing and requests are all completed by the Web Server. Through the frame structure and the browser embedded in the operating system, this structure has become the mainstream structure mode of today's software applications.

  1. system analysis
    1. Feasibility Analysis

This design is based on the B/S mode, using Java and JSP technologies using MySQL database and Myeclipse. The overall feasibility is divided into the following three aspects.

      1. Technical Feasibility Analysis

The so-called technical feasibility refers to whether the functions planned in the early stage can be satisfied within a limited time. Whether there will be problems that cannot be solved in the development and design. Whether the completed project can be well applied, if there are shortcomings, whether there is great difficulty in later maintenance. After evaluating the system, it was determined that existing technology could achieve the goals. Using JSP technology to realize dynamic pages, embedding low-dependency design patterns, flexible databases, and stable servers, the operating efficiency of the entire system is greatly improved. It can be seen that achieving the goal at the technical level is not a nonsense.

      1. Economic Feasibility Analysis

Most of the tools used in the project are currently popular open source and free, so in the early stage of development, the funds used for the project will be greatly reduced, and the development of the software will not be affected by the funds during the project start-up period, so It is still economically feasible. Try to use the least cost to meet the needs of users. Save funds for labor costs and equipment costs. It will go further and further on the road of paperless and high efficiency.

      1. Operational Feasibility Analysis

The operation of this system to realize the function is very simple. The common configuration of ordinary computers can run this software, and as long as you have a rough understanding of the basic common sense of computer use, you can use this software smoothly. The computer has the ability to connect to the Internet and can access the system normally. It does not require the operator to have any superb ability. It only needs to understand the business process and operate correctly according to professional knowledge. Therefore, the property management system of Kangtai Community is feasible. .

    1. Functional Requirements Analysis

Before system development and design, you should make a preliminary idea of ​​the functions, know what sections the management system has, what functions each section has, whether the overall design meets the needs of users, and then conduct a detailed analysis and summary of the developed system functions , so as to design a complete system and implement it. Communication analysis of users and developers to achieve the best understanding and make the system function to the best.

The owner use case diagram is shown below.

Figure 3-1 Owner use case diagram

The administrator use case diagram is shown below.

Figure 3-2 Administrator use case diagram

After analyzing the requirements of the property management system of Kangtai Community, the whole system is mainly divided into two parts: the administrator and the owner, and the functions of the branches under each module are different. Describe the function as follows:

Owner module:

Account login authentication.

Manage profile information, modify modifiable information items.

Repair repair records, and view the history of repair repair records that have been submitted at the same time.

Property payment query, and at the same time check the historical payment records.

Admin module:

Maintain the owner, review the owner's account, freeze the owner's login authority, or delete the owner's account.

Publish house information, and can destroy a house, update house data, fuzzy search house data, etc.

Publish parking space information, and can destroy a certain parking space information, update parking space information data, fuzzy search for parking space information data, etc.

Manage property bill payment data.

Manage parking fee data.

View the repair data submitted by the owner, and the administrator has the right to maintain it.

    1. Non-Functional Requirements Analysis

There are many non-functional requirements of the system, such as performance requirements, maximum number of users that can be carried, stability, and usability requirements. The analysis of this system takes into account the requirement of ease of use, because the system is used by people, so it is necessary to fully consider the user experience from the user's point of view, so that the system is easy to understand, easy to use and easy to operate.

    1. Data Flow Analysis

The zero-level data flow chart includes modules such as login, user function, and retrieval maintenance. The data used in the login module stores user account documents, and the storage required by the user function module is the data file of each user function module. The retrieval maintenance uses the above Data documents are retrieved by keywords.

The zero-level data flow diagram of the system is shown in the figure below.

Figure 3-2 System data flow diagram (zero layer)

The first-level data flow chart is a refinement of the zero-level data flow chart, subdividing login into filling in login data and improving data, and subdividing user functions into basic user functions and main user functions.

The layer-by-layer data flow diagram of the system is shown in the figure below.

Figure 3-3 System data flow diagram (one layer)

The second-tier data flow is the refinement of filling in login information and user functions in the first-tier data flow diagram. That is: fill in the login information and refine it into information filling and background review, and user functions are refined into operations such as announcement query, property payment query, and property repair application.

The layer 2 data flow diagram of the system is shown in the figure below.

Figure 3-4 System data flow diagram (second floor)

  1. system design
    1. System architecture design

At present, the main data access method of the B/S system system is: the user can enter the system through the browser page, and the system can automatically process the request sent by the user to the server. The processing request is carried out in the background of the system. Perform corresponding operations on the page, and you can see the processing results delivered by the server. The property management system of Kangtai Community is mainly divided into view-model-control three-tier architecture design. In the view layer, it mainly operates the data that is fed back and displayed from the server to the client. In the model layer, it mainly deals with related business logic, data integration, etc., and the final control layer is between the view and the model. It is to adjust the relationship between the two layers and finally implement the data transmission.

The system architecture diagram is shown in the figure below.

Figure 4-1 System architecture diagram

    1. System function structure

The purpose of system design is to analyze all the functional structures included in the system, and make preparations for developers to design, develop and implement the system. After the preliminary demand investigation, analysis and sorting, the determined overall demand mainly includes multiple modules, namely: owner management, housing management, announcement management, property payment management, repair report management, parking space management, and parking space charge management. The overall role of the system is divided into two parts, one is the owner, and the last is the administrator. The authority distribution is also obvious. In addition to browsing information, the owner also has the authority to inquire and manage his own account information, announcement inquiry, property payment inquiry, and repair application; the administrator is the owner of the highest authority.

The functional structure diagram of the system is shown in the figure below.

Figure 4-2 System function structure diagram

    1. Functional module design

User Management Module

This module is designed for all users to log in. For example, after logging in, the owner can only perform his own common function operations (such as personal information modification), and the administrator and super administrator have different permissions after logging in, and the administrator cannot exceed the permissions. The super administrator can manage the data of the entire system, mainly the user's login authority and the user's operation authority in the system after login.

Owner payment module

Owners check their own payment records. The relationship is one-to-many. According to the owner number, the owner's data is transferred to the payment data. The operator is the owner, and then a payment list is generated. The owner can view the personal historical payment list and destroy the data.

Owner Maintenance Module

The operator enters the owner data, clicks the owner input button, fills in the owner data to be entered in turn, clicks the submit button, submits the data to the database, and then refreshes the owner data page. There are delete and edit buttons on the right of each data to complete the corresponding delete and update functions.

Housing Maintenance Module

The operator enters the housing data, clicks the housing input button, fills in the housing data to be input in turn, clicks the submit button, submits the data to the database, and then refreshes the housing data page. There are delete and edit buttons on the right of each data to complete the corresponding delete and update functions.

Announcement Maintenance Module

The administrator clicks the announcement management menu, clicks the announcement add submenu, adds announcement data, fills in the title, content, category, picture, and after the submission is successful, the announcement data page is refreshed, and the new data is successfully loaded into the page.

Repair and maintenance module

According to the process of repair report and maintenance, the owner submits the repair report data, and the historically submitted repair report data can be viewed in the personal background, and the administrator maintains the repair report data, approves and confirms the existing repair report data.

Print and export modules

Multiple pages of the system can be printed, including the information detail page and information list page. When printing, the external printer is called, and the print can be printed after completing the print settings. On the information list page, the information list can be exported to excel, and the user chooses to save the excel file The path can be downloaded to the local, and can be freely edited in excel.

    1. Database Design
      1. conceptual model

For a system to be developed, ER diagrams allow others to understand the transactions of the system and the relationships between them faster and easier. According to the conclusions drawn in the system analysis stage, it is determined that there are multiple entities in the property management system of Kangtai Community, which are the owner, the administrator, the house, the payment, the parking space, the parking space fee, and the property repair.

The overall ER diagram of the system is shown in the figure below.

Figure 4-4 System overall ER diagram

      1. relational model

Admin ( admin id , username, password, permissions)

Owner ( owner id , account number, password, name, gender, mobile phone, ID card, address)

Announcement data ( announcement id , title, category, home page image, click rate, publisher)

Payment ( payment id , building, unit, house number, owner, other expenses, property fee, parking space fee, payment date, total, payment type, payment status)

Repair report ( repair id , declarer, building information, whether to review, review reply)

      1. data sheet

The logical structure of the database is to describe the ER diagram in the database with specific fields. Use fields and data type descriptions to materialize object characteristics, and finally form a database table structure with certain logical relationships. Part of the data structure table required by the property management system of Kangtai Community is shown in the following table.

name

type

length

not null

primary key

note

owner_id

int

11

yes

yes

Owner ID

full_name

varchar

64

no

no

Name

gender

varchar

64

no

no

gender

id_number

varchar

255

no

no

ID number

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

user_id

int

11

yes

no

User ID

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

real_estate_management_id

int

11

yes

yes

Housing management ID

house_number

varchar

64

no

no

house number

building

varchar

64

no

no

building

unit

varchar

64

no

no

unit

owner

int

11

no

no

owner

check_in_time

date

0

no

no

check in time

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

Report for repair_id

int

11

yes

yes

Repair ID

owner

int

11

no

no

owner

declaration_time

date

0

no

no

Declaration time

remark_information

varchar

64

no

no

Remarks

declaration_content

longtext

0

no

no

Declaration content

examine_state

varchar

16

yes

no

Approval Status

examine_reply

varchar

16

no

no

review reply

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

  

name

type

length

not null

primary key

note

Property payment_id

int

11

yes

yes

Property payment ID

house_number

varchar

64

no

no

house number

building

varchar

64

no

no

building

unit

varchar

64

no

no

unit

owner

int

11

no

no

owner

payment_date

date

0

no

no

payment date

parking_rate

int

11

no

no

Parking Fee

property_fee

int

11

no

no

Property costs

other_expenses

int

11

no

no

Other fees

total

varchar

64

no

no

total

remark_information

text

0

no

no

Remarks

pay_state

varchar

16

yes

no

Payment status

pay_type

varchar

16

no

no

Payment Types:

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

announcement_management_id

int

11

yes

yes

Announcement Management ID

title

varchar

64

no

no

title

release_time

date

0

发布时间

public_type

varchar

64

公共类型

announcement_content

longtext

0

公告内容

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

 

  1. 系统实现
    1. 登录模块的实现

系统的登录窗口是用户的入口,用户只有在登录成功后才可以进入访问。通过在登录提交表单,后台处理判断是否为合法用户,进行页面跳转,进入系统中去。

登录合法性判断过程:用户输入账号和密码后,系统首先确定输入输入数据合法性,然后在login.jsp页面发送登录请求,调用src下的mainctrl类的dopost方法来验证。

用户登录模块的IPO如下所示:

输入:用户名和密码。

处理:

1)检测用户输入的账号、密码是否正确及在数据库已对应存在。

2)从数据库中提取记录,并储存在本地的session中(timeout默认=30min)。

3)根据用户名,将其显示在系统首页上。

输出:是否成功的信息。

登录流程图如下所示。

图5-1登录流程图

系统登录界面如下所示。

图5-2系统登录界面

用户登录的逻辑代码如下。

/**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

    public Map<String, Object> login(@RequestBody Map<String, String> data, HttpServletRequest httpServletRequest) {

        log.info("[执行登录接口]");

        String username = data.get("username");

        String email = data.get("email");

        String phone = data.get("phone");

        String password = data.get("password");

        List resultList = null;

        Map<String, String> map = new HashMap<>();

        if(username != null && "".equals(username) == false){

            map.put("username", username);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(email != null && "".equals(email) == false){

            map.put("email", email);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(phone != null && "".equals(phone) == false){

            map.put("phone", phone);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }else{

            return error(30000, "账号或密码不能为空");

        }

        if (resultList == null || password == null) {

            return error(30000, "账号或密码不能为空");

        }

        //判断是否有这个用户

        if (resultList.size()<=0){

            return error(30000,"用户不存在");

        }

        User byUsername = (User) resultList.get(0);

        Map<String, String> groupMap = new HashMap<>();

        groupMap.put("name",byUsername.getUserGroup());

        List groupList = userGroupService.select(groupMap, new HashMap<>()).getResultList();

        if (groupList.size()<1){

            return error(30000,"用户组不存在");

        }

        UserGroup userGroup = (UserGroup) groupList.get(0);

        //查询用户审核状态

        if (!StringUtils.isEmpty(userGroup.getSourceTable())){

            String sql = "select examine_state from "+ userGroup.getSourceTable() +" WHERE user_id = " + byUsername.getUserId();

            String res = String.valueOf(service.runCountSql(sql).getSingleResult());

            if (res==null){

                return error(30000,"用户不存在");

            }

            if (!res.equals("已通过")){

                return error(30000,"该用户审核未通过");

            }

        }

        //查询用户状态

        if (byUsername.getState()!=1){

            return error(30000,"用户非可用状态,不能登录");

        }

        String md5password = service.encryption(password);

        if (byUsername.getPassword().equals(md5password)) {

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

            accessToken.setToken(UUID.randomUUID().toString().replaceAll("-", ""));

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

            JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(byUsername));

            user.put("token", accessToken.getToken());

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

            return error(30000, "账号或密码不正确");

        }

}

    1. 用户子系统模块的实现
      1. 用户首页模块

系统呈现出一种简洁大方的首页:界面简约、鳞次栉比,用户能轻车熟路的使用。出于对系统使用群体广泛的顾虑,应有良好性能的后台。如下图所示为系统的首页界面。

图5-3系统首页界面

其中载入前台页面的主要代码如下。

<td><%@ include file="qttop.jsp"%></td>

<td><%@ include file="qtleft.jsp"%></td>

<td><%@ include file="qtdown.jsp"%></td>

      1. 物业缴费模块

物业缴费过程中,首先使用getmap(id,"xinxi"),通过业主ID得到物业费用数据,将数据赋值给物业缴费数据,调用CommDAO的insert方法将缴费数据插入缴费表中,最后查看个人历史物业缴费记录,可以销毁历史缴费数据。

物业缴费流程图如下所示。

图5-4物业缴费流程图

物业缴费界面如图所示。

图5-5物业缴费界面

物业缴费管理界面如图所示。

图5-6物业缴费管理界面

物业缴费关键代码如下所示。

  @PostMapping("/add")

    @Transactional

    public Map<String, Object> add(HttpServletRequest request) throws IOException {

        service.insert(service.readBody(request.getReader()));

        return success(1);

    }

    @Transactional

    public Map<String, Object> addMap(Map<String,Object> map){

        service.insert(map);

        return success(1);

}

    public Map<String,Object> readBody(BufferedReader reader){

        BufferedReader br = null;

        StringBuilder sb = new StringBuilder("");

        try{

            br = reader;

            String str;

            while ((str = br.readLine()) != null){

                sb.append(str);

            }

            br.close();

            String json = sb.toString();

            return JSONObject.parseObject(json, Map.class);

        }catch (IOException e){

            e.printStackTrace();

        }finally{

            if (null != br){

                try{

                    br.close();

                }catch (IOException e){

                    e.printStackTrace();

                }

            }

        }

        return null;

}

    public void insert(Map<String,Object> body){

        StringBuffer sql = new StringBuffer("INSERT INTO ");

        sql.append("`").append(table).append("`").append(" (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            sql.append("`"+humpToLine(entry.getKey())+"`").append(",");

        }

        sql.deleteCharAt(sql.length()-1);

        sql.append(") VALUES (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            Object value = entry.getValue();

            if (value instanceof String){

                sql.append("'").append(entry.getValue()).append("'").append(",");

            }else {

                sql.append(entry.getValue()).append(",");

            }

        }

        sql.deleteCharAt(sql.length() - 1);

        sql.append(")");

        log.info("[{}] - 插入操作:{}",table,sql);

        Query query = runCountSql(sql.toString());

        query.executeUpdate();

    }

      1. 报修模块

业主提交报修,可以进行新增、查看、修改以及删除等相应的报修管理操作。当点击"新增报修"的按钮时,在报修添加界面进行详细信息的添加操作。当点击"查看报修"超级链接时,会显示所选的报修的信息,然后点击"返回"再返回到其主页面。

报修提交界面如图所示。

图5-7报修提交界面

报修管理界面如图所示。

图5-8报修管理界面

报修提交关键代码如下所示。

@RequestMapping("/get_list")

    public Map<String, Object> getList(HttpServletRequest request) {

        Map<String, Object> map = service.selectToPage(service.readQuery(request), service.readConfig(request));

        return success(map);

}

    1. 管理员子系统模块的实现
      1. 业主管理模块

业主在yhzhgl查看业主信息,先使用sql语句查询出所有业主表的数据,然后调用PageManager.getPages(url,4,sql, request ),返回一个ArrayList的对象,在for循环里,使用jsp得到每个ArrayList对象的数据,在jsp页面中解析ArrayList对象,得到其各个键值对的值。

业主管理界面如下图所示。

图5-9业主管理界面

业主管理关键代码如下所示。

 @RequestMapping(value = {"/count_group", "/count"})

    public Map<String, Object> count(HttpServletRequest request) {

        Query count = service.count(service.readQuery(request), service.readConfig(request));

        return success(count.getResultList());

}

      1. 个人资料模块

用户点击登录填写账号信息登录后,会切换内容为“某某用户欢迎您”和历史订单,并给出注销链接。当用户登录成功后会将个人信息保存在session作用域中,点击自己的用户名时,会跳转到个人详细信息页面,由后台通过Freemarker取出session作用域中的用户信息进行动态渲染,例如,邮箱、电话号码、用户名等等。同时页面上会显示修改个人信息和修改密码的按钮,这时客户可以修改自己的登录密码以保障账号的安全性,防止被人窃取账号,通过UserController.java的updatePassword()实现,同时也可以根据自己的个人信息是否变动做出相应的修改,通过updateUserInfo()实现。

密码修改流程图如下所示。

图5-10密码修改流程图

      1. 房屋管理模块

添加房屋信息时,输入必填字段后,表现层的FangchanController接受传过来的房屋信息参数,再调用FangchanController类的addFangchan方法,经过FangchanService业务层到FangchanMapper持久层的处理,完成对整个添加房屋信息的操作。addFangchan方法也和用户管理中的addUser方法类似,同时做添加和修改工作。

修改房屋信息时,选择需要修改的房屋进行修改,调用FangchanController控制器的editFangchan方法,拿到该房屋原本的信息并显示到页面,管理员再对需要修改的房屋信息字段进行修改,完成后调用addFangchan方法,调用业务层的updateByKey方法,更新数据库的房屋信息表的数据。

房屋管理流程图如下所示。

图5-11房屋管理流程图

房屋添加界面如下图所示。

图5-12房屋添加界面

房屋管理界面如下图所示。

图5-13房屋管理界面

房屋信息添加关键代码如下所示。

@RequestMapping(value = {"/avg_group", "/avg"})

public Map<String, Object> avg(HttpServletRequest request) {

        Query count = service.avg(service.readQuery(request), service.readConfig(request));

        return success(count.getResultList());

}

      1. 车位管理模块

删除车位时,选择需要删除的车位进行删除,把主键的uId传到cheweiController控制器,再调用控制器的deletechewei方法,数据经过cheweiService业务层解析和处理,请求cheweiMapper持久层调用deleteByPrimaryKey方法操作数据库将车位数据从数据库中删除。

查找车位时,输入需要查找的车位名,调用getData方法获取所有数据并且进行分页,把获取到的所有数据显示到视图上,这时候只需要用脚本方法便能快速查找,不涉及对数据库操作。

车位管理流程图如下所示。

图5-14车位管理流程图

车位添加界面如下图所示。

图5-15车位添加界面

车位管理界面如下图所示。

图5-16车位管理界面

车位添加关键代码如下所示。

@RequestMapping(value = {"/sum_group", "/sum"})

    public Map<String, Object> sum(HttpServletRequest request) {

        Query count = service.sum(service.readQuery(request), service.readConfig(request));

        return success(count.getResultList());

}

  1. 系统测试
    1. 测试目的

在对该系统进行完详细设计和编码之后,就要对康泰小区物业管理系统的程序进行测试,检测程序是否运行无误,反复进行测试和修改,使之最后成为完整的软件,满足用户的需求,实现预期的功能。

    1. 测试过程

在软件的测试过程中,通常测试人员需要针对不同的功能模块设计多种测试用例。通过测试用例能够及时发现代码业务逻辑上是否与真实的业务逻辑相对应,及时发现代码上或逻辑上的缺陷,以此来来完善系统,提高软件产品的质量,使软件具有良好的用户体验。

登录测试用例表如下所示。

表6-1登录测试用例

测试性能

用户或操作员登录系统

用例目的

测试用户或操作员登录系统时功能是否正常

前提条件

进入用户登录页面或操作员登录页面

输入条件

预期输出

实际情况

各项信息不予填写,直接点击登陆按钮

不允许登录,提示填写账号相关信息

一致

填写错误的登录名或密码后点击登录系统

提示用户名或密码错误,要求重新填写进行登录

一致

填写与验证码信息不一致的信息

系统显示出提示信息,表明验证码错误,要求重新填写

一致

业主缴费测试用例表如下所示。

表6-2业主缴费测试用例

测试性能

用户进行缴费业主的操作

用例目的

测试用户进行缴费业主操作时,系统的功能是否正常

前提条件

用户进入业主详情页,该业主能够被缴费

输入条件

预期输出

实际情况

用户未登录,点击缴费按钮

跳转至登录页面,提示用户先进性登录

一致

正常的登录用户,点击缴费按钮

系统弹出提示框,提示用户缴费成功,同时该业主的状态更改为已缴费状态

一致

业主管理测试用例表如下所示。

表6-3业主管理测试用例

测试性能

业主相关信息管理功能

用例目的

测试系统后台操作员对业主相关信息进行管理的功能是否正常

前提条件

登录系统后台进入相关管理页面

输入条件

预期输出

实际情况

普通操作员登录,点击进入业主相关信息管理的页面

提示非超级用户,权限不够,无法进入相关页面

一致

超级操作员登入,删除某个已被缴费的业主

提示该业主删除失败

一致

点击增加业主按钮

页面正常跳转

一致

增加业主是,填写已存在的业主编号

提示该编号已存在

一致

    1. 测试结果

经过对此系统的测试,得出该系统足以满足用户日常需求,在功能项目和操作等方面也能满足操作员对于其他用户的管理。但是,还有很多功能有待添加,这个系统仅能满足大部分的需求,还需要对此系统的功能更进一步的完善,这样使用起来才能更加的完美。

  1. 总结与展望

通过康泰小区物业管理系统的开发,本人巩固了之前学过的知识,如今将平时所学到的知识融合在设计中,在设计过程中,做了很多的准备,首先,在数据库系统的设计过程中,尤其是在数据库的工作原理、工作特点,对其深刻的讨论,与此同时,对于小型站点来说,最好服务器的选择,其次,利用所学的知识点分析所做的系统,并在此基础上设计。

目前本系统已经上线,正在试运行阶段,用户反馈良好,基本完成用户所需,试运行过程中没有出现阻断性问题,有一些不足和小问题也及时予以修正,系统上线后,为了保证数据的安全性,对系统进行了备份操作,系统备份是每两个月备份一次,数据库备份为每周备份一次,系统部署在租赁的云平台服务器中。

本次系统上线成功后,得到了用户的高度认可,但是在功能上和性能上还需做进一步的研究处理,使其有更高的性能和更好的用户体验。

系统在以后的升级过程中,需要解决一系列用户所提出的问题,例如打印过程中如何避免浏览器的兼容性问题,大量用户访问时,如何保持较高的响应速度,在系统今后的升级过程中将着重解决这些安全性问题。

参考文献

[1][美]MartinFowler.徐家福译《UML精粹:标准对象语言简明指南》[M],北京:清华大学出版社,2015.3,26-32

[2][美]TimothyBudd著.三联四方工作室译《面向对象Java编程思想》[M],北京:清华大学出版社,2012.8,132-146

[3][美]WayS.Horstmann等著.李如豹,刚冬梅,张雪莲等译.《最新Java2核心技术卷工:原理》[M].北京:机械工业出版社,2012.2,201-210

[4][美]2ScottOaks著.林琪译.(JavaTM安全第二版)[M],北京:中国电力出版社,2012.4,50-86

[5][美]GeorgeReese著.石永薪,宋隆译.《JDBC与Java数据库编程》[M]北京:中国电力出版社,2012.3.20-86

[6]王宝华.王宝石,《人力资源管理》[J].北京:机械工业出版社,2014.8,42-56

[7]姜承尧著.《MySQL高效编程》[J].北京:机械工业出版社,2012,56-72

[8]张海帆著,软件工程导论(第5版).北京:清华大学出版社,2008.3,60-97

[9][美]WritenbySteveMcConnell,RapidDevelopment:TamingWildSoftwareSchedules[J],MicrosoftPress,2017-7-11,324-403

[10]DonaldKnuth,TheArtofComputerProgramming[J].北京:清华大学出版社,2012(9),24-90

[11]WritenbyEricA.Smith,JavaServerPages[J].北京:电子工业出版社,2010,36-75

[12]WritenbyKimberlyC.Ward.KoreyManley.RichardKeen.JenniferKelly;AnneW.Lipe;JaneClemmer,Theeffectsofanartsinterventionprograminacommunitymentalhealthsetting[J]:AcollaborativeapproachTheArtsinpsychotherapy,2012,25-20

[13]阳小兰,罗明.基于Spring+SpringMVC+MyBatis网上论坛的设计与实现[J].黑龙江科技信息,2016(36):279-280.

[14]张瑞青,李铁柱.基于SpringMVC的用户登录系统的设计与实现[J].科技信息,2015(10):246-247.

[15]王玉英.基于JSP的MySQL数据库访问技术[J].现代计算机,2015,19(14):63-66.

[16]张波,张福炎.基于JSP技术的Web应用程序的开发[J].计算机应用研究,2014,18(5):99-101.

[17]高张,康小军.提高Tomcat服务器运行性能的研究[J].计算机与数字工程,2016,36(10):203-205.

[18]ArifS,OlariuS,WangJ,etal.DatacenterattheAirport:ReasoningaboutTime-DependentParkingLotOccupancy[J].IEEETransactionsonParallel&DistributedSystems,20115,23(11):2067-2080.

[19]LeeS,YoonD,GhoshA.Intelligentparkinglotapplicationusingwirelesssensornetworks[C]//InternationalSymposiumonCollaborativeTechnologiesandSystems.IEEE,2016:48-57.

[20]姜俊卿;刘波.《基于B/S的学生信息管理系统的设计与实现》[J]江西:大观周刊:下半月,2015, 104-109

致谢

伴随着设计的完成,大学生涯也随之即将结束。大学期间是我最珍惜的时光,大学时光中学会了很多,也成长了很多,这段时光中每一段回忆都刻在脑海中。感谢一起学习,一起成长同学们,和成长过程悉心教导的老师们,非常感激有你们的陪伴。

首先感谢我的指导老师,设计的完成离不开老师的一系列指导。在毕业设计的完成过程中,老师给出了很多中肯的建议,正是由于老师一丝不苟的工作态度,我的设计才能顺利的完成。

Finally, I would like to thank every teacher who taught me during my college career. You have taught me a wealth of knowledge and taught me how to deal with and solve problems when I encounter them. Thank you for your help and support.

Please pay attention to like + private message blogger, get the source code of the project for free

Guess you like

Origin blog.csdn.net/ID3461074420/article/details/131292113