ssm+mysql+Design and implementation of rescue materials management and distribution system based on SSM framework Graduation project - with source code 291141

Management and distribution system of rescue supplies

Summary

The rapid development of scientific and technological progress has caused great changes in people's daily life, and the rapid development of electronic information technology has made the application level of electronic information technology in various fields popularized and applied. The arrival of the information age has become an irresistible fashion trend, and the history of human development is entering a new era. In actual application, the working rules and development steps of the software are applied, and the rescue material management and distribution system is constructed using the SSM framework.

This design mainly realizes the rescue material management and distribution system integrating the advantages of humanization, high efficiency, and convenience, and completes employee management, rescue material management, rescue material storage management, storage management, delivery management, and rescue material inventory management. , Vendor management, department management, blacklist management and other functional modules. The system communicates with the server through the browser to realize data interaction and change. The system improves work efficiency and reduces errors and omissions in data storage through scientific management methods and convenient services. The rescue and relief materials management and distribution system is developed using the SSM technology based on the MVC model, written with the Eclipse 2017 CI 10 compiler, and the data mainly uses Microsoft's MySQL relational database as the data storage medium, and cooperates with the front-end HTML+CSS technology Complete system development.

Key words: management and distribution of rescue supplies; relational database; data storage

Management and distribution system of rescue materials

Abstract

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

This design mainly realizes the rescue material management and distribution system integrating the advantages of humanization, high efficiency and convenience, and completes the functional modules such as employee management, rescue material management, material warehousing management, outbound management, delivery management, material inventory management, manufacturer management, department management, blacklist management and so on. The system communicates with the server through the browser to realize data interaction and change. Through scientific management and convenient service, the system improves work efficiency and reduces errors and omissions in data storage. The relief material management and distribution system is developed by using SSM technology based on MVC mode and written by eclipse 2017 CI 10 compiler. In terms of data, Microsoft's MySQL relational database is mainly used as the data storage medium, and the system development is completed with the foreground HTML + CSS technology.

Key words:Management and distribution of rescue materials; Relational database; Data is stored

Table of contents

Chapter 1 Introduction

1.1  Research background and significance

1.2 Development status at home and abroad 

1.3  Organizational structure of this article

Chapter 2 Introduction to Related Technologies

2.1 Development Technology

2.2 SSM framework

2.3 MySQL database

2.4 B/S structure

2.5 Working principle of B/S system

Chapter 3 System Analysis

3.1  Feasibility analysis

3.1.1  Technical Feasibility Analysis

3.1.2  Economic Feasibility Analysis

3.1.3  Operation Feasibility Analysis

3.2  Analysis of Functional Requirements

3.3  Analysis of non-functional requirements

3.4  Data flow analysis

Chapter 4 System Design

4.1  System architecture design

4.2  System function structure

4.3  Functional module design

4.4  Form Field Validation Processing Design

4.5  System Maintenance Design

4.6  Database Design

4.6.1  Conceptual Model

4.6.2  Relational Model

4.6.3  Data Sheet

Chapter 5 System Implementation 1 8

5.1  Implementation of login module 1 8

5.2  Implementation of User Subsystem Module 1 9

5.2.1  User Homepage Module 1 9

5.2.2 Material Warehouse Module 2  0

5.2.3 Material delivery module 2  2

5.3  Implementation of the administrator subsystem module 2 3

5.3.1  Employee Management Module 2 4

5.3.2  Personal data management module 2 5

5.3.3 Employee detection management module 2  7

5.3.4 User Management Module 2  9

5.3.5 Material delivery management module 3  0

5.4  Implementation of paging module 3 1

Chapter 6 System Testing 3 2

6.1  Test purpose 3 3

6.2  Test process 3 4

6.3  Test results 3 4

Chapter 7 Summary and Outlook 4 5

References 3 6

Acknowledgments 3 7

  1. introduction
    1. research background and meaning

With the development of human history, human society has experienced thousands of years of history. During these thousands of years, due to the influence of various factors, various public emergencies continue to appear, It is a cyclical process of development until it dies. The so-called public emergencies include many kinds, which are naturally produced, such as various natural disasters, disease conflicts, etc., and man-made, such as national turmoil and ethnic conflicts. In particular, the outbreak of the industrial revolution in western countries has led to the rapid development of social industrial technology, resulting in more public emergencies, including traffic accidents, technical accidents, environmental accidents, medical accidents, and terrorist attacks. No matter how the society develops, emergencies are unavoidable, which requires people to raise awareness of emergencies and make preparations for emergencies.

At present, my country's modernization drive is entering a new stage, and the country's policy reform and economic development are in a sensitive period. During this sensitive period, factors affecting the public safety of the country, society and the people are gradually increasing, leading to various emergencies Public events happen from time to time. How to use advanced information technology and application systems to improve our country's ability to manage and coordinate emergencies, emergency response capabilities, and event handling efficiency. Based on the analysis of the existing problems in the current rescue material management system, combined with the concept, structure and basic principles and methods of system development of the management system, and using the computer with fast computing speed, large storage information capacity, and strong logical problem processing , The advantages of strong functions, using the B/S structure, developed for the management needs of the basic information of relief supplies, the entry and exit information of relief supplies, the inventory information of relief supplies, and manufacturers. Starting from the management needs of querying and modifying information, it has strong pertinence and relatively complete basic application functions. It aims to realize the informatization and networking of the management and distribution of relief materials through this system, so as to improve the efficiency of management and distribution of relief materials.

    1. Development status at home and abroad

In some western developed countries, such as the United States, Germany, etc., the disaster relief logistics system derived from disaster relief has developed rapidly, and its development speed is basically the same as that of enterprise logistics. In disaster relief logistics, advanced logistics concepts such as commercial logistics separation, third-party logistics, through-type warehouses, and supply chain management are also used to make the disaster relief logistics system very sound. After an emergency occurs, the government can carry out timely and rapid Rescue activities, sending various relief materials to the disaster-stricken areas quickly, effectively reducing the harm caused by emergencies. After decades of research and construction, the existing foreign aid logistics system has developed to real-time staged management, and carry out targeted rescue activities according to the actual situation of the disaster. Through this management method, neither Delaying the supply of relief materials in the hardest-hit areas will not blindly provide relief materials to light-disaster areas. On the basis of ensuring the supply of disaster relief, the goal of maximizing the benefits of relief materials has been achieved.

In order to better prevent and respond to public emergencies, the United States has established a very complete national disaster emergency plan after years of research and efforts. As long as major natural disasters occur in the country, such as earthquakes, hurricanes, volcanic eruptions, Floods and tsunami, etc., the government will enter a state of emergency to deal with emergencies, and start the emergency plan to carry out rescue work in the disaster area. All disaster relief and handling affairs are under the full responsibility of the "Federal Emergency Management Agency". In addition, because the information technology in the United States is very advanced, advanced high-tech information technology will be used in disaster prevention and relief work, and multiple prevention and simulation drills will be carried out in advance. Appropriate prevention and disaster relief methods. Every city has established a public security organization system. When there is no disaster, this security organization system cooperates with the police to jointly manage the city's public security. Once a major disaster occurs, the system will quickly transform into an emergency disaster relief system to cooperate with federal emergencies. Disaster Management Bureau to carry out post-disaster processing work. After a disaster occurs, the most important work is the transportation and distribution of emergency relief materials. Therefore, in the Federal Emergency Management Agency, there is a special logistics management unit. The main job of this unit is to be responsible for the usual disaster relief supplies. Management work, forecasting the demand for emergency relief supplies for different disasters, and planning the transportation and distribution routes of emergency relief supplies, etc. When a disaster event occurs, the logistics management unit can quickly switch to an emergency state, and distribute and distribute disaster relief materials according to the disaster information and needs of the disaster area.

Due to geographical reasons, my country is one of the countries with the most natural disasters in the world. There are not only many types of natural disasters, but also many frequencies, which basically happen every year. In my country, common natural disasters include drought, flood, typhoon, earthquake, snow disaster, mudslide, forest fire, etc. These natural disasters have many notable characteristics, including regional, seasonal, phased, symbiotic and half-life etc., have caused very serious losses to the country and the region, as well as the lives and properties of the people.

In my country, about 74% of the provincial capital cities and 62% of the cities above the prefecture level are geographically located in high-risk areas of earthquakes. In these disaster-stricken areas, more than 75% of my country's industry and agriculture and more than 70% of large cities are distributed. and more than 50% of the population. In recent years, due to climate reasons, natural disasters have occurred frequently, and the disaster-affected areas and casualties in my country have been on the rise. With the rapid development of the national economy, the scale of industrial and agricultural production has continued to expand, and the urban population has continued to increase. These factors are extremely important. Greatly increased the losses caused by natural disasters. Through the analysis of the background and significance of the subject, it can be seen that the construction of the relief materials management and distribution system is very necessary.

    1. Organization of this article

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

The second chapter studies the development techniques and tools used in the material management and distribution system.

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

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

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

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

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

  1. Related technology introduction
    1. Development Technology:

The front-end part of the system is developed based on the MVVM model, using the B/S model, and the back-end part is developed based on the Java ssm framework.

Front-end part: The front-end framework adopts the popular progressive JavaScript framework Vue.js. Use Vue-Router and Vuex to achieve dynamic routing and global state management, Ajax to achieve front-end and back-end communication, Element UI component library to make the page quickly prototype, and the front-end of the project realizes responsiveness through grid layout, which can be adapted to PC, tablet, mobile, etc. Perfect layout display for different screen sizes.

Back-end part: use ssm as the development framework, and integrate MyBatis, Redis and other related technologies at the same time.

    1. modelSSM framework:

SSM is SpringMVVM+Spring+MySQL. These three frameworks have their own unique advantages, so combining them together can create a strong spark. The designer can create a web application program without consuming a lot of effort, and this program also has the characteristics of clear hierarchy, upgrade and update operations will not affect normal use, and allows multiple uses. This composite framework forms a system with a complete structure, powerful functions and a good structure: SpringMVVM separates each plate, Spring makes development more flexible and convenient, allows developers to directly manipulate objects, and divides labor details at each level, and realizes each level. Decoupling makes the code more flexible and streamlined. This framework enables programmers to avoid individual mistakes during the development period that lead to the destruction of the whole, and also to respond to new requirements from customers for the product in the later stage.

2.3 MySQL database

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

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

2.4 B/S structure

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

2.5 B/S system working principle:

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

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

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

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

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

                                           

  1. system analysis
    1. Feasibility Analysis

To develop any system, it is necessary to analyze its feasibility and consider its time and resource constraints, which can reduce the risk of system development. At the same time, after the analysis, not only can manpower be used reasonably, but also the consumption of various resources can be saved. The following three aspects of technology, economy and society will be introduced.

      1. Technical Feasibility Analysis

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

      1. Economic Feasibility Analysis

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

      1. Operational Feasibility Analysis

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

    1. Functional Requirements Analysis

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

The employee use case diagram is shown below.

Figure 3-1 Employee use case diagram

The administrator use case diagram is shown below.

Figure 3-2 Administrator use case diagram

The use case description is a textual description of the best understanding and requirement description of each functional module of the use case diagram. The use case description is as follows:

Table 3-1 Login description

description item

illustrate

use case name

Log in

use case description

Only when the user enters the correct user name and password can he log in to the system and continue the subsequent operations

participant

user

Preconditions

The user correctly enters the URL

postcondition

The user logs in and jumps to the main interface successfully

main event flow

The user enters the corresponding username and password

If the username does not exist, you need to register

If the password or username is wrong, login fails

If the user name and password entered are correct, you will enter the main interface of the platform

abnormal event flow

e1. Network abnormality

e2. Database connection exception

Table 3-2 Description of employee management

description item

illustrate

use case name

Staff operation

use case description

Under the condition that the administrator correctly logs in to the background management, manage the employees

participant

administrator

Preconditions

The administrator logs in successfully and jumps to the background main interface

postcondition

Successful operation

main event flow

The administrator jumps to the employee management page to query the details of the employee

Administrators can delete employee information

abnormal event flow

e1. report 500 error

e2. Database connection exception

Table 3-3 Material management description

description item

illustrate

use case name

material handling

use case description

Under the condition that the administrator correctly logs in to the background management, the material module can be managed

participant

administrator

Preconditions

Admin successfully logged in

postcondition

Successful operation

main event flow

(1) The administrator enters the material management page to query material information

(2) The administrator can add, delete and edit materials

(3) The administrator adds materials, and jumps to the query page if the addition is successful

abnormal event flow

e1. report 500 error

e2. Database connection exception

Table 3-4 Material classification management description

description item

illustrate

use case name

Material classification operation

use case description

Under the condition that the administrator correctly logs in to the background management, the material classification module will manage

participant

administrator

Preconditions

Admin successfully logged in

postcondition

Successful operation

main event flow

(1) The administrator enters the material classification management page to query the information of the material classification content

(2) The administrator can delete the material classification

abnormal event flow

e1. report 500 error

e2. Database connection exception

表3-5 入库管理描述

描述项

说明

用例名称

仓库操作

用例描述

管理员正确登录后台管理的条件下,对入库模块进行管理

参与者

管理员

前置条件

管理员成功登录

后置条件

操作成功

主事件流

(1)管理员进入入库管理页面,查询物资的信息

(2)管理员可以对入库进行增删除和编辑仓库操作

(3)管理员新增入库,添加成功跳转到查询页面

异常事件流

e1.报500错误

e2.数据库连接异常

表3-6 员工检测管理描述

描述项

说明

用例名称

员工检测操作

用例描述

管理员正确登录后台管理的条件下,员工检测模块进行管理

参与者

管理员

前置条件

管理员成功登录

后置条件

操作成功

主事件流

(1)管理员进入员工检测管理页面,查询员工检测内容的信息

(2)管理员可以对员工检测进行删除操作

异常事件流

e1.报500错误

e2.数据库连接异常

救援物资管理与分配系统在对需求做解析后,整个系统主要分为两个部分:管理员和员工,每个模块下的分支功能不一样。对功能做出如下说明:

员工模块:

账号登录认证。

管理个人资料信息,修改可修改的信息项。

物资种类,员工可以对物资进行分类,输入具体物资的具体信息(包括物资名称、物质种类、厂商信息、物质编号等)。

物资仓库,同时查看历史物资的记录。

员工检测,员工能看见自己的检测信息(包括体温、身体状况、健康码等)。

物资分类,同时查看分类信息的记录。

管理员模块:

维护员工信息,审核员工的账号,可以冻结员工的登录权限,或者删除员工账号。

物资入库管理,并可以销毁某个物资,更新物资数据,模糊搜索物资数据等。

厂商管理,并可以销毁某个厂商,更新厂商数据,模糊搜索厂商数据等。

系统维护管理数据。

    1. 非功能需求分析

系统非功能需求有非常多,比如性能需求、可承载最大用户数、稳定性、易用性需求等。本系统分析时考虑到易用性需求,因为系统是给人使用的,所以必须充分从用户的角度出发,考虑用户体验,使系统易理解易上手易操作。

    1. 数据流程分析

一层数据流程图包括了登录、用户功能和检索维护等模块,在登录模块使用到的数据存储有用户账户文档,用户功能模块需要的存储是用户各功能模块数据文档,检索维护是使用以上这些数据文档通过关键词进行检索。

系统的一层数据流图如下图所示。

图3-2系统数据流图(一层)

二层数据流程是对一层数据流层图中填写登录信息、用户功能的细化。即:填写登录信息细化为填制信息、后台审核,用户功能细化为物资仓库、物资分类信息、物资派送、员工检测等操作。

系统的二层数据流图如下图所示。

图3-4系统数据流图(二层)

  1. 系统设计
    1. 系统架构设计

目前B/S体系的系统主要的数据访问方式是:通过浏览器页面用户可以进入系统,系统可以自动对用户向服务器发送的请求进行处理,处理请求是在系统后台中进行的,用户在浏览器页面上进行相应操作,就能够看到服务端传递的处理结果。超市商品管理系统主要分为视图-模型-控制三层架构设计。在视图层中,主要是操作在服务器端向用户端反馈并显示的数据,在模型层中,主要处理相关的业务逻辑、数据整合等,最后的控制层它介于视图和模型之间,主要是调整两层之间的关系,最终落实数据的传递。

系统架构图如下图所示。

图4-1系统架构图

    1. 系统功能结构

系统设计的目的是分析系统包括的所有功能结构,为开发人员设计开发和实现系统做好准备工作。经过前期的需求调查、分析和整理之后,确定的总体需求主要包括多个模块,分别是:员工管理、物资仓库管理、物资分类管理、入库管理、厂商管理、系统维护管理、派送管理、员工检测管理。系统整体角色分为两个部分,一是员工、二是管理。权限分布也是很明显,员工是在除去浏览信息之外还具有查询和管理自己账户信息、物资信息录入、仓库信息、物资分类、物资库存查询、物资派送等权限;管理员是最高权限拥有者。

系统功能结构图如下图所示。

图4-2系统功能结构图

    1. 功能模块设计

用户管理模块

该模块是为所有用户登录设计的,如员工登录后只能进行自己的普通功能操作(如个人信息修改),管理员和超级管理员登录后有不同的权限,管理员不能超越权限。超级管理员能对整个系统的数据进行管理,主要是用户的登录权限以及用户登录后在系统里的操作权限。

物资仓库模块

员工和物资仓库存在录入信息关系,关系为一对多,根据物资编号来将物资数据传入到仓库信息数据中,操作人为员工,然后生成物资列表,员工查看个人输入物资列表,可以进行数据销毁。

物资种类模块

操作人来录入物资种类数据,点击物资种类录入按钮,依次填写要录入的种类数据,点击提交按钮,将数据提交至数据库,然后刷新物资种类数据页面,每条数据右边有删除和编辑按钮,来完成相应的删除和更新功能。

用户维护模块

操作人来录入用户数据,点击用户录入按钮,依次填写要录入的用户数据,点击提交按钮,将数据提交至数据库,然后刷新用户数据页面,每条数据右边有删除和编辑按钮,来完成相应的删除和更新功能。

员工检测模块

管理员点击员工检测管理菜单,点击公告添加子菜单,添加检测数据,填写检测情况、内容,提交成功后,员工检测数据页面刷新,新数据成功载入页面。

    1. 表单字段校验处理设计

1.出错信息类型

出错信息类型包括:

A 未输入必填项;

B 应输入合法字符或数字却输入非法字符或数字;

C 对空数据表进行更改或删除操作;

D 向要求唯一值的关键字段添加重复值。

2.出错处理对策

对于错误A,系统要求用户输入非空值。

对于错误B,系统要求用户输入合法字符。

对于错误C,系统提示数据表无记录可更改或删除。

对于错误D,系统要求用户输入非重复值。

    1. 系统维护设计

救援物资管理与分配系统是个现代化的高度集成的综合信息系统,系统主要服务对象为用户,最大化在页面中提供多的信息,因此在系统维护上,数据量较大,整体的维护设计如下:

(1)代码的维护:部署在云服务器上或本地服务器,通过SVN或FTP保持版本更新迭代。

(2)功能增加:功能升级在必要的前提下。

(3)数据维护:根据安全性等需求,定期对数据库进行人工备份。

    1. 数据库设计
      1. 概念模型

对于一个要开发的系统来说,E-R图可以让别人能更快更轻松的了解此系统的事务及它们之间的关系。根据系统分析阶段所得出的结论确定了在超市商品管理系统中存在着多个实体分别是用员工、管理员、物资、仓库、厂商、物资库存、物资派送。

系统总体ER图如下图所示。

图4-4系统总体ER图

      1. 关系模型

管理员(管理员id、用户名、密码、权限)

员工(员工id、账号、密码、姓名、性别、地区、手机、Email、照片)

通知数据(通知id、标题、类别、首页图片、点击率、发布人)

物资分类(物资id、编号、名称、类别、数量、厂商、创建时间)

物资仓库(物资仓库id、物资编号、物资名称、物资种类、仓库数量、厂商信息)

物资派送(物资派送id、物资编号、物资名称、物资数量、派送人员)

      1. 数据表

数据库逻辑结构就是将E-R图在数据库中用具体的字段进行描述。用字段和数据类型描述来使对象特征实体化,最后形成具有一定逻辑关系的数据库表结构。超市商品管理系统所需要的部分数据结构表如下表所示。

vendor_management表:

名称

类型

长度

不是null

主键

注释

vendor_management_id

int

11

厂商管理ID

manufacturer_name

varchar

64

厂商名称

manufacturer_address

varchar

64

厂商地址

contact_number

varchar

16

联系电话

vendor_details

text

0

厂商详情

provision_of_materials

text

0

提供物资

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

material_warehousing表:

名称

类型

长度

不是null

主键

注释

material_warehousing_id

int

11

物资入库ID

warehousing_date

date

0

入库日期

material_name

varchar

64

物资名称

material_type

varchar

64

物资种类

warehouser

int

11

入库人

manufacturer

varchar

64

厂商

storage_location

varchar

64

存放位置

receipt_quantity

int

11

入库数量

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

material_warehouse表:

名称

类型

长度

不是null

主键

注释

material_warehouse_id

int

11

物资仓库ID

material_name

varchar

64

物资名称

item_no

varchar

64

物资编号

material_type

varchar

64

物资种类

material_picture

varchar

255

物资图片

storage_location

varchar

64

存放位置

manufacturer

varchar

64

厂商

stock

int

11

库存

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

material_delivery表:

名称

类型

长度

不是null

主键

注释

material_delivery_id

int

11

物资派送ID

material_name

varchar

64

物资名称

material_type

varchar

64

物资种类

delivery_quantity

int

11

派送数量

material_flow_direction

varchar

64

物资流向

sender

int

11

派送人

manufacturer

varchar

64

厂商

delivery_date

date

0

派送日期

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

department_management表:

名称

类型

长度

不是null

主键

注释

department_management_id

int

11

部门管理ID

department_name

varchar

64

部门名称

department_number

varchar

64

部门编号

department_information

text

0

部门信息

number_of_departments

varchar

64

部门人数

department_location

varchar

64

部门位置

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

employee_testing表:

名称

类型

长度

不是null

主键

注释

employee_testing_id

int

11

员工检测ID

temperature

varchar

64

体温

health_code

varchar

255

健康码

staff

int

11

员工

physical_condition

varchar

64

身体状况

remarks

varchar

64

备注

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

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

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

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

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

输入:用户名和密码。

处理:

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

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

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

输出:是否成功的信息。

登录流程图如下所示。

图5-1登录流程图

系统登录界面如下所示。

图5-2系统登录界面

登录模块的关键代码如下:

/**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

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

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

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

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

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

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

        List resultList = null;

        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;

}

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

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

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

图5-3系统首页界面

      1. 物资仓库模块

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

物资入库流程图如下所示。

图5-4物资入库流程图

物资仓库界面如图所示。

图5-5物资仓库界面

      1. 物资派送模块

物资派送过程中,首先使用getmap(id,"xinxi"),通过商品ID得到物资数据,将数据赋值给物资派送,调用CommDAO的insert方法将移库数据插入退货表中,最后查看个人历史物资派送记录,可以销毁历史退货数据。

物资派送流程图如下所示。

图5-6物资派送流程图

物资派送界面如图所示。

图5-7物资派送界面

物资派送界面关键代码如下:

@RequestMapping("/get_list")

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

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

        return success(map);

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

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

员工管理界面如下图所示。

图5-8员工管理界面

      1. 个人资料管理模块

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

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

图5-9密码修改流程图

      1. 员工检测管理模块

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

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

员工检测流程图如下所示。

图5-10员工检测流程图

员工检测管理界面如下图所示。

图5-11员工检测界面

员工检测界面关键代码如下:

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

        }

}

      1. 用户管理模块

选择需要删除的用户信息进行删除,把主键的uId传到CangkuController控制器,再调用控制器的deleteCangku方法,数据经过CangkuService业务层解析和处理,请求CangkuMapper持久层调用deleteByPrimaryKey方法操作数据库将仓库数据从数据库中删除。

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

用户管理流程图如下所示。

图5-12用户管理流程图

      1. 物资派送管理模块

用户选择物资添加派送记录,用户在shangpinxinxi_list查看物资,点击派送,跳转至rukuxinxi_add.jsp,添加派送记录则将添加的派送记录数据封装在HashMap中,然后调用CommDAO的insert方法将派送记录内容插入派送记录表中。

物资派送管理流程图如下所示。

图5-14物资派送管理流程图

图5-15物资派送管理界面

物资派送管理界面关键代码如下:

@RequestMapping("/get_list")

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

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

        return success(map);

    1. 分页模块的实现

本系统单独编写一个Pager类用于分页技术的实现,在该类中确定每一个页面显示记录的总数pageSize,同时定义总记录数totalSize、当前页currentPage和总页数totalPage这几个属性,声明一个带两个参数的构造函数,获取数据库记录的时候传入记录总数给pageSize,通过记录总数和pageSize这两个变量计算出总页数,在查询数据的时候需要通过Pager类的pageSize设置每次取出数据的最大记录数和设置起始取出记录的位置。该类中还定义了几个boolean类型的变量,用于判断是否有上一页、下一页、最后一页等等,在jsp页面显示数据的时候通过标签显示记录是否有上一页或者下一页。

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

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

    1. 测试过程

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

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

表6-1登录测试用例

测试性能

用户或操作员登录系统

用例目的

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

前提条件

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

输入条件

预期输出

实际情况

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

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

一致

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

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

一致

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

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

一致

物资入库测试用例表如下所示。

表6-2物资入库测试用例

测试性能

用户进行物资入库的操作

用例目的

测试用户进行物资入库操作时,该功能是否正常

前提条件

用户进入物资详情页,该物资能够被入库

输入条件

预期输出

实际情况

对着某物资点击“入库”按钮

界面跳转至领取界面

一致

在领取界面,输入必填项,点击“提交”按钮

提示“入库成功”,并返回上一级界面

一致

在领取界面,填写领取表单的时候未输入完整,点击“提交”按钮

提示“入库失败”

一致

物资仓库管理测试用例表如下所示。

表6-3物资仓库管理测试用例

测试性能

用户进行物资仓库的操作

用例目的

测试用户进行物资仓库操作时,该功能是否正常

前提条件

用户进入物资详情页,该物资能够被移库

输入条件

预期输出

实际情况

对着某物资点击“仓库”按钮

界面跳转至仓库界面

一致

在物资界面,输入必填项,点击“仓库”按钮

提示“成功”,并返回上一级界面

一致

在物资界面,填写物资表单的时候未输入完整,点击“仓库”按钮

提示“失败”

一致

物资仓库管理测试用例表如下所示。

表6-4物资派送测试用例

测试性能

物资相关信息管理功能

用例目的

测试系统操作者对物资相关信息进行管理的功能是否正常

前提条件

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

输入条件

预期输出

实际情况

进入物资派送界面,点击“派送”按钮,填写所有必填项,点击提交

提示“派送成功”,并返回查询界面

一致

进入物资派送界面,点击“派送”按钮,未填写一个或者多个必填项,点击提交

提示“派送失败”,请填写必填项

一致

进入物资派送界面,选择要修改的一条数据,点击该条数据后面的“修改”按钮 

节目跳转至修改界面

一致

在修改界面,修改可修改项后,点击“提交”按钮

提示“修改成功”,并返回查询界面

一致

进入物资派送界面,点击某条数据后面的删除按钮

提示“是否要删除该数据”,如果用户点击“确定”按钮,则成功删除该条数据,并提示“删除成功”,之后返回查询界面

一致

    1. 测试结果

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

  1. 总结与展望

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

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

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

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

参考文献

[1]Shan Li,Peng Xiao,Wei Zhou,Yun Liang,Shiao-Wei Kuo,Tao Chen.Bioinspired Nanostructured Superwetting Thin-Films in a Self-supported form Enabled “Miniature Umbrella” for Weather Monitoring and Water Rescue[J].Nano-Micro Letters,2022,14(02):180-195.

[2]段容谷,庄媛媛,张克勇,吴云霞.突发公共卫生事件下多阶段应急救援物资配置研究[J].中国安全生产科学技术,2021,17(12):142-148.

[3]张毅.考虑需求缺口的应急物资分配机理及运作模式[J].中国流通经济,2021,35(09):32-42.

[4]安聪琢,王玖河.突发性公共卫生事件下横纵结合应急物资配送模式[J].科学技术与工程,2021,21(23):10029-10036.

[5]黄辉,梁星,李梦想,张娟.应急物资联合配送决策研究[J].运筹与管理,2021,30(06):48-54.

[6]叶芷吟. 基于需求分析的大型灾害属地应急物资分配研究[D].北京交通大学,2021.

[7]肖姜. 基于深度学习的跨海大桥灾害救援研究[D].扬州大学,2021.

[8]乐磊,陆倩,杨梦蝶.基于NET平台的应急医疗救援物资管理系统模块化构建[J].现代医院,2021,21(03):417-419+423.

[9]曹策俊,高学鸿.基于数学规划的救援物资分配优化模型及其求解算法综述[J].计算机应用,2020,40(08):2398-2409.

[10]王妍妍,孙佰清.模糊信息下多种类应急物资多周期分配优化模型[J].中国管理科学,2020,28(03):40-51.

[11]左文泽. 基于情景分析的城市应急救援调度研究[D].哈尔滨工业大学,2019.

[12] Zheng Qiangcheng. Design and Implementation of Emergency Resource Management System Based on SSM [D]. Central China Normal University, 2019.

[13] Zhang Jie, Xie Yonggang, Li Xuelong. Research on Emergency Management System [J]. Land Bridge Vision, 2018(09):75-77+80.

[14] Sun Xiaoye. Design and Implementation of Earthquake Emergency Rescue Materials Management System [D]. Beijing University of Technology, 2018.

[15] Yin Pumin. Rescuing Children Online [J]. Beijing Review, 2018, 59(24): 30-31.

[16] Li Zijian, Zhu Xiaolong, Qiao Zhengfu, Che Jibo, Cao Ping, Wang Youjin. Development and application of "three defenses" medical rescue and combat readiness material management system based on RFID technology [J]. Medical and Health Equipment, 2018, 35 (09 ):38-40.

thank you

With the completion of the design, the college career is coming to an end. The time in college is the time I cherish the most. I have learned a lot and grown a lot during the time in college. Every memory during this time is engraved in my mind. Thanks to the students who studied and grew up together, and the teachers who taught me during the growth process, I am very grateful for your company.

First of all, I would like to thank my instructor. The completion of the design is inseparable from a series of guidance from the teacher. During the completion of the graduation project, the teacher gave many pertinent suggestions. It is precisely because of the teacher's meticulous work attitude that my design can be successfully completed.

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

Like+Favorite+Follow → private message to receive the source code and database

Guess you like

Origin blog.csdn.net/weixin_61498557/article/details/131229221