Graduation project based on springboot student dormitory management system - with source code 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 Introduction to key technologies 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 feasibility6

3.1.4 Legal feasibility7

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 homepage 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 method 33

6.3 Test analysis 33

Conclusion 35

Thanks 36

Reference 37

1 Overview

1.1 Subject background and significance

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 very troublesome. 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 paper

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 Introduction of key technologies

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 the requirements, even without clear communication with the customers. As a result, when the system is accepted, they need to be changed again, 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 process

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

管理员可以对信息等进行信息的删除,对要删除的信息进行选中后,点击删除按钮,系统会询问是否确定,若点击确定,则系统会删除掉选中的信息,并在数据库内对信息进行删除,删除信息流程图如图3-6所示。

图3-6 删除信息流程图

3.3系统用例分析

管理员用例图

系统中的核心用户是系统管理员,管理员登录后,通过管理员菜单来管理后台系统。主要功能有:首页、用户管理(管理员、学生、宿管人员)更多管理(宿舍信息、宿舍报修、宿舍分配、宿舍通知)等功能。管理员用例如图3-7所示。

图3-7 管理员用例图

学生用例图

学生进入系统可以进行首页、宿舍分配、宿舍报修、宿舍通知、个人中心等功能操作。学生用例如图3-8所示。

图3-8学生用例图

4 系统设计

4.1 系统概述

进过系统的分析后,就开始记性系统的设计,系统设计包含总体设计和详细设计。总体设计只是一个大体的设计,经过了总体设计,我们能够划分出系统的一些东西,例如文件、文档、数据等。而且我们通过总体设计,大致可以划分出了程序的模块,以及功能。但是只是一个初步的分类,并没有真正的实现。

整体设计,只是一个初步设计,而且,对于一个项目,我们可以进行多个整体设计,通过对比,包括性能的对比、成本的对比、效益的对比,来最终确定一个最优的设计方案,选择优秀的整体设计可以降低开发成本,增加公司效益,从这一点来讲,整体设计还是非常重要的。

学生宿舍管理系统工作原理图如图4-1所示:

图4-1 系统工作原理图

4.2 系统结构设计

系统架构图属于系统设计阶段,系统架构图只是这个阶段一个产物,系统的总体架构决定了整个系统的模式,是系统的基础。学生宿舍管理系统的整体结构设计如图4-2所示。

图4-2 系统结构图

4.3数据库设计

数据库是信息系统的基础和核心。数据库设计的好坏直接影响到信息系统开发的成败。创建数据库表首先确定实体的属性和实体之间的关系。根据关系创建一个数据表。

4.3.1实体ER图

数据库是整个软件编程中最重要的一个步骤,对于数据库问题主要是判定数据库的数量和结构公式的创建。展示系统使用的是Mysql进行对数据库进行管理,进行保证数据的安全性、稳定性等。

概念模型的设计是为了抽象真实世界的信息,并对信息世界进行建模。它是数据库设计的强大工具。数据库概念模型设计可以通过E-R图描述现实世界的概念模型。系统的E-R图显示了系统中实体之间的链接。而且Mysql数据库是自我保护能力比较强的数据库,下图主要是对数据库实体的E-R图:

1.宿舍报修信息实体图如图4-3所示:

图4-3宿舍报修信息实体图

2.宿舍分配信息实体图如图4-4所示:

图4-4宿舍分配实体图

4.3.3 数据库表设计

数据库的表信息属于设计的一部分,下面介绍数据库中的各个表的详细信息。

student表:

名称

类型

长度

不是null

主键

注释

student_id

int

11

学生ID

gender

varchar

64

性别

age

varchar

64

年龄

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

user_id

int

11

用户ID

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

housekeeping_personnel表:

名称

类型

长度

不是null

主键

注释

housekeeping_personnel_id

int

11

宿管人员ID

gender

varchar

64

性别

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

user_id

int

11

用户ID

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

dormitory_repair表

名称

类型

长度

不是null

主键

注释

dormitory_repair_id

int

11

宿舍报修ID

building

varchar

64

楼栋

floor

varchar

64

楼层

room_number

varchar

64

房号

repair_type

varchar

64

报修类型

housekeeping_personnel

int

11

宿管人员

student

int

11

学生

repair_reason

text

0

报修原因

examine_state

varchar

16

审核状态

examine_reply

varchar

255

审核回复

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

dormitory_notice表:

名称

类型

长度

不是null

主键

注释

dormitory_notice_id

int

11

宿舍通知ID

number

varchar

64

编号

notification_type

varchar

64

通知类型

notice_title

varchar

64

通知标题

housekeeping_personnel

int

11

宿管人员

notice_content

longtext

0

通知内容

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

dormitory_information表:

名称

类型

长度

不是null

主键

注释

dormitory_information_id

int

11

宿舍信息ID

building

varchar

64

楼栋

floor

varchar

64

楼层

room_number

varchar

64

房号

room_type

varchar

64

房间类型

number_of_beds

int

11

床位数

housekeeping_personnel

int

11

宿管人员

remarks

text

0

备注

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

dormitory_allocation表:

名称

类型

长度

不是null

主键

注释

dormitory_allocation_id

int

11

宿舍分配ID

building

varchar

64

楼栋

floor

varchar

64

楼层

room_number

varchar

64

房号

room_type

varchar

64

房间类型

bed_number

varchar

64

床位号

seize_a_seat

int

11

占位

student_account

int

11

学生账号

housekeeping_personnel

int

11

宿管人员

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

5系统详细设计

5.1登录模块的实现

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

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

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

输入:用户名和密码。

处理:

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

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

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

输出:是否成功的信息。

登录流程图如下所示。

图5-1登录流程图

系统登录界面如下所示。

图5-1管理员登录界面图

管理员登录关键代码如下所示。

/**

* 登录

* @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、登录测试

测试点:登录

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

所用的环境:Windows10和IE浏览器。

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

步骤:

(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]凌云, 一种学生宿舍用电器类型判断方法. 湖南省,湖南工业大学,2018-06-01.

点赞+收藏+关注 → 私信领取本源代码、数据库

Guess you like

Origin blog.csdn.net/DZBS2000/article/details/129037459