(with source code) ssm laboratory safety management system graduation project 031527

Laboratory safety management system based on SSM WeChat applet

Summary

With the rapid development of my country's economy, people's demand for mobile phones is increasing, and various mobile phone software are also being widely used, but for data information management of mobile phones, various software for mobile phones are also loved by users, WeChat The small program laboratory safety management system is widely used by users. In order to facilitate users to manage the data information of the WeChat small program laboratory safety management system at any time, a management system based on the WeChat small program laboratory safety management system is specially developed. .

The laboratory safety management system of the WeChat applet mainly considers the functions to be realized by the system in detail, and designs the interface after determining the functions to be realized. In the process, it is also necessary to consider how to better implement the functions and pages. The combination of , it is convenient for users to find the information they need easily and clearly, as well as the operability of the system platform in the later stage, and the technical development can be carried out through a detailed understanding of the information content.

The development of the laboratory safety management system of the WeChat applet utilizes existing mature technical references, uses the source code as a template, and combines the analysis function adjustment with the actual needs of the laboratory safety management system management of the WeChat applet. Procedure for the use of laboratory safety management system management. 

Key words: laboratory safety management system of WeChat applet; JAVA

Laboratory safety management system based on SSM wechat applet

Abstract

With the rapid development of China's economy, people's demand for mobile phones is increasing, and various mobile phone software are also widely used. However, for mobile phone data information management, various mobile phone software are also loved by users. The laboratory security management system of wechat applet is widely used by users. In order to facilitate users to manage the data information of the laboratory security management system of wechat applet at any time, The management system of laboratory safety management system based on wechat applet is developed.

The laboratory security management system of wechat applet mainly considers the functions to be realized by the system in detail, and designs the interface after determining the functions to be realized. In the middle, it also considers how to better combine the functions and pages, so that users can easily and clearly find the information they need, as well as the operability of the system platform in the later stage, Develop technology through detailed understanding of information content.

The development of the laboratory safety management system of wechat applet makes use of the existing mature technology reference, takes the source code as the template, analyzes the function adjustment and the actual needs of the laboratory safety management system management of wechat applet, and discusses the use of the laboratory safety management system management based on wechat applet.  

Key words: laboratory safety management system of wechat applet; JAVA

Table of contents

Laboratory safety management system based on SSM WeChat applet I

Abstract I

Laboratory safety management system based on SSM wechat applet II

Abstract II

Chapter 1 Introduction 6

1.1 Topic background 6

1.2 Research status 6

1.3 Research content 6

Chapter 2 Introduction to Development Tools and Key Technologies 8

2.1 WeChat Developer Tools 8

2.2 Mini Program Framework and Directory Structure Introduction 8

2.3 JAVA technology 9

2.4 Mysql database 9

2.5 Introduction to SSM Framework 10

Chapter 3 System Analysis 12

3.1 Requirements Analysis 12

3.2 Feasibility Analysis 12

3.2.1 Technical Feasibility: Technical Background 12

3.2.2 Economic feasibility 13

3.2.3 Operational Feasibility: 13

3.3 Performance Analysis 13

3.4 System operation process 14

3.4.1 User login process 14

3.4.2 Information adding process 14

3.4.3 Information deletion process 15

Chapter 4 System Design and Implementation 17

4.1 System architecture design 17

4.2 Development Process Design 17

4.3 Database Design 18

4.3.1 Entity ER Diagram 18

4.3.2 Data Table 20

Chapter 5 System Implementation 28

5.1 User front-end function module (front-end) 28

5.2 Administrator function module (backend) 42

Chapter 6 System Testing 55

6.1 Test purpose 55

6.2 Test scheme design 55

6.2.1 Testing strategy 55

6.2.2 Test analysis 55

6.3 Test results 56

Conclusion 57

Reference 58

Thanks 60

Chapter One Introduction

1.1 Background of topic selection

With the advent of the Internet age, the advantages and popularity of the Internet are constantly affecting and changing people's lifestyles. Today, with the rapid development of information technology, computer technology has spread all over the world, which has brought about great changes in society.

In order not to be limited by time and place, smart phone users can access websites and handle various businesses and the Internet through the mobile network, which is an effective way to extend the functions of the application system to mobile terminals. Nowadays, all kinds of smart phones emerge in an endless stream, and various software based on mobile phone platforms emerge as the times require. Among them, among the many communication software, WeChat is favored by people. In recent years, the development scale of WeChat has become larger and larger, and more and more people have begun to use WeChat. At present, with the popularization of smart phone systems, almost everyone has WeChat on their mobile phones.

Therefore, WeChat launched mini-program advertisements to support the attention of official accounts, which means that the channel between the mini-programs and official accounts has been completely opened up. The laboratory safety management system of the WeChat applet in this paper mainly involves the program, database and computer technology. Covering a wide range of knowledge can greatly improve the work efficiency of system personnel.

1.2 Research Status

With the development of society and the advancement of science and technology, Internet technology is becoming more and more popular. The lifestyle of network communication is gradually loved by the broad masses of the people. More and more Internet enthusiasts have begun to meet their basic needs on the Internet, and at the same time, it has gradually entered the daily life of various users. Internet has many advantages such as convenience, speed, high efficiency and low cost. Therefore, a laboratory safety management system similar to the WeChat applet can meet the needs of users who are busy with work. It is not only a way for users to view information at any time, but also improves management efficiency.

This paper first takes the basic issues of the laboratory safety management system process of the WeChat applet as the research object. Before developing the system, we conducted a detailed investigation and analysis of the existing situation. Finally, we use computer technology to develop a complete and suitable laboratory safety management system for WeChat applets. The main advantages of the system are: the system is mainly developed by computer technology, which is convenient and fast; the system can view all information management of users through the administrator interface.

The laboratory safety management system management system software of the WeChat applet is a convenient, fast and practical information service query software. With the continuous popularization of intelligent networks in the global market and the use of various intelligent platforms, the development of the system is related to people's daily needs. As a mainstream intelligent technology development system in China, such software is naturally needed to meet the needs of more users and experience.

1.3 Research content

The development and implementation of the laboratory safety management system of the WeChat applet, the required work content:

(1) First of all, determine the topic, determine the system to be built, and conduct a preliminary systematic confirmation of the background of the system and some problems currently facing it.

(2) After the system confirmation is completed, the technology used for system development shall be confirmed in combination with the requirements of system development. The development of the laboratory safety management system of this WeChat applet uses JAVA technology, and the database is used for platform construction and development, and the technology used shall be confirmed. Carry out technical analysis, whether the technology used can complete the realization of the laboratory safety management system of the WeChat applet.

(3) Determine the technology used by the system, confirm the user roles divided by the system online, and determine the functional modules to be designed according to the division of user roles. The design of the laboratory safety management system for the WeChat applet is mainly divided into management The roles of administrators and users are different, and the functional modules used are also different, but the content of the database of the system is interactive. Users can view course information according to their own needs at any time. For system staff, they can conduct online information according to their assigned content The processing and operation of the system, the administrator obtains the detailed data information of all users, and processes and solves it as soon as possible according to the needs.

(4) Design the program and interface after the functional modules of the system are confirmed. The test method finds out the loopholes in the program, and solves the loopholes in the program online. If there is no problem in the test system, the system can be uploaded for formal operation.

2.1 WeChat Developer Tools

The WeChat developer tool has now been developed and run by the small program development team. At present, the WeChat developer tool is still being continuously improved, and it is often updated when developing a small program. You can use the WeChat code to log in to the developer tool, and the developer tool will use the information of this WeChat account to develop and debug the applet.

Model selection: The applet uses the screen size of the smartphone as the design standard to cut pictures.

Preview interface: After writing the view layout, click compile to refresh the view interface.

Console: It is convenient to debug and print out information.

Upload code: upload to the Tencent server, and submit for review. You can fill in the version number and remarks when uploading the code.

Resource file: Generally, you can perform breakpoint debugging of the file directory of the corresponding project in the resource file.

Display remote debugging: The joint debugging of mobile phone and PC development tools is very practical for users.

Local data storage: Displays the data stored locally.

View debugging: The standard components are presented in a child-parent hierarchical structure, which is convenient for debugging.

WeChat is limited to a code volume within 2M; the legal domain name information is generally not verified during development; the server domain name needs to be configured in the background of the applet.

The above are the functions commonly used by WeChat developer tools during the development process, and the WeChat developer tools are also constantly being improved.

2.2 Mini Program Framework and Directory Structure Introduction

The entire applet framework system is divided into two parts: logic layer and view layer . The goal of the mini program development framework is to allow developers to develop services with native mini program experience in WeChat in the simplest and most efficient way possible. The applet provides a data transmission and event system between the view layer and the logic layer, and provides its own view layer and logic layer framework, allowing developers to focus on data and logic. At the heart of the framework is a reactive data binding system that makes keeping data and views in sync very simple. Data modification at the logical layer will be updated accordingly at the view layer. The framework provides a set of basic components. These components come with WeChat-style styles and special logic. Developers can create powerful WeChat applets by combining basic components.

2.3 JAVA technology _

Java mainly adopts CORBA technology and security model, which can protect data in Internet applications. It also provides comprehensive support for EJB (Enterprise JavaBeans), java servlet API, SSM (java server pages), and XML technology.

JAVA language features:

Object-oriented: Object-oriented is one of the symbols of the Java programming language and a software development method. The most important thing is to turn everything into objects and program it somehow. When programming, code and data are written on each object. The emergence of the object-oriented programming method makes people's design thinking and operation in the programming process very simple, and also improves the security of the program.

Cross-platform: A key feature of Java's popularity is its cross-platform nature, which makes programming in Java easy. You can write a program in Java and run it elsewhere without changing it after compilation.

Garbage collection mechanism: It is used to release the memory space occupied by objects that are useless when the program is not operating. The most hated thing about C++ is that it cannot timely recover the memory space occupied during the programming process. Release, resulting in more and more memory space occupied as the programming time becomes longer. For some programming masters, they will configure a memory address on the stack when they first start programming, and then release it when they are not needed, while some novices and rookies will forget to delete this memory in many cases address, which will cause the program to become very unstable during the running process, and may eventually cause the program to crash. Therefore, many C ++ masters often set the value of the deleted pointer to NULL when writing programs, and then determine whether the value of a pointer is NULL before deleting.

2. 4   Mysql database

Databases are an integral part of the system development process. In terms of WEB applications, MySQL AB has developed a MySQL relational database management system with great advantages. MySQL can store data in different tables, which is very flexible, and can also improve the speed of the system in practical applications. Database access is most commonly used in the standard SQL language, and MySQL is used in the SQL language, so it is highly compatible. Database operations are essential, including functions such as adding, deleting, modifying, and querying database tables. Nowadays, databases can be divided into relational databases and non-relational databases. Mysql is a relational database. Mysql database is a small relational database. It has its own characteristics: small size, fast speed, low cost, etc. Mysql The database is by far the most popular open source database.

In WEB application technology, Mysql database supports different operating system platforms. Although the installation and configuration under different platforms are different, the difference is not very big. There are two installation methods of Mysql under Windows platform, binary version and installation-free Version. After installing the Mysql database, you need to start the service process, and the corresponding client can connect to the database, and the client can log in to the database through a command line or a graphical interface tool.

2.5 Introduction to SSM framework

The SSM (Spring+SpringMVC+MyBatis) framework set is composed of two open source frameworks, Spring and MyBatis (SpringMVC is part of Spring). Often used as a framework for web projects with simpler data sources.

 Spring

Spring is like a large factory that assembles beans in the entire project. In the configuration file, you can specify specific parameters to call the constructor 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), that is, programmers are no longer required to explicitly `new` an object, but let the Spring framework do it for you.

SpringMVC

SpringMVC intercepts user requests in the project. Its core Servlet, DispatcherServlet, assumes the role of intermediary or front desk, and matches user requests with the Controller through HandlerMapping. The Controller is the specific operation performed by the corresponding request. SpringMVC is equivalent to struts in the SSH framework.

 my shoe

mybatis is an encapsulation of jdbc, which makes the underlying operation of the database transparent. The operations of mybatis revolve around a sqlSessionFactory instance. Mybatis is associated to the Mapper file of each entity class through the configuration file. The Mapper file configures the SQL statement mapping required by 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 to process the logic, the logic layer sends the request to the persistence layer, the persistence layer interacts with the database, and 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.

Chapter Three System Analysis

3.1 Demand Analysis

Before any project is developed and researched, it is necessary to make a careful analysis of the needs of the R&D system itself. Market research cannot be ignored. Determine the functional requirements of the users from the actual scene, so as to clarify the goals and develop the entire system. There is a more accurate positioning. In this chapter, it is necessary to analyze the performance of the system, business process, and data. The overall interface of the laboratory safety management system of the WeChat applet is simple and the functions are complete.

The feasibility of requirements is to analyze and discuss what kind of requirements the developed system can meet. Whether the developed system platform meets the previous requirements. Only in the development of a pre-assessment system can the requirements be completed prior to system development and implementation. If it is not feasible for you to develop a system that does not function properly, then it is development failure. Whether the development system is useful and can fulfill the requirements discussed before, the following analyzes the actual requirements of the laboratory safety management system of the WeChat applet.

System design needs to start with the actual needs of users and administrators to understand what functions they need to implement and what administrative work they can include.

Considering the characteristics of the system design of the laboratory safety management system of the WeChat applet, several requirements should be met:

(1) It can carry out the information management of the laboratory safety management system of the WeChat applet through the network, and promote the information management of the laboratory safety management system of the WeChat applet.

(2) Learning methods become more diverse and management is more standardized;

(3) It provides a free channel to ensure real-time and effective communication of data.

3.2 Feasibility analysis

3.2.1 Technical Feasibility: Technical Background     

The laboratory safety management system of the WeChat applet adopts JAVA technology, develops a fully functional and easy-to-use front-end application program, and establishes and maintains a back-end database system with complete data, security and strong stability.

The system uses JAVA technology and Mysql database as a design tool, which is easy to learn and operate. The combination of user roles to develop a laboratory safety management system for WeChat applets is worth trying. Data integrity and many qualities provide a basis for the functional allocation and management of data. It is also an important part of the database security platform and an important means to improve and enhance data security. Furthermore, to provide a smoother, smarter and more efficient approach to fundamental control, the steps required to simultaneously build support for a secure computing environment and help maintain security are defined. Because among these two development tools, the functions are powerful and free, and the interface is good, so the laboratory safety management system of the WeChat Mini Program is technically feasible.

3.2.2 Economic feasibility

The development of the laboratory safety management system management of the desktop WeChat applet is developed by the developer himself, and there is no need to purchase other software or ports, and the market was made before the development of the laboratory safety management system management of the WeChat applet There is no cost for the laboratory safety management system of research and other WeChat applets. Through the efforts of the developers themselves, all the work is done by themselves. When encountering problems that are difficult to solve by themselves, most of them pass With the help of classmates and instructors, relevant information is resolved, so the development of the laboratory safety management system for WeChat applets is completely feasible economically, without any expenses.

The use of JAVA technology is a relatively mature technology, so the development of the laboratory safety management system of the WeChat applet is economically no problem.

3.2.3 Operation feasibility: 

The operability mainly refers to the degree of user experience after the design of the laboratory safety management system of the WeChat applet is completed. For the administrator, the relevant data information can be managed at any time through the system, and for the two user roles of the administrator and the user, You can easily and clearly enter your own system interface. Through the interface navigation menu, you can easily and clearly operate the functional modules, which is convenient for user information needs and course information management data information. For the operation of the system, you can directly perform functional modules without professionals. Operational management, so the operability of the system is completely ok. The operation of this system also uses the interface window to log in, so the operator only needs to know simple computer operations.

3.3 Performance Analysis

For performance analysis, compared with the traditional management method, the traditional management method uses manual statistics and management of data information with paper and pen, and this method is more troublesome for storing and finding certain data information. With the advent of computer networks, this traditional method is difficult to adapt to the development of the current society. It not only reduces people's work efficiency, but also requires a lot of manpower and material resources, which is relatively high in terms of time and cost. To reduce costs, improve user efficiency, and develop a laboratory safety management system based on computer and network technology WeChat applets.

The development and design of the laboratory safety management system of the WeChat applet is an independent system, which uses popular databases for data storage and development, mainly to realize the user roles and corresponding functional modules of the laboratory safety management system of the WeChat applet. The management of the laboratory safety management system of the WeChat applet will not have management differences and low efficiency, but is just the opposite of the traditional management information. The processing speed is also improved, with high speed, high efficiency and powerful functions.

3.4 System operation process

3.4.1 User login process

The first hurdle for system security is that users who want to enter the system must enter their own login information through the login window before they can log in. Only after the information entered by the user is accurate can they enter the operating system interface and perform function modules. The corresponding operation, if the information entered by the user is incorrect, a prompt box will appear in the window, and the user fails to log in. Return to the first step to re-enter, as shown in Figure 3-1.

Figure 3-1 Login operation flowchart

3.4.2 Information adding process

For the laboratory safety management system of the WeChat applet, it is necessary to add the required data information at any time. For the user to add information, it is necessary to fill in the data information to be added according to the content of the selection box on the adding interface, and judge the data information after the information input is completed. If it meets the requirements, the addition is completed if the requirements are met. If the information added by the user does not meet the requirements, you need to return to the first step, re-enter the data information, and then perform the judgment operation, as shown in Figure 3-2.

Figure 3-2 Information adding flow chart

3.4.3 Information deletion process

No matter which user role enters the unreasonable system operation interface, it can perform different information content operation functions. For the deletion of system data information, once the user deletes the information, the deleted data information will not be restored. Therefore, the user When deleting data, it is necessary to judge whether the content to be deleted is determined to be deleted. After confirming that it is correct, choose to confirm the deletion operation, as shown in Figure 3-3.

Figure 3-3 Information deletion flow chart

Chapter 4 System Design and Implementation

4.1 System architecture design

The overview design analysis of the system project of the laboratory safety management system of the WeChat applet, the main content includes the specific analysis of the learning platform, the design of the database, the data uses the mysql database, and the design of the system adopts a more humanized operation design, The error messages that appear in the system can be processed and fed back in time.

The laboratory safety management system based on the WeChat applet is based on the existing mobile phone, which can realize administrators: home page, site management (carousel map, bulletin board) user management (administrator, ordinary user) content management (communication area classification, news list, news classification list, safety learning) more detailed understanding of management (supply classification, laboratory supplies management, procurement records, use records, return records, maintenance records, replacement records, loss report records, laboratory management, appointment management), etc. and statistical analysis. The module relationship diagram established according to the system functional requirements is as follows:

Figure 4-1 Administrator function module diagram

4.2 Development process design

The development of the laboratory safety management system of the WeChat applet analyzes the management module and the database used by the system, writes generation development, planning and operation are the necessary three steps to build an information management application, which determines whether the system can truly achieve the expected function and whether it can be implemented after a successful design. In the development process, each stage must be developed in strict accordance with the linear sequence, and each work generated in the corresponding stage can be verified and checked by technology. Make sure that it is correct after the completion of one stage, and will not cause drag and drop phenomenon in the next stage, so that the system can be guaranteed after the design function is completed.

Judging from the successful development experience of the laboratory safety management system of the WeChat applet, the above method has the most obvious effect and minimizes the complexity of system development. As shown in Figure 4-2.

Figure 4-2 Flow chart of the development system

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 ER diagram of the laboratory safety management system, as shown in Figure 4-3:

Figure 4-3 Attribute diagram of laboratory supplies management entity

 (2) The user registration management ER diagram is shown in Figure 4-4:

Figure 4-4 user information management entity diagram

These functions can fully meet the needs of the laboratory safety management system of the WeChat applet. The function of this system is relatively comprehensive, as shown in Figure 4-5 below the system function structure.

Figure 4-5 System function structure diagram

4.3.2 Data Sheet

According to the detailed analysis requirements of the data structure, we can analyze according to the requirements of the input and output data volume, determine what table, the relationship between the structure, we can verify, adjust and improve, query and browse the process, can realize the database, In order to make users have more requirements for data and functions.

Based on the characteristics of the database management system used by the system, the conceptual model of the database is converted and constructed. However, this system only needs to fully consider the functions of the laboratory safety management system of the WeChat applet, and the organization is relatively clear.

booking_management

Field Name

type

length

not null

primary key

field description

booking_management_id

int

11

no

primary key

Appointment Management ID

laboratory_name

varchar

64

yes

laboratory name

laboratory_type

varchar

64

yes

laboratory type

appointment_person

int

11

yes

Reservation person

time_of_appointment

varchar

64

yes

Appointment

audit_status

varchar

64

yes

Approval Status

review_reply

varchar

64

yes

review reply

recommend

int

11

no

Intelligent Recommendation

create_time

datetime

0

no

creation time

update_time

timestamp

0

no

update time

classification_of_supplies

Field Name

type

length

not null

primary key

field description

classification_of_supplies_id

int

11

no

primary key

Product Category ID

type_of_supplies

varchar

64

yes

Supplies type

recommend

int

11

no

Intelligent Recommendation

create_time

datetime

0

no

creation time

update_time

timestamp

0

no

update time

experimental_supplies

Field Name

type

length

not null

primary key

field description

experimental_supplies_id

int

11

no

primary key

Labware ID

article_no

varchar

64

no

Article number

item_name

varchar

64

yes

Item name

supplies_map

varchar

255

yes

supplies diagram

type_of_supplies

varchar

64

yes

Supplies type

stock

varchar

64

yes

in stock

service_life_

date

0

yes

service life

operation_method

text

0

yes

operation method

matters_needing_attention

text

0

yes

Precautions

supplies_introduction

text

0

yes

Supplies introduction

hits

int

11

no

hits

praise_len

int

11

no

Likes

recommend

int

11

no

Intelligent Recommendation

create_time

datetime

0

no

creation time

update_time

timestamp

0

no

update time

laboratory

Field Name

type

length

not null

primary key

field description

laboratory_id

int

11

no

primary key

Lab ID

laboratory_name

varchar

64

yes

laboratory name

lab_cover

varchar

255

yes

lab cover

laboratory_type

varchar

64

yes

laboratory type

person_in_charge

varchar

64

yes

principal

laboratory_location

varchar

64

yes

laboratory location

laboratory_details

text

0

yes

Laboratory Details

hits

int

11

no

hits

praise_len

int

11

no

Likes

recommend

int

11

no

Intelligent Recommendation

create_time

datetime

0

no

creation time

update_time

timestamp

0

no

update time

loss_report_record

字段名称

类型

长度

不是null

主键

字段说明

loss_report_record_id

int

11

主键

报损记录ID

article_no

varchar

64

用品编号

item_name

varchar

64

用品名称

type_of_supplies

varchar

64

用品类型

loss_report

varchar

64

报损数

loss_reporting_time

varchar

64

报损时间

report_the_damage_to_others

int

11

报损人

cause_of_loss_report

text

0

报损原因

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

maintenance_record

字段名称

类型

长度

不是null

主键

字段说明

maintenance_record_id

int

11

主键

检修记录ID

article_no

varchar

64

用品编号

item_name

varchar

64

用品名称

type_of_supplies

varchar

64

用品类型

repair_time_

varchar

64

检修时间

maintenance_results

text

0

检修结果

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

ordinary_users

字段名称

类型

长度

不是null

主键

字段说明

ordinary_users_id

int

11

主键

普通用户ID

full_name

varchar

64

姓名

gender

varchar

64

性别

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

user_id

int

11

用户ID

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

purchase_record

字段名称

类型

长度

不是null

主键

字段说明

purchase_record_id

int

11

主键

采购记录ID

article_no

varchar

64

用品编号

item_name

varchar

64

用品名称

type_of_supplies

varchar

64

用品类型

number_of_purchases

varchar

64

采购数

procurement_time

varchar

64

采购时间

remark_information

varchar

64

备注信息

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

replacement_record

字段名称

类型

长度

不是null

主键

字段说明

replacement_record_id

int

11

主键

更换记录ID

article_no

varchar

64

用品编号

item_name

varchar

64

用品名称

type_of_supplies

varchar

64

用品类型

maintenance_time

varchar

64

维修时间

maintenance_results

varchar

64

维修结果

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

return_record

字段名称

类型

长度

不是null

主键

字段说明

return_record_id

int

11

主键

归还记录ID

article_no

varchar

64

用品编号

item_name

varchar

64

用品名称

type_of_supplies

varchar

64

用品类型

number_of_requisitions

varchar

64

领用数

return_time

varchar

64

归还时间

receiver

int

11

领用人

remarks

varchar

64

备注

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

usage_record

字段名称

类型

长度

不是null

主键

字段说明

usage_record_id

int

11

主键

使用记录ID

article_no

varchar

64

用品编号

item_name

varchar

64

用品名称

type_of_supplies

varchar

64

用品类型

number_of_requisitions

varchar

64

领用数

collection_time

varchar

64

领用时间

receiver

int

11

领用人

remark_information

varchar

64

备注信息

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

第五章 系统实现

5.1用户前台功能模块(前端) 

微信小程序的实验室安全管理系统登录界面,通过填写账号、密码、等信息进行登录,如图5-1所示。

图5-1登录界面图

登录代码如下:

@Slf4j

public class LoginInterceptor implements HandlerInterceptor {

    private String tokenName = "x-auth-token";

    @Override

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        String token = request.getHeader(this.tokenName);

        setHeader(request, response);

        log.info("[请求接口] - {} , [请求类型] - {}",request.getRequestURL().toString(),request.getMethod());

        if (request.getRequestURL().toString().contains("/api/user/login")){

            return true;

        }

        else if (request.getRequestURL().toString().contains("/api/user/state")){

            return true;

        }

        else if (request.getRequestURL().toString().contains("/api/user/register")){

            return true;

        }

        if (token == null || "".equals(token)){

            if ("POST".equals(request.getMethod())){

                return false;

            }else {

                return true;

            }

        }else {

            return true;

        }

}

    private void setHeader(HttpServletRequest request, HttpServletResponse response) {

        //跨域的header设置

        response.setHeader("Access-control-Allow-Origin", request.getHeader("Origin"));

        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");

        response.setHeader("Access-Control-Allow-Credentials", "true");

        response.setHeader("Access-Control-Allow-Headers", request.getHeader("Access-Control-Request-Headers"));

        response.setHeader("Access-Control-Max-Age", "1800");

        //防止乱码,适用于传输JSON数据

        response.setHeader("Content-Type", "application/json;charset=UTF-8");

        response.setStatus

注册,通过填写账号、密码、昵称、手机、、邮箱、简介等信息,输入完成后选择提交即可注册成功,如图5-2所示。

图5-2注册界面图

注册代码如下:

   /**

     * 注册

     * @return

     */

    @PostMapping("register")

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

        // 查询用户

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

        Map<String,Object> map = service.readBody(request.getReader());

        query.put("username",String.valueOf(map.get("username")));

        List list = service.selectBaseList(service.select(query, new HashMap<>()));

        if (list.size()>0){

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

        }

        map.put("password",service.encryption(String.valueOf(map.get("password"))));

        service.insert(map);

        return success(1);

}

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

        BufferedReader br = null;

        StringBuilder sb = new StringBuilder("");

        try{

            br = reader;

            String str;

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

                sb.append(str);

            }

            br.close();

            String json = sb.toString();

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

        }catch (IOException e){

            e.printStackTrace();

        }finally{

            if (null != br){

                try{

                    br.close();

                }catch (IOException e){

                    e.printStackTrace();

                }

            }

        }

        return null;

    }

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

        E entity = JSON.parseObject(JSON.toJSONString(body),eClass);

        baseMapper.insert(entity);

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

}

首页,可以进行首页、交流区、新闻资讯、新闻资讯、我的(使用记录、归还记录、检修记录、更换记录、报损记录、预约管理)等功能模块的查看与操作,如图5-3所示。

图5-3系统首页界面图

首页代码如下:

 public Map<String, Object> success(Object o) {

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

        if (o == null) {

            map.put("result", null);

            return map;

        }

        if (o instanceof List) {

            if (((List) o).size() == 1) {

               o =  ((List) o).get(0);

                map.put("result", o);

            }else {

                String jsonString = JSONObject.toJSONString(o);

                JSONArray objects = service.covertArray(JSONObject.parseArray(jsonString));

                map.put("result", objects);

            }

        } else if (o instanceof Integer || o instanceof String) {

            map.put("result", o);

        } else {

            String jsonString = JSONObject.toJSONString(o);

            JSONObject jsonObject = JSONObject.parseObject(jsonString);

            JSONObject j = service.covertObject(jsonObject);

            map.put("result", j);

        }

        return map;

}

公告列表列表页面可以查看展示的公告详情等信息,并可通过关键词搜索公告,并对公告点赞、评论、收藏等操作。如图5-4所示。

图5-4公告列表界面图

公告列表代码如下:

 @PostMapping("/upload")

    public Map<String, Object> upload(@RequestParam(value = "file",required=false) MultipartFile file,HttpServletRequest request) {

        log.info("进入方法");

        if (file.isEmpty()) {

            return error(30000, "没有选择文件");

        }

        try {

            //判断有没路径,没有则创建

            String filePath = request.getSession().getServletContext().getRealPath("\\") +"upload\\";

//            String filePath = System.getProperty("user.dir") + "\\target\\classes\\static\\upload\\";

            File targetDir = new File(filePath);

            if (!targetDir.exists() && !targetDir.isDirectory()) {

                if (targetDir.mkdirs()) {

                    log.info("创建目录成功");

                } else {

                    log.error("创建目录失败");

                }

            }

//            String path = ResourceUtils.getURL("classpath:").getPath() + "static/upload/";

//            String filePath = path.replace('/', '\\').substring(1, path.length());

            String fileName = file.getOriginalFilename();

            int lastIndexOf = fileName.lastIndexOf(".");

            //获取文件的后缀名 .jpg

            String suffix = fileName.substring(lastIndexOf);

            fileName = IdWorker.getId()+suffix;

            File dest = new File(filePath + fileName);

            log.info("文件路径:{}", dest.getPath());

            log.info("文件名:{}", dest.getName());

            file.transferTo(dest);

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("url", "/api/upload/" + fileName);

            return success(jsonObject);

        } catch (IOException e) {

            log.info("上传失败:{}", e.getMessage());

        }

        return error(30000, "上传失败");

}

我的,在我的页面可以查看图像、昵称、并可对个人信息进行修改,如图5-5所示。

图5-5我的界面图

实验用品列表,在实验用品列表页面可以查看图像、用品编号、用品类型、用品名称,并可对实验用品列表进行点赞、收藏等操作,如图5-6所示。

图5-6实验用品界面图

预约管理,在预约管理页面可以查看实验室名称、实验室类型、预约人、预约时间、审核状态、审核回复等操作,如图5-7所示。

图5-7预约管理界面图

5.2管理员功能模块(后端)  

轮播图展示,管理员通过输入标题、内容、链接、轮播图、点击量等操作提交,如图5-8所示。

图5-8轮播图界图面

轮播图代码如下:

  @RequestMapping("/get_obj")

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

        List resultList = service.selectBaseList(service.select(service.readQuery(request), service.readConfig(request)));

        if (resultList.size() > 0) {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("obj",resultList.get(0));

            return success(jsonObject);

        } else {

            return success(null);

        }

}

在管理员功能页面可以首页、站点管理(轮播图、公告栏)用户管理(管理员、普通用户)内容管理(交流区分类、新闻列表、新闻分类列表、安全学习)更多管理(用品分类、实验用品管理、采购记录、使用记录、归还记录、检修记录、更换记录、报损记录、实验室管理、预约管理)等内容进行相对应操作,如图5-9所示。

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

管理员功能代码如下:

   public Map<String, Object> success(Object o) {

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

        if (o == null) {

            map.put("result", null);

            return map;

        }

        if (o instanceof List) {

            if (((List) o).size() == 1) {

               o =  ((List) o).get(0);

                map.put("result", o);

            }else {

                String jsonString = JSONObject.toJSONString(o);

                JSONArray objects = service.covertArray(JSONObject.parseArray(jsonString));

                map.put("result", objects);

            }

        } else if (o instanceof Integer || o instanceof String) {

            map.put("result", o);

        } else {

            String jsonString = JSONObject.toJSONString(o);

            JSONObject jsonObject = JSONObject.parseObject(jsonString);

            JSONObject j = service.covertObject(jsonObject);

            map.put("result", j);

        }

        return map;

}

用户管理,在用户管理页面可以编辑用户昵称、用户名、姓名、性别、等内容,并可根据需要进行修改或删除操作,如图5-10所示。

图5-10用户管理界面图

用户管理代码如下:

/**

 * 用户组:用于用户前端身份和鉴权(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-11所示。

图5-11安全学习界面图

安全学习代码如下:

@PostMapping("/add")

    @Transactional

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

        Map<String,Object> paramMap = service.readBody(request.getReader());

        this.addMap(paramMap);

        return success(1);

}

    @Transactional

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

        service.insert(map);

        return success(1);

}

实验用品管理,在实验用品管理页面可以查看用品编号、用品名称、用品图、用品类型、库存。使用年限、操作方法、注意事项等内容,并可根据需要进行修改或删除操作,如图5-12所示。

图5-12实验用品管理界面图

实验用品管理代码如下:

 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-13所示。

图5-13实验室管理界面图

实验室管理代码如下:

   public Map<String, Object> success(Object o) {

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

        if (o == null) {

            map.put("result", null);

            return map;

        }

        if (o instanceof List) {

            if (((List) o).size() == 1) {

               o =  ((List) o).get(0);

                map.put("result", o);

            }else {

                String jsonString = JSONObject.toJSONString(o);

                JSONArray objects = service.covertArray(JSONObject.parseArray(jsonString));

                map.put("result", objects);

            }

        } else if (o instanceof Integer || o instanceof String) {

            map.put("result", o);

        } else {

            String jsonString = JSONObject.toJSONString(o);

            JSONObject jsonObject = JSONObject.parseObject(jsonString);

            JSONObject j = service.covertObject(jsonObject);

            map.put("result", j);

        }

        return map;

}

六章  系统的测试

6.1 测试目的

程序设计不能保证没有错误,这是一个开发过程,在错误或错误的过程中难以避免,这是不可避免的,但我们不能使这些错误始终存在于系统中,错误可能会造成无法估量的后果 如系统崩溃,安全信息,系统无法正常启动,导致安装用户手机屏幕等,为了避免这些问题,我们需要测试程序,并发现这些问题,并纠正它们 ,并使系统更长时间稳定成熟,本章的作用是发现这些问题,并对其进行修改,虽然耗时费力,但长期非常重要和必要 系统的开发。

软件测试与开发过程是一样的,都必须按照软件工程的正规原理进行,遵守管理学理论。不过,目前国内的软件测试已经积累了大量经验和方法,步骤相对成熟,软件测试的效率也越来越高。

微信小程序的实验室安全管理系统的实现,对于系统中功能模块的实现及操作都必须通过测试进行来评判系统是否可以准确的实现。在微信小程序的实验室安全管理系统正式上传使用之前必须做的一步就是系统测试,对于测试发现的错误及时修改处理,保证系统准确无误的供给用户使用。

6.2 测试方案设计

6.2.1 测试策略

1、功能测试

从用户的角度来看,测试时不了解新开发软件的内部结构,因此可以将系统与黑匣子进行比较,盲目输入后可以查看系统给出的反馈。这种测试属于黑盒测试,在测试中如果输入错误信息系统会报错。

2、性能测试

测试软件程序的整体状况(称为性能测试)通常使用自动化测试工具来检测系统的整体功能,在负载测试和压力测试之间进行分配,在某些情况下,将这两种情况结合起来。虽然压力测试可以检测到系统可以提供的最高级别的服务,但负载测试可以测试系统如何响应增加的负载。

6.2.2 测试分析

测试评估系统质量的方法不局限于系统编码和过程,应该与软件设计工作和历史需求分析密切相关。

软件测试应遵循以下原则:

(1)软件测试应尽快进行,整个测试部分应在软件开发和设计的整个过程中进行。如发现错误,立即处理,将大大减少软件开发的时间,并提高软件的质量。

(2)在软件的各种测试中,测试过程中使用的计划、报告等应妥善处理和存储。其主要目的是为了便于以后系统的维护。

(3)软件测试整个过程中的聚类现象应优先考虑。

(4)对于软件测试,我们应该尽量不去和自己设计的系统进行参考,而是要测试对方的程序,以确保软件测试结果的客观性和公平性。

(5)整个测试计划严格按照软件测试的具体实施细则进行。

(6)对整个测试结果进行综合检查,尽量避免重复错误。

本微信小程序的实验室安全管理系统满足用户的要求和需求,本微信小程序的实验室安全管理系统的使用能够有效的提高用户的使用率。

6.3 测试结果

测试后得到的性能和用例,系统具有足够的正确性、可靠性、稳定性,并且可以对输入数据进行准确的点击操作处理和响应测试用户的体验也得到了很好的反馈和响应时间。合理的范围,可以兼容所有主流浏览器,设计所需的效果。

结  论

在这个设计中,我花了大量的时间去理解系统开发中使用的知识,经过这段时间的努力工作最终完成了系统设计。通过这一阶段的学习,我发现了自己的不足,充分掌握了必要的应用技能,进一步的学习使我充实了自己的知识基础,完成了这个艰巨的任务。当遇到问题时,我很及时的寻求老师的帮助,通过专业的网站和论坛来解决,他们的帮助让我一步一步的成功克服了困难的问题。系统设计过程不容易,你需要不断充实自己,有勇气克服困难。系统开发的一些功能还不完善,需要继续改善后,通过用户体验来修改设计完美的系统,让用户得到更好的体验,我觉得很高兴,因为这是我第一次通过自己的努力实现这个系统,但绝不是我的最后一个,在未来我将努力实现更多的优秀的系统。

在一些编程语言的系统实现中,对词汇表不太熟悉,导致了开发的困难,但是我通过了合适的字典软件来解决这个大问题。由此,我学会了自己的英语缺陷。在那之后,我不断地提高自己的英语知识,这样我就不会有任何未来的工作和生活。毕业设计过程我感觉很深刻,从一开始就不熟悉开发技术,一步一步的使用,接触到文献和信息,不难理解,系统是一次又一次的实现,系统本身对于在线学习是有用的。我从这个设计中获益良多,论文的编写需要有自己的意愿去实现一点,学习生活中所有的问题的勇气,学习的过程就是学习的过程。毕业设计,我学会了将理论知识应用于实践。让我知道该怎么做,我们必须认真对待。勇于克服困难,相信未来,我会做得更好。

参考文献

[1]耿祥义,张跃平.《JSP实用教程》. 清华大学出版社,2019年5月

[2]Brown等.《JSP编程指南(第二版)》. 电子工业出版社 ,2019年3月

[3]BruceEckel.《Java编程思想》. 机械工业出版社,2019年10月

[4]孙一林,彭波.《Java数据库编程实例》. 清华大学出版社,2018年8月

[5]FLANAGAN.《Java技术手册》. 中国电力出版社,2017年6月

[6] David L.Anderson.Managing  Information Systems.清华大学出版社,2018:16

[7]孙卫琴,李洪成.《Tomcat 与 Java Web 开发技术详解》.电子工业出版社,2019年6月

[8]孙涌.《现代软件工程》.北京希望电子出版社,2019年8月

[9](美)额尔曼.(美)威多姆.数据库系统基础教程.清华大学出版社,2019:5

[10]飞思科技产品研发中心.《JSP应用开发详解》.电子工业出版社,2019年9月

[11] 张晓东. MySOL数据库应用系统与实例[M].北京:人民邮电出版社,2018:179

[12] 王家华.软件工程[M],沈阳:东北大学出版社,2018:46.

[13]何渺渺,李腾跃,程付超.高校综合服务平台小程序的设计与实现[J].福建电脑,2021,37(12):91-94.DOI:10.16707/j.cnki.fjpc.2021.12.020.

[14]李伟.基于微信小程序的双屏融合电视产品的思考[J].广播电视网络,2021,28(11):51-52.DOI:10.16045/j.cnki.catvtec.2021.11.013.

[15]柳叶.基于微信小程序的校园导航系统的设计与实现[J].测绘与空间地理信息,2021,44(11):84-86.

[16]张文,方巍,贾雪磊.基于SSM框架的合租系统设计与实现[J].计算机技术与发展,2021,31(11):159-164.

[17]侯佳丽,付丽琴,邢亚英.基于小程序的师生管理系统的设计与实现[J].电子测试,2021(21):85-87.DOI:10.16520/j.cnki.1000-8519.2021.21.029.

[18]Ravishankar B. T.,Vaishali S.,Bhattacharya D.,Ramadevi M. C.,Sarwade Abhilash,Seetha S.. AstroSat/SSM data pipeline[J]. Journal of Astrophysics and Astronomy,2021,42(2):

[19]Huang Zijie,Zhao Hongzhou,Lin Jianhui,Liu Minling,Zheng Huanxin. SSM-based Intelligent WeChat Applet for Pick-up[J]. Journal of Physics: Conference Series,2021,1883(1):

[20]蔡进. 面向中小学生的古图书学习系统的设计与实现[D].中央民族大学,2020.DOI:10.27667/d.cnki.gzymu.2020.000229.

致  谢

The completion of the laboratory safety management system of the WeChat applet, and how to achieve it better, involved a lot of effort, and this period of time will be unforgettable for life.

The laboratory safety management system of the WeChat applet can be successfully completed. First of all, I would like to thank my instructor, who helped me in time when I encountered design problems, and gave me full guidance when I was confused about the design . With his help, I can complete a high-quality graduation project. In the laboratory safety management system and development of the WeChat applet, the instructor put forward many practical opinions and suggestions, and provided me with a large amount of relevant research materials, which enabled me to have a deeper understanding of the design. Only under the guidance of the teacher can we succeed in the graduation project. Here, I would like to express my deep gratitude to the instructor.

Here, I would also like to thank my classmates, who provided many references for my design, and discussed with me the problems in the design, so that my design matured step by step.  

Get the source code of the project for free, please pay attention to like + private chat

Guess you like

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