ssm+mysql student dormitory management system-computer graduation project source code 13254

Summary

This paper mainly discusses how to use SSM to develop a student dormitory management system. This system will strictly follow the software development process to carry out work at each stage, using B/S architecture and object-oriented programming ideas for project development. In the introduction, the author will discuss the current background of the student dormitory management system and the purpose of system development. Subsequent chapters will strictly follow the software development process to analyze and design the system at each stage.

The main users of the student dormitory management system are divided into administrators, dormitory administrators and students. The functions include administrator: homepage, system user (administrator, dormitory administrator, student user) module management (dormitory information, dormitory allocation, student Messages, dormitory management messages, sign-in information, notifications and announcements, dormitory building information, student sign-in, item repair) and other functions; dormitory management: student management, dormitory information, dormitory allocation, student messages, dormitory management messages, sign-in information, notifications and announcements, Functions such as dormitory building information, student sign-in, and item repair reports; students: dormitory allocation, student messages, sign-in information, notifications, student sign-in, item repair reports, and other functions. Because the functional module design of this website is relatively comprehensive, the entire information management process of the student dormitory management system can be realized.

The use of this system can realize the informatization of this Java student dormitory management system, which can facilitate administrators to conduct more convenient and faster management, and can improve the management efficiency of the student dormitory management system.

Keywords: SSM; mysql database; student dormitory management system

Abstract

This paper mainly discusses how to use SSM to develop a student dormitory management system. The system will carry out the work at all stages in strict accordance with the software development process, using B/S architecture and object-oriented programming ideas to develop the project. In the introduction, the author will discuss the current background of the student dormitory management system and the purpose of the system development. The following chapters will analyze and design the system at all stages in strict accordance with the software development process.

The main users of the student dormitory management system are divided into administrators, dormitories and students. The implementation functions include administrators: home page, system users (administrators, dormitories, student users) module management (dormitory information, dormitory allocation, student messages, dormitories messages, sign-in information, notice announcements, dormitory building information, student sign-in, goods repair) and other functions; Housing management: student management, dormitory information, dormitory distribution, student message, housing management message, sign-in information, notice announcement, dormitory building information, student sign-in, goods repair and other functions; Students: dormitory distribution, student message, sign-in information, notice announcement, student sign-in, item repair and other functions. Due to the comprehensive design of the functional modules of this website, the information management process of the entire student dormitory management system can be realized.

The use of this system can realize the informatization of this java student dormitory management system, facilitate the administrator to conduct more convenient and quick management, and improve the management efficiency of the student dormitory management system.

Key words: SSM; MySQL database; Student dormitory management system

Table of contents

1 Introduction

1.1 Research background

1.2 Research status

1.3 Research content

2 Introduction to related technologies

2.1HTTP protocol

2.2Java language and JDK development environment

2.3HTML web technology

2.4 Introduction to ssm framework

2.5 Mysql database

3 System analysis

3.1 Feasibility analysis

3.1.1 Technical feasibility

3.1.2 Economic feasibility

3.1.3 Operational feasibility

3.2 System performance analysis

3.3 System function analysis

3.4 System process analysis

3.4.1 Login process

3.4.2 Registration process

3.4.3 Add information process

3.4.4 Deletion of information process

4 System design

4.1 System outline design

4.2 System structure design

4.3 System sequence diagram design

4.3.1 Login module sequence diagram

4.3.2 Add information module sequence diagram

4.4 Database design

4.4.1 Database ER diagram design

4.4.2 Database table design

5 system detailed design

5.1 Administrator function module

5.2 Host management function module

5.3 Student function module

6 system test

6.1 Test definition

6.2 Test purpose

6.3 Test plan

(1) Module test

(2) Integration testing:

(3) Acceptance test:

6.4 System analysis

7 Conclusion

references

Thank you

1  Introduction

1.1 Research background

 With the continuous popularization and development of the Internet, the student dormitory management system has developed rapidly relying on the support of network technology. First, we must start from the actual needs of administrators and students, and develop targeted dormitories by understanding the needs of administrators and students. The management function uses the convenience and speed that the current network brings to administrators and students to adjust the system. The designed system makes it more convenient for students to use. The main purpose of this system is to bring convenience to administrators and students. The administrator can manage the dormitory through the computer without leaving home. At the same time, with the development of e-commerce, the student dormitory management system has been favored by the majority of colleges and universities.

Since the development of the Internet, it has solved many problems that we cannot solve, making our work more convenient and improving our work efficiency. At present, all walks of life are using network information management programs, and different groups of people are also exposed to information management, especially in major e-commerce industries. Through the analysis and summary of the current development of the network environment, the development of a student dormitory management system can change the previous dormitory management methods and change the status of traditional offline dormitory management. Due to the continuous increase in the number of people, the use of traditional dormitory management models is far from satisfactory. In order to meet the needs of users, more and more schools are also opening online management, so developing a student dormitory management system can solve the problem of schools that are not conducive to offline management. At the same time, schools can use the network to manage ball information and design The website ensures the integrity and security of information, so as to improve work efficiency and ensure the safe and normal operation of the system.

1.2 Research status

The development of information technology abroad is many times that of ours. Since the world's first computer was born in the United States in 1946, foreign information technology has been developing rapidly, and some computer application software has also appeared one after another. Software technology It has also been continuously improved and updated. The software industry is already everywhere.

Domestically, the development of information technology in our country started relatively late. Only through gradual and continuous optimization and reform in the later period did our information technology rise to a new stage. Nowadays, software development technology has basically reached the level of independent development of system applications after a lot of research and life practice. Various industries in life have also replaced software operations with traditional recording modes. The software industry is a popular industry right now.

As the number of dormitory managers continues to increase, so does the student dormitory management system. Due to the increase in dormitory information, the student dormitory management system can complete planning and management of dormitory management, and the school also completes daily management through the network system. There are various needs in information, so the development of online student dormitory management system has brought enough convenience to people. People use the system to meet their needs in life. Therefore, due to the increase in information, the information processing system has also increased, through Network to meet the needs of modern people. This development and design is mainly to implement a student dormitory management system, combined with Java technology and mysql database design, to make up for the shortcomings of the current online ball shopping website, to develop a convenient and practical student dormitory management system, and designed The program has the characteristics of clean interface and powerful functions. From an overall perspective, the design of the student dormitory management system solves the problem of scattered information and is not conducive to dormitory management. The system is implemented and can be put into the real environment, which not only solves the above problems and issues to make information management more standardized.

1.3 Research content

The development and design of this student dormitory management system is based on the actual situation of the user, a detailed analysis of the system's needs is carried out, and then the overall design of the system is carried out. Finally, through testing, the system design is made more complete and all functions in the system can be realized. Function, before starting to write the paper, I personally went to the library to borrow relevant books, mysql database books and other programming books. Then, for the student dormitory management system I developed, I searched the Internet for many systems that others had built, and based on their design results, I Carry out more detailed system design for your own system, list all the functional results in the system one by one, then conduct demand analysis, and finally code all functional modules, and finally complete the overall system test to achieve normal operation of the system.

The paper written this time contains 6 parts, the specific contents are as follows:

Part One Introduction: The article mainly elaborates on the necessity of developing this system from the background of the subject and the current research status.

Part 2 Related Technologies: Various technologies used in system development are roughly introduced.

Part 4 System Analysis: Conduct a detailed analysis of the feasibility of the system and all functional requirements to see whether the system is possible to develop.

The fourth part, system design: functional module design and database design, are represented by special tables and pictures.

Part 5: System Implementation: Interface display of the main functional modules of the system.

Part Six System Testing: Test whether each function of the system can operate normally and meet people's needs.

2 Introduction to related technologies

2.1 HTTP protocol

Hypertext Transfer Protocol (HTTP) is a collaborative and distributed communication protocol that takes the exchange of information on the World Wide Web as a prerequisite. HTTP is an international standard indicator of IEIF. In the formulation and implementation of relevant standards, W3C actively participates in it and plays an irreplaceable role. It can use hypertext markup language to transfer documents between servers and browsers. HTML is a markup language for structuring documents. These documents will include links to relevant information. Users only need to click on one of the links to access multimedia objects and images, and at the same time obtain additional information about the link item.

2.2 Java language and JDK development environment 

Java is a programming language launched by Sun Corporation in the United States. It can be applied on multiple platforms and has good compatibility. In turn, it is widely used in data centers, personal PCs, technology supercomputers and other platforms with its own advantages. It has Currently the largest professional community of developers.

JDK is a brand new product launched by the American Sun Company for Java developers. Without JDK, the installed Java program will not be able to run.

2.3 HTML web technology

HTML is a commonly used language for making web pages, and it is generally used to make static pages. Its commands can reflect text information, link information, graphic information, table information, etc. Now it is generally accepted by the public and widely used on the Internet.

2.4  Introduction to ssm framework

The SSM (Spring+SpringMVC+MyBatis) framework set is integrated by the two open source frameworks Spring and MyBatis (SpringMVC is part of Spring). It is often used as a framework for web projects with relatively simple data sources.

1.6.1 Spring
Spring is like a big factory that assembles beans in the entire project. In the configuration file, you can specify the use of specific parameters to call the constructor method of the entity class to instantiate the object. It can also be called the glue in the project.
The core idea of ​​Spring is IoC (Inversion of Control), which means that programmers no longer need to explicitly `new` an object, but let the Spring framework do it all for you.
1.6.2 SpringMVC
SpringMVC intercepts user requests in the project. Its core Servlet, DispatcherServlet, assumes the responsibilities of intermediary or front desk, and matches user requests to the Controller through HandlerMapping. The Controller is the specific operation performed in response to the request. SpringMVC is equivalent to struts in the SSH framework.
1.6.3 mybatis
mybatis is an encapsulation of jdbc, which makes the underlying operations of the database transparent. The operations of mybatis are centered around a sqlSessionFactory instance. Mybatis is associated to the Mapper file of each entity class through the configuration file. The Mapper file is configured with the SQL statement mapping required for each class to the database. Every time you interact with the database, get a sqlSession through sqlSessionFactory, and then execute the sql command.

The page sends a request to the controller, the controller calls the business layer processing logic, the logic layer sends a request to the persistence layer, the persistence layer interacts with the database, and then returns the result to the business layer, the business layer sends the processing logic to the controller, and the controller then Call the view to display the data.

2.5 Mysql database

After many updates, Mysql has become very rich and complete in terms of functionality. It has undergone relatively large updates from version 4 to version 5, and has achieved good practical application results in actual commercial use. The latest version of Mysql supports information compression and encryption, which can better meet the needs for 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 have become 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 application maps. The powerful backup function also ensures that users will feel more at ease during use. At the same time, the supported Office features also support users’ self-installation and use. The display form of information has also been greatly updated. Two very commonly used display areas have been added. One is the information area, where tables and texts have been classified, and the interface display 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 pieces of information at the same time, which brings great convenience to users' actual use.

In the actual implementation process of the student dormitory management system designed in this article, the main reason for finally choosing the Mysql database is that there will be a large number of frequent database operations in the application and development process of the enterprise's application system, and the security of the data The requirements are also very high. Based on these factors, Mysql, which has a relatively high security factor, was finally chosen to store the background data of the student dormitory management system.

3 System analysis

3.1 Feasibility analysis

At the beginning of system development, system feasibility analysis must be carried out. The purpose of this is to solve the biggest problem with the minimum cost. Once the program development meets the needs of users, the benefits will be many. Next, we will consider whether this system is worth developing from technical, operational and economic aspects.

3.1.1 Technical feasibility

This student dormitory management system is developed and designed using the SSM framework, JAVA programming language and mysql database. As a computer major student, I have been exposed to a lot of knowledge about programming during school, including various programming software. How well I understand them It is also relatively systematic, so I still have a certain degree of confidence in technology development.

3.1.2 Economic feasibility

When I designed the system, I mainly started with cost savings, and then designed the specific system. During the system design process, all the tools and technical support used were free, so there was no need to incur any cost. The system can be designed. All resources used are free and can be downloaded and used as long as there is an Internet connection. There is no need to pay corresponding fees, so the project is completely feasible in economic terms.

3.1.3 Operational feasibility

I am a student myself and have insufficient experience in program development. The interface design should not be too complicated. It should be simple and beautiful, easy to operate, and should not make users feel unsmooth. Once the user enters the operation interface, there will be corresponding prompts on the interface. Following the operation prompts, the corresponding functional operation module can be found, which can be used by the user without training.

From the feasibility analysis of the above parts, it can be concluded that the student dormitory management system developed this time has no major problems in development and is worthy of development.

3.2 System performance analysis

(1) System response efficiency: The page response time should be within 3 seconds, no longer than 4 seconds, and support at least 10,000 people online at the same time on all systems.

(2) Simple and clear interface: The system interface is required to be simple and clear, easy to operate, and consistent with user operating habits.

(3) High storage: Because there is a lot of information that needs to be stored in the student dormitory management system, there are great requirements for the storage capacity of the system. It requires the support of a powerful database to ensure that all information is safe and stable. for storage.

(4) Ease of learning: The system must be easy to operate and easy to use. There are not many complicated operations and only simple learning is required to operate the system.

(5) Stability requirements: The developed student dormitory management system requires stable operation and no unclear interface or blurred fonts during operation.

(6) Stability: The developed student dormitory management system requires stable operation and no unclear interface or blurred fonts during operation.

3.3 System function analysis

This student dormitory management system mainly includes four functional modules, namely administrator, dormitory management and student modules.

(1) Administrator module: The core user in the system is the system administrator. After the administrator logs in, he manages the system through the administrator menu. The main functions are: home page, system user (administrator, dormitory staff, student users) module management (dormitory information, dormitory allocation, student messages, dormitory messages, sign-in information, notifications and announcements, dormitory building information, student sign-in, item repairs) ) and other functions. The administrator use case diagram is shown in Figure 3-1.

Figure 3-1 Administrator use case diagram

(2) Students: Dormitory allocation, student messages, sign-in information, notifications and announcements, student sign-in, item repair management and other functions. The student use case is shown in Figure 3-2.

Figure 3-2 Student use case diagram

(3) Dormitory management: student management, dormitory information, dormitory allocation, student messages, dormitory messages, sign-in information, notifications and announcements, dormitory building information, student sign-in, item repairs and other functions. The host management use case diagram is shown in Figure 3-3.

Figure 3-3 Host management use case diagram

3.4 System process analysis

3. 4.1 Login process

The login module mainly meets the permission login of administrators and users. The user login flow chart is shown in Figure 3-4.

Figure 3-4 Login flow chart

3.4.2 Registration process

Users who do not have an account can enter the registration interface to register. The user registration flow chart is shown in Figure 3-5.

Figure 3-5 Registration flow chart

3. 4.3 Add information process

When the user adds information, the information number is automatically generated. The system will verify the added information. If the verification passes, it will be added to the database. If the information is added successfully, the addition will fail. The process of adding information is shown in Figure 3-6.

Figure 3-6 Add information flow chart

3. 4.4 Deletion of information process

The user can select the information to be deleted and perform the information deletion operation. When deleting the information, the system prompts whether you are sure to delete the information. If yes, the information is deleted successfully and the system database deletes the information. The flow chart of deleting information is shown in Figure 3-7.

Figure 3-7 Deletion information flow chart

4 system design

4.1 System outline design

This student dormitory management system chooses two modes: B/S structure (Browser/Server, browser/server structure) and Web service-based model. It is suitable for operation on the Internet. As long as the user can connect to the Internet, the system can be operated at any time and anywhere. The system working principle diagram is shown in Figure 4-1:

Figure 4-1 System working principle diagram

4.2 System structure design

The entire system is composed of multiple functional modules. All functional modules should be listed one by one, and then functional design should be carried out one by one so that each module has a corresponding functional design, and then the overall system design should be carried out. .

The structure diagram of this student dormitory management system is shown in Figure 4-2 .

Figure 4-2 System functional structure diagram

4.3 System sequence diagram design

4.3.1 Login module sequence diagram

The login module mainly meets the permission login of administrators and users . The login module sequence diagram is shown in Figure 4-3 .

Figure 4-3 Login sequence diagram

4.3.2 Add information module sequence diagram

Administrators and users can add information after logging in. The sequence diagram of the add information module is shown in Figure 4-4 .

Figure 4-4 Sequence diagram for adding information

4.4 Database design

A good database can be related to the quality of program development. Database design is inseparable from the design of table structures, the connections between tables, and the content of data tables that need to be designed for system development. During the database design, the database should be developed and designed in a targeted manner based on the actual situation [12].

4.4.1 Database ER diagram design

This student dormitory management system uses the mysql database, which is fast for data storage. Because the student dormitory management system is mainly about the management of information, and there is a lot of information content. This requires a good database design, and the classification must be clear. When adding information, the information is too confusing. A well-designed database must first clearly express the relationship between various entities. The ER diagram of the system is shown below:

(1)  The attribute diagram of the administrator login information entity is shown in Figure 4-5 below.

Figure 4-5 Administrator login information entity attribute diagram

(2) Student registration entity attributes are shown in Figure 4-6 below

Figure 4-6 Student registration entity attribute diagram

3. The entity diagram of repair information management is shown in Figure 4-7:

Figure 4-7 Repair information management entity diagram

4.4.2 Database table design

Convert ER diagram of database conceptual design into relational database. In a relational database, data relationships are composed of data tables, but the structure of the table is represented by the fields of the table.

dormitory_allocation

Field Name

type

length

not null

primary key

Field description

dormitory_allocation_id

int

11

yes

primary key

Dormitory assigned ID

building

varchar

64

no

building

dormitory_no

varchar

64

no

Dormitory number

student

int

11

no

student

bed

varchar

64

no

bed

check_in_time

date

0

no

check in time

housemaster

int

11

no

Hostel management

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

dormitory_building_information

Field Name

type

length

not null

primary key

Field description

dormitory_building_information_id

int

11

yes

primary key

Dormitory building information ID

building

varchar

64

no

building

number_of_layers

varchar

64

no

Number of layers

total_number_of_dormitory

varchar

64

no

Total number of dormitories

housemaster

int

11

no

Hostel management

type

varchar

64

no

type

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

dormitory_information

Field Name

type

length

not null

primary key

Field description

dormitory_information_id

int

11

yes

primary key

Dormitory information ID

building

varchar

64

no

building

dormitory_no

varchar

64

no

Dormitory number

number_of_beds

int

11

no

number of beds

number_of_people_checked_in

int

11

no

Number of people who have checked in

empty_bed

varchar

64

no

Empty bed

housemaster

int

11

no

Hostel management

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

housekeeper

Field Name

type

length

not null

primary key

Field description

housekeeper_id

int

11

yes

primary key

Resident ID

destination_job_number

varchar

64

no

Resident management number

name_of_the_housekeeper

varchar

64

no

Host name

examine_state

varchar

16

yes

Approval Status

recommend

int

11

yes

Intelligent Recommendation

user_id

int

11

yes

User ID

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

item_repair

Field Name

type

length

not null

primary key

Field description

item_repair_id

int

11

yes

primary key

Item Repair ID

building

varchar

64

no

building

dormitory_no

varchar

64

no

Dormitory number

student

int

11

no

student

housemaster

int

11

no

Hostel management

item_name

varchar

64

no

Item Name

repair_content

text

0

no

Repair content

examine_state

varchar

16

yes

Approval Status

examine_reply

varchar

16

no

moderation reply

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

leave_a_message

Field Name

type

length

not null

primary key

Field description

leave_a_message_id

int

11

yes

primary key

Hostel message ID

housemaster

int

11

no

Hostel management

name_of_the_housekeeper

varchar

64

no

Host name

theme

varchar

64

no

theme

related_pictures

varchar

255

no

related pictures

message_content

text

0

no

Message content

examine_state

varchar

16

yes

Approval Status

examine_reply

varchar

16

no

moderation reply

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

notice_announcement

Field Name

type

length

not null

primary key

Field description

notice_announcement_id

int

11

yes

primary key

Notification announcement ID

title

varchar

64

no

title

publisher

varchar

64

no

publisher

published_on

date

0

no

release time

relevant_attachments

varchar

255

no

Relevant attachments

content

text

0

no

content

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

sign_in_information

Field Name

type

length

not null

primary key

Field description

sign_in_information_id

int

11

yes

primary key

Sign-in information ID

building

varchar

64

no

building

dormitory_no

varchar

64

no

Dormitory number

student

int

11

no

student

bed

varchar

64

no

bed

housemaster

int

11

no

Hostel management

sign_in_name

varchar

64

no

Sign-in name

sign_in_time

datetime

0

no

Check-in time

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

student_message

Field Name

type

length

not null

primary key

Field description

student_message_id

int

11

yes

primary key

Student message ID

student

int

11

no

student

student_name

varchar

64

no

student name

housemaster

int

11

no

Hostel management

theme

varchar

64

no

theme

related_pictures

varchar

255

no

related pictures

message_content

text

0

no

Message content

examine_state

varchar

16

yes

Approval Status

examine_reply

varchar

16

no

moderation reply

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

student_sign_in

Field Name

type

length

not null

primary key

Field description

student_sign_in_id

int

11

yes

primary key

Student sign-in ID

building

varchar

64

no

building

dormitory_no

varchar

64

no

Dormitory number

student

int

11

no

student

bed

varchar

64

no

bed

housemaster

int

11

no

Hostel management

sign_in_name

varchar

64

no

Sign-in name

sign_in_photo

varchar

255

no

Check-in photo

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

student_users

Field Name

type

length

not null

primary key

Field description

student_users_id

int

11

yes

primary key

Student User ID

student_number

varchar

64

no

student ID

student_name

varchar

64

no

student name

gender

varchar

64

no

gender

class_name

varchar

64

no

class name

examine_state

varchar

16

yes

Approval Status

recommend

int

11

yes

Intelligent Recommendation

user_id

int

11

yes

User ID

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

5 system detailed design

5.1 Administrator function module

The administrator logs in by filling in the user, password, permissions and verification code entered during registration, as shown in Figure 5-1.

Figure 5-1 Administrator login interface diagram

The login 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("[Execute login interface]");

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

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

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

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

        List resultList = null;

        QueryWrapper wrapper = new QueryWrapper<User>();

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

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

            map.put("username", username);

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

        }

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

            map.put("email", email);

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

        }

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

            map.put("phone", phone);

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

        }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.selectBaseList(userGroupService.select(groupMap, new HashMap<>()));

        if (groupList.size()<1){

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

        }

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

        //查询用户审核状态

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

            String res = service.selectExamineState(userGroup.getSourceTable(),byUsername.getUserId());

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

        }

}

    public String select(Map<String,String> query,Map<String,String> config){

        StringBuffer sql = new StringBuffer("select ");

        sql.append(config.get(FindConfig.FIELD) == null || "".equals(config.get(FindConfig.FIELD)) ? "*" : config.get(FindConfig.FIELD)).append(" ");

        sql.append("from ").append("`").append(table).append("`").append(toWhereSql(query, "0".equals(config.get(FindConfig.LIKE))));

        if (config.get(FindConfig.GROUP_BY) != null && !"".equals(config.get(FindConfig.GROUP_BY))){

            sql.append("group by ").append(config.get(FindConfig.GROUP_BY)).append(" ");

        }

        if (config.get(FindConfig.ORDER_BY) != null && !"".equals(config.get(FindConfig.ORDER_BY))){

            sql.append("order by ").append(config.get(FindConfig.ORDER_BY)).append(" ");

        }

        if (config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE))){

            int page = config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE)) ? Integer.parseInt(config.get(FindConfig.PAGE)) : 1;

            int limit = config.get(FindConfig.SIZE) != null && !"".equals(config.get(FindConfig.SIZE)) ? Integer.parseInt(config.get(FindConfig.SIZE)) : 10;

            sql.append(" limit ").append( (page-1)*limit ).append(" , ").append(limit);

        }

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

        return sql.toString();

}

    public List selectBaseList(String select) {

        List<Map<String,Object>> mapList = baseMapper.selectBaseList(select);

        List<E> list = new ArrayList<>();

        for (Map<String,Object> map:mapList) {

            list.add(JSON.parseObject(JSON.toJSONString(map),eClass));

        }

        return list;

}

管理员登录进入学生宿舍管理系统可以查看系统首页、系统用户(管理员、宿管人员、学生用户)模块管理(宿舍信息、宿舍分配、学生留言、宿管留言、签到信息、通知公告、宿舍楼信息、学生签到、物品报修)等信息,如图5-2所示。

图5-2管理员功能界面图

管理员功能界面代码如下:

  public Map<String, Object> error(Integer code, String message) {

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

        map.put("error", new HashMap<String, Object>(4) { {

            put("code", code);

            put("message", message);

        }});

        return map;

}

用户管理,在用户管理页面中可以添加昵称、用户名、学生学号、学生姓名、学生性别、学生年龄等信息,还可以根据需要在学生列表查询进行修改或删除等详细操作,如图5-3所示。

图5-3用户管理界面图

用户管理代码如下:

/**

 * 用户组:用于用户前端身份和鉴权(UserGroup)表实体类

 *

 * @author xxx

 *@since 202X-XX-XX

 */

@TableName("user_group")

@Data

@EqualsAndHashCode(callSuper = false)

public class UserGroup implements Serializable {

    private static final long serialVersionUID = 968356951391304707L;

    /**

     * 用户组ID:[0,8388607]

     */

    @TableId(value = "group_id", type = IdType.AUTO)

    private Integer groupId;

    /**

     * 显示顺序:[0,1000]

     */

    @TableField(value = "display")

    private Integer display;

    /**

     * 名称:[0,16]

     */

    @TableField(value = "name")

    private String name;

    /**

     * 描述:[0,255]描述该用户组的特点或权限范围

     */

    @TableField(value = "description")

    private String description;

    /**

     * 来源表:

     */

    @TableField(value = "source_table")

    private String sourceTable;

    /**

     * 来源字段:

     */

    @TableField(value = "source_field")

    private String sourceField;

    /**

     * 注册位置:

     */

    @TableField(value = "register")

    private String register;

    /**

     * 创建时间:

     */

    @TableField(value = "create_time")

    private Timestamp createTime;

    /**

     * 更新时间:

     */

    @TableField(value = "update_time")

    private Timestamp updateTime;

}

    /**

     * 所在用户组:[0,32767]决定用户身份和权限

     */

    @TableField(value = "user_group")

private String userGroup;

/**

 * 用户组:用于用户前端身份和鉴权(UserGroup)表控制层

 *

 */

@RestController

@RequestMapping("user_group")

public class UserGroupController extends BaseController<UserGroup, UserGroupService> {

    /**

     * 服务对象

     */

    @Autowired

    public UserGroupController(UserGroupService service) {

        setService(service);

    }

}

宿管用户添加,在宿管用户页面中可以添加宿管信息账号、昵称、手机认证、宿管工号、宿管年龄、手机号码等信息,还可以根据需要在宿管查询页面进行修改或删除等详细操作,如图5-4所示。

图5-4宿管添加界面图

宿舍管理,在宿舍管理页面中可以添加宿舍名称、宿舍号、楼栋、单元、宿舍类型、入住人数等信息,还可以根据需要进行修改或删除等操作,如图5-5所示。

图5-5宿舍管理界面图

宿舍楼信息,在宿舍楼信息查询页面中可以添加楼栋、层数、总宿舍数、宿管、类型等信息,还可以根据需要进行修改或删除等操作,如图5-6所示。

图5-6宿舍楼信息界面图

宿舍分配信息管理,在宿舍分配管理页面可对宿舍名称、宿舍号、楼栋、单元、宿舍类型、学生学号、学生姓名、床位数进行详情或分配等详细操作,如图5-7所示。

图5-7宿舍分配信息界面图

学生留言,在学生留言页面中可以查看学生学号、学生姓名、宿管、主题、相关图片、留言内容等信息进行查看、回复、审核或详细等操作,如图5-8所示。

图5-8学生留言界面图

通知公告,在通知公告页面中可以标题、发布人、发布时间、相关附件、内容等信息进行编辑删除或详细等操作,如图5-9所示。

图5-9通知公告界面图

5.2宿管功能模块

宿管进入系统可查看管理功能分为学生管理、宿舍信息、宿舍分配、学生留言、宿管留言、签到信息、通知公告、宿舍楼信息、学生签到、物品报修。如图5-10所示。

图5-10宿管功能界面图

宿舍管理,宿管员可在宿舍管理页面添加宿舍名称、宿舍号、楼栋、床位数、宿舍类型、入住人数、宿管等,如图5-11所示。

图5-11宿舍管理界面图

签到信息,签到信息登记页面可查看楼栋、宿舍号、学生、床位、宿管、签到名称等信息进行删除或详细等操作,如图5-12所示。

图5-12签到信息管理界面图

5.3学生功能模块

学生登录系统功能页面可查询宿舍分配、学生留言、签到信息、通知公告、学生签到、物品报修等功能。如图5-13所示。

图5-13学生功能界面图

物品报修信息,在物品报修页面中可以填写学生、宿管、物品名称、报修内容等操作。如图5-14所示。

图5-14物品报修管理界面图

6 系统测试

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

6.1 测试定义

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

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

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

登陆成功

6.4系统分析

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

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

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

7 结论

本文研究了学生宿舍管理系统的设计与实现,在文章开端首先对个研究背景、研究现状和研究内容作了简单的介绍,然后通过系统分析,引申出本系统研究的主要内容。

通过对java技术和mysql数据库的简介,从硬件和软件两反面说明了学生宿舍管理系统的设计与实现的可行性,本文结论及研究成果如下:实现了java与mysql相结合构建的学生宿舍管理系统,通过本次学生宿舍管理系统的设计与实现的研究与实现,我感触到学习一门新技术,最重要的是实践,只有多动手才能尽快掌握它,一个系统的开发,经验是最重要的,经验不足,就难免会有许多考虑不周之处。要想吸引更多的用户,系统的界面必须要美观、有特色、友好,功能要健全。

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

通过这次学生宿舍管理系统的开发,让我学到了更多的知识,同时通过这次系统的设计也让我明白了自己在哪方面有不足,以后加以学习争取可以开发住更多有用的适用的系统软件,本次系统的设计提高了我的编程水平,为了我今后系统的开发打下了结实的基础。

参考文献

[1]狄喜凤.基于学生信息管理系统的软件测试策略研究[J].电子技术与软件工程,2021(02):82-83.

[2]张嘉豪,赵亮,翁铭隆,张华俊,李文欣.基于SSM+SSM技术实现服务器监控的研究[J].科学技术创新,2020(33):101-102.

[3]郭俊杰. 基于SSM的线下商圈服务管理系统设计与实现[D].桂林理工大学,2020.

[4]康军林.辽宁省河长制信息管理系统建设的实践与思考[J].水资源开发与管理,2020(06):80-84.

[5]沈世平,林平,赵亚南,谢振平,刘渊.无锡河长制综合信息平台建设与思考[J].江苏水利,2020(06):25-31.

[6]唐湘茜,张俊,王源楠,邓晶.河长制信息管理系统[J].水利水电快报,2020,41(04):6-7.

[7]周彪. 基于SSM框架的Java后端代码生成器的设计与实现[D].大连理工大学,2020.

[8]贾少燕, 基于互联网+的智慧河长制信息管理系统研发. 河南省,河南省水利勘测设计研究有限公司,2020-04-02.

[9]邹秀清,罗得寸,林平,沈世平,谢振平,王玉珏,丁勇.基于区块链的河长制水质信息存证系统[J].应用科学学报,2020,38(01):65-80.

[10]Yuxiang Hou. The design and implementation of the framework for Spring+SpringMVC+MyBatis in the development of Web application[A]. Institute of Management Science and Industrial Engineering.Proceedings of 2019 4th International Industrial Informatics and Computer Engineering Conference(IIICEC 2019)[C].Institute of Management Science and Industrial Engineering:计算机科学与电子技术国际学会(Computer Science and Electronic Technology International Society),2019:6.

[11]马强.河长制背景下的智慧信息管理平台建设探究[J].地下水,2019,41(05):155-156.

[12]张爽.铁岭市河长制信息管理平台的研发与应用[J].吉林水利,2019(07):60-62.

[13]夏添,刘发永,姜跃昆,马色伍,陈雨.成都市河长制管理信息系统的设计与实践[J].四川水利,2019,40(03):113-118.

[14]江金娜. 高校成人教育学生信息管理系统的分析与设计[D].广东工业大学,2019.

[15]王禹杰. “互联网 智慧河长”信息管理系统设计与实现[D].合肥工业大学,2019.

[16]阚琳.整体性治理视角下河长制创新研究——以江苏省为例[J].中国农村水利水电,2019(02):39-43.

[17]陈志忠.数据挖掘聚类算法在学生信息管理系统中的应用[J].电脑知识与技术,2017,13(24):21-22.

[18]王微漪. 基于Web的高职院校学生信息管理系统的设计与实现[D].北京工业大学,2017.

[19]徐波. 数字化校园建设中学生信息管理系统的设计与实现[D].湖北工业大学,2016.

[20]赵嫚.学生宿舍信息管理系统的设计与应用[J].科技展望,2016,26(27):5+66.

谢辞

本次毕业设计圆满的结束了,通过这次毕业设计我学到了很多的知识,也提高了我软件开发的能力,在系统开发设计的过程中,出现了很多的问题,但是通过老师和同学们的帮助,最后所有的问题都得到了解决,因此我要感谢在此过程中对我帮助的老师和同学们,感谢指导老师帮助我选课题,给我做详细的讲解,给我提供设计所需要的各种设备,也经常询问我进度与成果,再有难点的时候给我解决思路,帮助我顺利完成。没有他的指导,也不会有我今天所展现出的成果。

首先我要感谢我的指导老师,指导老师在教学任务繁忙的情况下,抽出时间帮助我纠正我在设计当中出现的问题,并耐性地为我的论文作校正,是他的定期检查和指导使得我们的毕业设计高质量完成。他在我整个课题开发和设计的过程中,为程序的设计、框架的设计、代码的撰写方面以及论文框架的设计提供了很多宝贵的意见,并且为我推荐了许多有用的资料和文献,他的指导和建议使我受益匪浅,有了指导老师的辅导和指点,我论文才能够顺利完成。老师的认真负责的工作态度和治学严谨之道使我们这些即将踏入社会的毕业生受益匪浅。

然后要感谢我的同学们,感谢大家对我这次毕业设计的帮助, 也感谢大家在大学生活中对我的陪伴,使得我的大学生活过的很快乐。

另外,我还要感谢父母,感谢一直以来对我的支持,让我能够顺利的完成我的学业,没有你们也就没有我的今天,感谢你们无私的付出,未来我一定会报答你们的。

最后,感谢在座的所有参加我论文答辩的老师们,感谢大家的聆听,你们辛苦了。

免费领取项目源码,请关注❥点赞收藏并私信博主,谢谢~

Guess you like

Origin blog.csdn.net/vx1_Biye_Design/article/details/133161528