(with source code) springboot student dormitory management system graduation project 211955

Summary

The rapid development of scientific and technological progress has caused great changes in people's daily life, and the rapid development of electronic information technology has made the application level of electronic information technology in various fields popularized and applied. The arrival of the information age has become an irresistible fashion trend, and the history of human development is entering a new era. In practice, the working rules and development steps of the application software are used to construct the student dormitory management system with java technology.

This design mainly realizes the student dormitory management system integrating the advantages of humanization, high efficiency, and convenience, and completes the home page, user management (administrators, students, dormitory staff) and more management (dormitory information, dormitory repair, dormitory allocation, etc.) dormitory notification) and other functional modules. The system communicates with the server through the browser to realize data interaction and change. The system improves work efficiency and reduces errors and omissions in data storage through scientific management methods and convenient services. The student dormitory management system uses the Java language and is developed using the spring boot technology based on the MVVM model. It is written using the Eclipse 2017 CI 10 compiler. In terms of data, it mainly uses Microsoft's SQLserver database as the data storage medium, and cooperates with the front-end HTML+CSS technology Complete system development.

Keywords  : student dormitory management system; java technology; Mysql database;


Abstract

The rapid development of scientific and technological progress has caused great changes in people's daily life. The rapid development of electronic information technology has popularized and applied the application level of electronic information technology in various fields. The advent of the information age has become an irresistible fashion trend, and the history of human development is entering a new era. In practical application, according to the working rules and development steps of the application software, Java technology is used to build the student dormitory management system.

This design mainly realizes the student dormitory management system with the advantages of humanization, high efficiency and convenience, and completes the functional modules such as home page, user management (administrators, students and dormitory management personnel) and more management (dormitory information, dormitory repair application, dormitory distribution and dormitory notice). The system communicates with the server through the browser to realize the interaction and change of data. Through scientific management and convenient service, the system improves work efficiency and reduces errors and omissions in data storage. The student dormitory management system is developed using java language, spring boot technology based on MVVM mode and eclipse 2017 CI 10 compiler. In terms of data, Microsoft's SQLSERVER database is mainly used as the data storage medium, and the system development is completed with the foreground HTML + CSS technology.

Key words: Student dormitory management system; Java technology; Mysql database;

Table of contents

1 Overview 1

1.1 Subject background and significance 1

1.2 Research status 1

1.3 Main work of this subject 2

2   Key Technology Introduction 3

2.1  Development Technology 3

2.2   MVVM pattern 3

2.3 MySQL database  4 _

2.4 B /  S structure 4

2.4 Introduction to spring boot framework  4

2.4 Main functions of Vue.js  4

3 System Analysis 6

3.1 Feasibility Analysis 6

3.1.1 Technical Feasibility 6

3.1.2 Operational Feasibility 6

3.1.3 Economic feasibility 6

3.1.4 Legal feasibility 7

3.2 System flow analysis 7

3.2.1 System development process 7

3.2.2 User login process 8

3.2.3 System operation process 8

3.2.4 Add information process 9

3.2.5 Modify information flow 10

3.2.6 Delete information flow 10

3.3 System use case analysis 11

4 System Design 15

4.1 System overview 15

4.2 System structure design 15

4.3 Database Design 16

4.3.1 Entity ER Diagram 16

4.3.2 Database table design 16

5 System Detailed Design 23

5.1 Implementation of login module 23

5 . 2 Realization of user subsystem module 24

5. 2.1 User home page module 24

5.2.2 Dormitory information module 26

5.2.3 Dormitory Assignment Module 27

5.3 Implementation of the Administrator Subsystem Module 28

5.3.1 Student Management Module 29

5.3.2 Profile module 30

5.3.3 Dormitory maintenance report management module 32

6 System Test 33

6.1 Significance of system testing 33

6.2 Test methods 33

6.3 Test analysis 33

Conclusion     35

Thanks     36

Reference 37

1 Overview

1.1 Subjectbackground and meaning

For the school dormitory office, the most important thing is to manage the dormitory information. If you use the general method to manage, it will be more cumbersome, and it is very likely to make mistakes in management. In order to facilitate the management of dormitory personnel, improve work efficiency, and provide better services for students, it is necessary to develop a student dormitory management system, so that the school's dormitory management can embark on the road of informationization and overcome various human disadvantages.

The development of student dormitory management system can not only reduce the waste of human, material and financial resources, but more importantly, help to improve the efficiency of dormitory management. It is a complex organizational work for dormitory managers to manage student information and dormitory information. This complexity not only refers to the rapid change of student status and the large number of changes, but also more prominently manifests in the data volume of the main objects of dormitory management (ie students) It is very large and inconvenient to manage, so it is necessary to develop a practical and efficient dormitory management information system.

1.2 Research Status

At present, the informatization construction of all walks of life in our country is in full swing, and the development of this informatization has affected all schools. When the school manages the student dormitory, the management of the student dormitory has always been a troublesome thing. Not only is it difficult to modify and update the management, but also when students need to know the information of the dormitory, they also need to go to the school dormitory to find specialized personnel. Due to the cumbersomeness of these operations, the development of student dormitory management systems has become a must for every school, especially every college.

However, at present, many student dormitory management systems are inefficient and error-prone when they are in use. The information of students and teachers is not easy to sort out, and a large number of them are lost. These have undoubtedly become obstacles to the management of student dormitories. This requires the school to establish an efficient student dormitory management system, standardize management of student dormitory, management and other operations and processes, simplify business processes, improve work efficiency and prevent intermediate loopholes; quickly and accurately capture user requirements, and implement them Respond efficiently. At the same time, it is necessary to continuously improve the system, add modules, better meet the needs of users, simplify the management of dormitory personnel, and try to achieve all informatization.

1.3 Organizational structure 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 development tools adopted by the student dormitory management system.

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.

2   Key Technology Introduction

2.1 Development Technology

The front-end framework of this system adopts the popular progressive JavaScript framework Vue.js. Use Vue-Router and Vuex to realize dynamic routing and global state management, Ajax to realize front-end and back-end communication, and Element UI component library to make the page quickly form. Back-end part: use springboot as the development framework, and integrate MyBatis, Redis and other related technologies at the same time.

2.2 MVVM pattern

MVVM is shorthand for Model-View-ViewModel. It's essentially an improved version of MVC. MVVM is to abstract the state and behavior of the View in it, and let us separate the view UI from the business logic. Of course, ViewModel has already done these things for us. It can take out the data of Model and help deal with the business logic involved in View because of the need to display content. Microsoft's WPF brings new technical experience, such as Silverlight, audio , video , 3D , animation ..., which leads to more detailed and customizable software UI layer. At the same time, at the technical level, WPF also brings new features such as Binding, Dependency Property, Routed Events, Command, DataTemplate, and ControlTemplate. The origin of the MVVM (Model-View-ViewModel) framework is a new type of architectural framework developed and evolved from the application of the MVP (Model-View-Presenter) pattern combined with WPF . It is based on the original MVP framework and incorporates the new features of WPF to cope with the increasingly complex needs of customers.

2.3 MySQL database

The advancement of science and technology has brought many conveniences to daily life: classroom projectors use virtual imaging technology, digital cameras use photoelectric detection technology, for example, the records of goods entering and leaving warehouses in supermarkets require an information warehouse. This information warehouse is a database, and this computer hardware sales system also needs the support of this technology.

The reason for using the MySQL software is that it can be accessed by multiple users, and there are Archives, etc. in it. It will classify the data first, and then store them in tables separately. Such special operations will improve the speed of the data management system itself, allowing the database to be used flexibly. The code of MySQL is public, and allows others to compile and upgrade it twice. This feature can reduce the cost of users, and form a good website system after matching with suitable software. Although it has shortcomings, it is the mainstream application object of users in all aspects.

2.4 B/S structure

The B/S (browser/server) structure is the current mainstream network structure model. It can concentrate the core functions of the system on the server, and can help system developers simplify operations and facilitate maintenance and use. Users only need to install 360 browser, Google browser, QQ browser and other popular browsers on the client, and install databases such as sqlserver and mysql database in the computer. The installed browser interacts with the server-side database for information and data. Many things that special software can do can also be realized by using the B/S structure mode, which can combine technologies such as Web browser technology, ActiveX technology and various scripting languages. Help program developers save a lot of development costs. At present, the B/S structure has become the mainstream structure of program development. Its best feature is that it has no location restrictions and does not need to install special software. Laptops or computers can access the system with Internet access. The system uses B/S for development, which will save trouble in the later system maintenance. You don’t need to operate on the server for all problems. Simple client processing can solve some problems. The developed program will also enhance the interaction with users. The browser can be refreshed in real time to update the local data information of the program.

 

Figure 1-1 B/S mode three-layer structure diagram

2.5 Spring boot framework introduction

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.

2.6 Main functions of Vue.js

Vue.js is a progressive framework for building user interfaces. Unlike other heavyweight frameworks, Vue is designed with bottom-up incremental development. Vue's core library only focuses on the view layer, and is very easy to learn and integrate with other libraries or existing projects. On the other hand, Vue is fully capable of driving complex single-page applications developed with single-file components and libraries supported by the Vue ecosystem.

The goal of Vue.js is to enable responsive data binding and composed view components with the simplest API possible .

Vue.js itself is not a catch-all framework - it only focuses on the view layer. So it's very easy to learn, very easy to integrate with other libraries or existing projects. On the other hand, Vue.js can also power complex single-page applications when used with related tooling and supporting libraries.

3 System Analysis

The so-called system analysis is that the demand personnel communicate with customers, obtain information, and then present this information to users and developers through the demand specification. In the long history of software function development, for a long time, especially at the beginning, the importance of requirements analysis was not recognized by people. The development started under unclear conditions, and the initial construction period was one year. Due to unclear demand acquisition, the construction period was delayed for more than half a year, causing huge losses. This situation also exists in many of our software companies. They directly copy the same type of projects and make changes while they are developing while demanding, even without clear communication with customers, which leads to re-modification when the system is accepted, resulting in manpower and material resources. a great waste. The reason for all these consequences is that the demand acquisition is not timely, unclear, and incomplete.

3.1 Feasibility Analysis

The main goal of the student dormitory management system is to realize the information management service related to classroom reservation. After determining the goal, we conduct a feasibility analysis on whether the goal of this system can be realized from the following four aspects.

3.1.1 Technical Feasibility

The student dormitory management system mainly adopts java technology, based on B/S structure and Mysql database. The development of the application requires complete functions, easy to use, and a database with complete, safe and stable data. The development technology of the student dormitory management system is very feasible, and the developers have mastered certain development technology, so the development of the system is feasible.

3.1.2 Operation Feasibility

The login interface of the student dormitory management system is simple and easy to operate. Common interface windows are used to log in to the interface, and access operations are performed through computers. Members can access operations as long as they have used computers. The development of this system adopts java language development, based on B/S structure, these development environments make the system more perfect. This system has the characteristics of easy operation, easy management and good interaction, and is very simple in operation. Therefore, the system can be developed.

3.1.3 Economic feasibility

The student dormitory management system is based on the B/S model and uses Mysql database to store data. The required hardware and software environment are easy to purchase in the market, and the program development is mainly the development and maintenance of the management system. Therefore, the program does not require high manpower and financial resources for development, and the system is not very complicated, the development cycle is short, and it has high economic feasibility.

3.1.4 Legal feasibility

This student dormitory management system is a management system designed by ourselves, which has great practical significance. Because both the software and the database use open source codes, the development and design of this system does not have any problems such as infringement, and is completely legally feasible.

To sum up, the student dormitory management system is highly feasible in terms of technology, economy, operation and law, and it is feasible to develop this program.

3.2 System flow analysis

3.2.1 System development process

When developing the student dormitory management system, firstly analyze the requirements, then carry out the overall design and planning of the system, design the system function modules, select the database, etc. The development process of this system is shown in Figure 3-1

 

Figure 3-1 System development flow chart

3.2.2 User login process

In order to ensure the security of the system, if you want to use this system to manage system information, you must log in to the system first. As shown in Figure 3-2.

 

Figure 3-2 Login flow chart

3.2.3 System operation process

After the user opens and enters the system, the login interface will be displayed first. Enter the correct user name and password, and the system will automatically detect the information. If the information is correct, the user will enter the system function interface and perform operations. Otherwise, it will prompt an error and cannot log in. The operation process is as follows As shown in Figure 3-3.

 

Figure 3-3 System operation flow chart

3.2.4 Add information flow

Administrators can add information to information, etc., and users can also add information within their authority. After entering information, the system will verify the information and data entered. If the information is correct, it will be added to the database. If the information is incorrect, it will prompt you to re-enter the information. The process of adding information is shown in Figure 3-4.

 

Figure 3-4 Flowchart of adding information

3.2.5 Modify information flow

The administrator can modify the information, etc., and the user can also modify the information within his authority. First, enter the modification information interface, enter the modification information data, and the system will judge and verify the data. If the modification information is legal, the modification is successful, and the information is updated to Database, if the information is illegal, the modification will fail and re-enter. Figure 3-5 shows the modification information flowchart.

 

Figure 3-5 Modification information flow chart

3.2.6 Delete information flow

The administrator can delete the information, etc. After selecting the information to be deleted, click the delete button, and the system will ask whether you are sure. If you click OK, the system will delete the selected information and delete the information in the database. Delete, the flow chart of deleting information is shown in Figure 3-6.

 

Figure 3-6 Flow chart of deleting information

3.3 System use case analysis

Administrator Use Case Diagram

The core user in the system is the system administrator. After the administrator logs in, he can manage the background system through the administrator menu. The main functions are: home page, user management (administrators, students, dormitory staff), more management (dormitory information, dormitory repair report, dormitory assignment, dormitory notification) and other functions. An example of administrator usage is shown in Figure 3-7.

         

 Figure 3-7 Administrator use case diagram

 

Student use case diagram

When students enter the system, they can perform functional operations such as the home page, dormitory assignment, dormitory repair report, dormitory notification, and personal center. An example of student use is shown in Figure 3-8.

                

Figure 3-8 Student use case diagram

 

4 System Design

4.1 System overview

After the analysis of the system, the design of the memorized system begins. The system design includes overall design and detailed design. The overall design is just a general design. After the overall design, we can divide some things of the system, such as files, documents, data, etc. And through the overall design, we can roughly divide the modules and functions of the program. But it is only a preliminary classification, and there is no real implementation.

The overall design is only a preliminary design. Moreover, for a project, we can carry out multiple overall designs. Through comparison, including performance comparison, cost comparison, and benefit comparison, we can finally determine an optimal design plan and choose excellent The overall design can reduce development costs and increase company benefits. From this point of view, the overall design is still very important.

The working principle diagram of the student dormitory management system is shown in Figure 4-1:

 

Figure 4-1 System working principle diagram

4.2 System structure design

The system architecture diagram belongs to the system design stage. The system architecture diagram is only a product of this stage. The overall architecture of the system determines the mode of the entire system and is the basis of the system. The overall structure design of the student dormitory management system is shown in Figure 4-2.

                                   Figure 4-2 System structure diagram

 

4.3 Database design

Database is the foundation and core of information system. The quality of database design directly affects the success or failure of information system development. Creating a database table first determines the attributes of entities and the relationships between entities. Create a data table based on the relationship.

4.3.1 Entity ER Diagram

The database is the most important step in the entire software programming. For the database problem, it is mainly to determine the number of databases and the creation of structural formulas. The display system uses Mysql to manage the database to ensure data security and stability.

Conceptual models are designed to abstract real-world information and model the information world. It is a powerful tool for database design. Database conceptual model design can describe the conceptual model of the real world through ER diagrams. An ER diagram of a system shows the links between entities in the system. Moreover, the Mysql database is a database with relatively strong self-protection capabilities. The following figure is mainly an ER diagram of database entities:

1. The entity map of the dormitory maintenance report information is shown in Figure 4-3:

 

                     Figure 4-3 Entity map of dormitory maintenance report information

2. The entity map of dormitory allocation information is shown in Figure 4-4:

             

 Figure 4-4 Entity diagram of dormitory allocation

 

4.3.3 Database table design

The table information of the database is part of the design, and the detailed information of each table in the database is introduced below.

student table:

name

type

length

not null

primary key

note

student_id

int

11

yes

yes

student ID

gender

varchar

64

no

no

gender

age

varchar

64

no

no

age

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

housekeeping_personnel表:

name

type

length

not null

primary key

note

housekeeping_personnel_id

int

11

yes

yes

Dorm staff ID

gender

varchar

64

no

no

gender

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

dormitory_repair table

name

type

length

not null

primary key

note

dormitory_repair_id

int

11

yes

yes

Dormitory repair ID

building

varchar

64

no

no

building

floor

varchar

64

no

no

floor

room_number

varchar

64

no

no

Room No

repair_type

varchar

64

no

no

Repair type

housekeeping_personnel

int

11

no

no

Dorm staff

student

int

11

no

no

student

repair_reason

text

0

no

no

Reason for repair

examine_state

varchar

16

yes

no

Approval Status

examine_reply

varchar

255

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

dormitory_notice table:

name

type

length

not null

primary key

note

dormitory_notice_id

int

11

yes

yes

Dormitory Notification ID

number

varchar

64

no

no

serial number

notification_type

varchar

64

no

no

notification type

notice_title

varchar

64

no

no

notification title

housekeeping_personnel

int

11

no

no

Dorm staff

notice_content

longtext

0

no

no

notification content

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

dormitory_information表:

name

type

length

not null

primary key

note

dormitory_information_id

int

11

yes

yes

Dormitory Information ID

building

varchar

64

no

no

building

floor

varchar

64

no

no

floor

room_number

varchar

64

no

no

Room No

room_type

varchar

64

no

no

Room type

number_of_beds

int

11

no

no

number of beds

housekeeping_personnel

int

11

no

no

Dorm staff

remarks

text

0

no

no

Remark

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

dormitory_allocation表:

name

type

length

not null

primary key

note

dormitory_allocation_id

int

11

yes

yes

Residence Hall Assignment ID

building

varchar

64

no

no

building

floor

varchar

64

no

no

floor

room_number

varchar

64

no

no

Room No

room_type

varchar

64

no

no

Room type

bed_number

varchar

64

no

no

bed number

seize_a_seat

int

11

no

no

placeholder

student_account

int

11

no

no

student account

housekeeping_personnel

int

11

no

no

Dorm staff

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

5 System detailed design

5.1Implementation of the login module

The login window of the system is the user's entrance, and the user can enter and visit only after the login is successful. By submitting the form at login, the background process judges whether it is a legitimate user, jumps to the page, and enters the system.

Login legality judgment process: After the user enters the account number and password, the system first determines the legality of the input data, then sends a login request on the login.jsp page, and calls the dopost method of the mainctrl class under src to verify.

The IPO for the user login module looks like this:

Enter: username and password.

deal with:

1) Detect whether the account number and password entered by the user are correct and exist in the database.

2) Extract records from the database and store them in the local session (timeout default = 30min).

3) According to the user name, it will be displayed on the system home page.

Output: information about success.

The login flowchart is as follows.

 

Figure 5-1 Login flow chart

The system login interface is as follows.

 

Figure 5-1 Administrator login interface diagram

The administrator login key code is as follows.

/**

     * Log in

     * @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, "账号或密码不正确");

        }

}

5.2用户子系统模块的实现

5.2.1用户首页模块

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

如下图所示为系统的首页界面。

 

图5-3系统首页界面图

首页代码如下。

@SpringBootApplication

@EnableJpaRepositories

public class Application {

    public static void main(String[] args) {

        SpringApplication.run(Application.class,args);

    }

}

5.2.2宿舍信息模块

宿舍信息过程中,首先通过宿舍ID得到宿舍数据,将宿舍数据赋值给宿舍信息,调用insert方法将入住数据插入入住表中,最后查看个人历史宿舍信息记录,可以销毁历史入住数据。

宿舍信息流程图如下所示。

 

图5-4宿舍信息流程图

宿舍信息管理界面如图所示。

 

图5-5宿舍信息管理界面图

 

图5-6宿舍信息添加界面图

宿舍信息关键代码如下所示。

@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());

}

5.2.3宿舍分配模块

宿舍分配过程中,首先通过宿舍ID得到分配数据,将宿舍数据赋值给宿舍分配,调用insert方法将晚归数据插入分配表中,最后查看个人历史宿舍分配记录,可以销毁历史分配数据。

宿舍分配流程图如下所示。

 

图5-7宿舍分配流程图

宿舍分配管理界面如图所示。

 

图5-8宿舍分配管理界面图

宿舍分配关键代码如下所示。

@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());

}

5.3管理员子系统模块的实现

5.3.1学生管理模块

管理员对系统学生的管理,包括管理员学生管理,注册学生管理、登录密码修改,在yhzhgl.aspx.cs实现管理员学生的管理,包括录入、删除、修改,修改密码通过SESSION获取学生名,然后输入新密码,提交到mod.aspx.cs中,使用sql命令更新密码添加学生后,学生也可以使用账号和密码登录系统。

学生管理界面如下图所示。

 

图5-9学生管理界面图

学生管理关键代码如下所示。

@RequestMapping(value = "/del")

    @Transactional

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

        service.delete(service.readQuery(request), service.readConfig(request));

        return success(1);

}

    @Transactional

    public void delete(Map<String,String> query,Map<String,String> config){

        StringBuffer sql = new StringBuffer("DELETE FROM ").append("`").append(table).append("`").append(" ");

        sql.append(toWhereSql(query, "0".equals(config.get(FindConfig.GROUP_BY))));

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

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

        query1.executeUpdate();

    }

5.3.2个人资料模块

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

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

 

图5-10密码修改流程图

密码修改关键代码如下所示。

/**

     * 修改密码

     * @param data

     * @param request

     * @return

     */

    @PostMapping("change_password")

    public Map<String, Object> change_password(@RequestBody Map<String, String> data, HttpServletRequest request){

        // 根据Token获取UserId

        String token = request.getHeader("x-auth-token");

        Integer userId = tokenGetUserId(token);

        // 根据UserId和旧密码获取用户

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

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

        query.put("user_id" ,String.valueOf(userId));

        query.put("password" ,service.encryption(o_password));

        Query ret = service.count(query, service.readConfig(request));

        List list = ret.getResultList();

        Object s = list.get(0);

        int count = Integer.parseInt(list.get(0).toString());

        if(count > 0){

            // 修改密码

            Map<String,Object> form = new HashMap<>();

            form.put("password",service.encryption(data.get("password")));

            service.update(query,service.readConfig(request),form);

            return success(1);

        }

        return error(10000,"密码修改失败!");

    }

5.3.3宿舍报修管理模块

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

修改宿舍报修信息时,选择需要修改的宿舍报修进行修改,调用业务层的editSushe方法,拿到该宿舍原本的信息并显示到页面,管理员再对需要修改的宿舍报修信息字段进行修改,完成后调用addSushe方法,调用业务层的updateByKey方法,更新数据库的宿舍报修表的数据。

宿舍报修管理流程图如下所示。

 

图5-11宿舍报修管理流程图

宿舍报修管理界面如下图所示。

 

图5-12宿舍报修管理界面图

宿舍报修管理关键代码如下所示。

@RequestMapping(value = "/del")

    @Transactional

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

        service.delete(service.readQuery(request), service.readConfig(request));

        return success(1);

}

    @Transactional

    public void delete(Map<String,String> query,Map<String,String> config){

        StringBuffer sql = new StringBuffer("DELETE FROM ").append("`").append(table).append("`").append(" ");

        sql.append(toWhereSql(query, "0".equals(config.get(FindConfig.GROUP_BY))));

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

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

        query1.executeUpdate();

    }

6系统测试

一个系统设计好后,就会进入测试阶段,测试的目标是检验设计好的网站是否可以正常无误的运行,尽可能的发现网站的问题,已使后期网站投入使用后网站尽少出错。

6.1 测试定义

系统测试主要是判断系统是否可以正常运行,功能模块是否可以实现操作。程序代码中是否有错误出现。测试程序是开发过程中的一个主要问题。就算系统完成的再好,再进行程序测试时也会发现一个从来没有被发现的错误信息。

测试不仅是系统开发的开始,而且应该贯穿整个系统的整个生命周期。评估系统质量的方法不局限于系统编码和过程,应该与软件设计工作和历史需求分析密切相关。系统错误,不一定是代码错误,可能是阶段的设计摘要和设计细节存在问题,问题也可能出现在需求分析阶段。从实际情况来看,最初的问题很可能是一个小错误,根据按钮的原理,按钮后的按钮位错将是所有位错。该系统的原因也同样适用,随着后续的开发工作,误差将越来越严重。因此就应该对系统进行测试,在一开始就发现系统中存在的问题,就能保证以后系统能够正常稳定的运行。在测试系统中,开发人员应该站在用户的角度来处理测试工作,而现在主要的测试方法是黑盒测试。测试的目的可以概括为以下几点:首先,用户界面和用户需求是一致的,设置界面和设计风格统一;第二,创新设计接口规范设计标准,具有独特的审美特征;最后,人类传统的接口以满足审美需求,不能盲目地追求一种独特的,合理的规划布局,符合审美标准。

6.2 测试目的

测试的目的在于要对系统的稳定和可操作性能进行对照检查。对于软件的开发利用最终的目的在最后的测试和试用,这是一个不可缺少的重要环节。对于软件开发者而言,在对每一个单独的功能进行编排时候,都要有单独的测试,并通过测试阶段才可以研发多个功能性软件,这样既缩短了研发时间,也可以在的单个的早期测试中发现问题,以免融合后的软件,在查找问题时就很难快速解决或者急速定位问题。

学生宿舍管理系统开发设计完成后,需要对其进行系统测试,测试的主要目的就是发现并找出系统中存在的问题,并及时的进行解决,确保系统可以正常稳定的运行下去,在进行系统测试的时候,在一定要非常的认真、仔细,切记不能粗心,不能放过一个漏洞,测试时候一定不要着急,要按照之前指定好的测试步骤一步一步进行,并且将测试的结果进行详细的记录,我们在进行测试的时候做好选择自动化的测试,这样既可以节省时间而且也能确保测试的准确性,如果采用人工测试的方法就不会这么的方便,由于人工测试有很多不确定的因素,在测试过程中很可能会出现一些问题,用机器测试就不会出现任何的问题,而且机器不会疲惫会一直二等工作下去。在测试的时候一定要非常专注,时刻关注着测试的结果,一但发现异常及时进行修改,最后,测试完之后的文档应该保存下来,方便以后测试时用到。系统测试的方法有很多,对于本学生宿舍管理系统   的测试,我们使用了测试用得最多的黑盒测试方法来对该系统进行测试。

6.3测试方案

对测试计划的把握是测试方案的重中之重。所有的技术难点应该都被包含在这个测试计划之中。而且我们要保证能与目标形成一致性,以至于能够测试出一些主要存在的错误和一些错误的漏洞。可以完美解决这些问题就只有白盒测试或者黑盒测试[14]

构造测试是白盒测试的另一个名字,了解与分析程序的结构以及性能功用的,从而我们可以得到最终想要的结果并且观察出是不是每一条程序都能得到。

性能测试是黑盒测试别称,程序本身的运作通过程序的进程来观察,主要是看一下程序是不是能够像我们预期的目标那样发展,看一看我们的程序最终能不能完整的得到我们最后想要的功能和储存想得到的数据,到最后看一下我们的这个程序完整性能不能达到要求。

1)模块测试

单元测试就是模块测试,顾名思义就是测试每个模块所承担的功能是否能够实现,这个测试就是为了找出代码在实际的设计运转中某一些小的程序所出现的偏差,很好地改正这些错误,就说明我们模块测试进行很成功过。

2)集成测试:

集成测试就是对系统的测试以及对他子系统的一些性能测试,他检查的事系统的包装程序信息。找出其中的问题。他的优势主要有以下这几点:

软件耗费较少。

可以提前发现端口的错误。

更好的地位系统中错误的位置。

从底部往上面进行的方案针对于偏下层的结构,而中间的结构就采用折中的方法。

3)验收测试:

终于到了结尾性的工作了。就是为了给用户看一下我们的系统功能是否达到了预期的效果。我采用了性能测试也就是黑盒测试对系统进行测试。

其结果是分别是:

有一定的差异在用户的需求。

再者就是结果与之差不了多少。

到了最后了,我们发现的问题都是与用户的需求存在一定的关联。

1、登录测试

 测试点:登录

测试的目标:输入账号密码以及验证码后系统会自动进行验证是否正确。

所用的环境:Windows10IE浏览器。

输入信息:用户名、密码。

步骤:

1)首先我们打来浏览器,进入该系统的登录界面。

2)在进入页面登录部分以后可以进行对用户名、密码进行测试,具体测试输入情况如下表6.1所示。

表6.1 登录测试

情况

用户名输入

密码输入

期望结果

(1)

15546219225

1244566

提示用户名或者密码错误,或账号未经审核

(2)

aaaaa

123456

提示用户名或密码错误,或者账号未经审核

(3)

15546219225

hangguowei

登陆成功

2、教室预约信息测试:

表6.2 教室预约管理测试用例表

用例编号

UC-TEST-003

测试名称

客户信息

前提条件

教室预约管理

步骤

操作描述

数据

期望结果

1

点击教室预约管理查看详情按钮

跳转到教室预约管理详情

2

点击添加按钮

跳转到添加页面

3

选中添加后按钮

跳转到教室预约管理页面

测试说明

用户未登录时到步骤3跳转到登录页面

测试结果

成功

测试人

6.4系统分析

本学生宿舍管理系统设计要求基本都可以达到,此系统具有完整的软件功能,良好的用户界面,能够正确的处理错误信息,而且能够准确的提出错误的种类。但是系统测试时也出现了一些系统的不足和缺陷,所以在今后的日子里我会对其视觉上的不足作出修改,其次系统的代码和数据库出现了非常多的冗余现象,都是因为对编程技术的应用不够熟练,在日后我会加强自己的自身学习和能力,减少这样的冗余现象。

经过对上述的测试结果分析,本学生宿舍管理系统无论是在技术方面,还是操作方面,还是经济方面都是完全可以实行的,并且经过测试,该系统操作简单,所有的功能都可以实现,因此该系统可以满足用户的使用需求,值得被推广。

总体说来,软件通过测试。

结    论

本系统通过对java和Mysql数据库的简介,从硬件和软件两反面说明了学生宿舍管理系统的可行性,本文结论及研究成果如下:实现了java与Mysql相结合构建的学生宿舍管理系统,网站可以响应式展示。通过本次学生宿舍管理系统的研究与实现,我感到学海无涯,学习是没有终点的,而且实践出真知,只有多动手才能尽快掌握它,经验对系统的开发非常重要,经验不足,就难免会有许多考虑不周之处。比如要有美观的界面,更完善的功能,才能吸引更多的用户。

由于在此之前对于java知识没有深入了解,所以从一开始就碰到许多困难,例如一开始的页面显示不规范、数据库连接有问题已经无法实现参数的传递等等,不过通过在网上寻找有关资料以及同学的帮助下最后都得到了解决,在此过程中,我不仅学到了很多知识,也提高了自己解决问题的能力,尤其是学会如何从大量的信息中筛选出所需有用的信息,同时我更加深刻的体会到了,虽然书本上的大部分知识都是有价值,正确的,但实际上每个人编程的思路和对数据处理的方法、思想都是不同的,这就要求我们一定要通过实践才能找到解决问题的方案。在此次毕业设计活动中,我不断的提高了自己,也得到了宝贵的经验,我相信这些对我以后的发展都会有很大帮助。

通过这次学生宿舍管理系统的开发,我参考了很多相关系统的例子,取长补短,吸取了其他系统的长处,逐步对该系统进行了完善,但是该系统还是有很多的不足之处,有待以后进一步学习。

实践证明,学生宿舍管理系统有着非常好的发展前景,经过测试运行,系统各项功能都十分完善,界面漂亮,使用方便,操作容易,在技术理论上已经成熟。

致    谢

大学的学习生活在这个季节将结束,但是在我的生命这仅仅只是一个逗号,我将面对的旅程的另一个的开始。通过这次毕业设计的整个开发过程,从需求分析到具体功能实现,再到最终测试和维护的理解有了很大的进步,让我对系统开发有了更深刻的认识,对我个人的实践能力和解决问题的能力,都有了很大的帮助。这是这次毕业设计最大的收获。

首先要感谢我的指导老师,他在论文写作上,给予了我各种无私的帮助,治学严谨,严格要求,使我获得了很大的收获。老师深厚的理论知识和丰富的实践经验,都深深的影响到我,在这方面,我谨表示衷心的感谢。

其次,我还要对所有的老师和同学表示感谢,他们在我学习的过程中,都积极的提供了很多帮助,无论是专业知识,还是实践操作技能,也能够让我在论文写作中,遇到的一些难题迎刃而解。

最后,对阅读和评审本论文的各位老师表示衷心的感谢!

参考文献 

[1]朱美姣. 一种学生宿舍床用床梯[P]. 湖北省:CN215583637U,2022-01-21.

[2]成昌盛,李如发,江以俊,薛冬,吴栋,周锦标,张伟,缪佳仪,谢振民. 宿舍管理系统[P]. 江苏省:CN215576668U,2022-01-18.

[3]孙妃,李可心,刘楠,王晓兰,孔荣荣,王慧.学生宿舍管理系统的设计与实现[J].江苏科技信息,2021,38(29):40-42+75.

[4]袁森,汤菊芳,刘智慧,王燕. 图书馆基于在线自主学习信息服务学生宿舍学习的创新研究[C]//《新课改教育理论探究》第四辑.,2021:4-5.

[5]蒋晟,陈科.基于SpringBoot的学生宿舍管理系统的设计与实现[J].现代信息科技,2021,5(12):6-9.

[6]Sebong Perigrinus Hermin,Tjitradinata Cynthia,Goldman Roberta E. Promoting COVID-19 prevention strategies in student dormitory setting: A qualitative study.[J]. Journal of American college health : J of ACH,2021:

[7]Iwasaki Shimpei,Franssens Samuel,Dewitte Siegfried,Lange Florian. Evaluating the Effect of Framing Energy Consumption in Terms of Losses versus Gains on Air-Conditioner Use: A Field Experiment in a Student Dormitory in Japan[J]. Sustainability,2021,13(8):

[8]Weimin Zheng. Research on the Grid Management of College Student Dormitories from the Perspective of Social Governance[J]. Advances in Higher Education,2021,5(2):

[9]吴丹林,李梦雅.B/S模式宿舍管理系统设计与实现[J].电脑编程技巧与维护,2021(01):98-99+105.

[10]刘磊. 基于人脸图像识别学生宿舍管理系统的设计与实现[D].武汉邮电科学研究院,2020.

[11]胡橙凤.基于B/S架构高校宿舍管理系统设计与实现[J].电脑知识与技术,2020,16(06):61-62+69.

[12]黄敏.基于B/S架构的学生公寓管理系统设计与实现[J].电脑知识与技术,2019,15(21):72-74.

[13]刘瑜琪,宋嘉祎.基于B/S的高校学生就业管理系统的设计与实现[J].信息与电脑(理论版),2019(09):83-84.

[14]曾玉红.基于B/S高校宿舍管理系统的设计与实现[J].电脑知识与技术,2018,14(36):60-62.

[15]黄敏.基于B/S架构的学生宿舍管理系统数据库设计与实践[J].电脑知识与技术,2018,14(35):83-84+92.

[16] Ling Yun, A method for judging the type of electrical appliances used in student dormitories. Hunan Province, Hunan University of Technology, 2018-06-01.

Get this source code for free, please pay attention to like + private message

Guess you like

Origin blog.csdn.net/Q_3461074420/article/details/126579813