(Source code attached) Development of springboot farmland irrigation facilities management system graduation project 260931

Table of contents

Summary

1 Introduction

1.1 The purpose and significance of topic selection

1.2 Research status

1.3 Characteristics of system development technology

1. 4 Paper structure and chapter arrangement

2  System analysis of farmland irrigation equipment management system 

2.1 Feasibility analysis

2.2 System process analysis

2.2.1 Data addition process

2.3.2Data modification process

2.3.3Data deletion process

2.3 System function analysis

2.3.1 Functional analysis

2.3.2 Non-functional analysis

2.4 System use case analysis

2.5 Summary of this chapter

3  Overall design of farmland irrigation equipment management system

3.1 System architecture design

3.2 System function module design

3.2.1 Overall functional module design

3.2.2 Device management module design

3.2. 3 Inspection and maintenance management module design

3.3 Database design

3.3.1 Database conceptual structure design

3.3.2 Database logical structure design

3.4 Summary of this chapter

4  Detailed design and implementation of farmland irrigation equipment management system 

4.1 Implementation of login module

4.2 Administrator management module 21

4.3 Device management module 22

4.4 Equipment storage management module 25

4.5 Inspection and maintenance management module 27

4.6 Profile module 31

5 System Test 34

5.1 Purpose of system testing 34

5.2 System test cases 34

5.3 System test results 35

Conclusion 37

Reference 38

Acknowledgments  

                                                                       Summary

In view of the current situation of farmland irrigation equipment management system, a farmland irrigation equipment management system was developed using software technology, which realized the digitization and standardization of farmland irrigation equipment management, effectively improved the efficiency of equipment management and reduced the labor intensity of managers. Computer management has replaced traditional manual management methods in many fields with its fast and efficient characteristics. Especially in complex and trivial material equipment management, this advantage of computer management methods is even more prominent. Compared with traditional management methods, the farmland irrigation equipment management system can manage information more effectively. The equipment management system uses a database to represent information data in the form of a database, making it easier to update and manage.

Keywords : springboot technology; MYSQL; farmland irrigation equipment management system

Abstract

According to the current situation of farmland irrigation equipment management system, the farmland irrigation equipment management system is developed by using software technology, which realizes the digitization and standardization of farmland irrigation equipment management, effectively improves the work efficiency of equipment management and reduces the labor intensity of managers. In the field of traditional material management, computer management has been replaced by manual management, especially in the field of complex and efficient material management. Compared with traditional management methods, farmland irrigation equipment management system can manage information more effectively. The equipment management system applies the database to represent the information data in the form of database, which is easier to update and manage.

Keywords: Springboot technology; MYSQL; Farmland irrigation equipment management system

1 Introduction

1.1The  purpose and significance of topic selection

In the work of farmland irrigation equipment management system, the arrangement of equipment is a very complex and difficult task. During the arrangement process, it is easy to make mistakes due to the large number. The use of computer-assisted equipment arrangement work not only improves the scientific nature of the arrangement, but also greatly reduces the work intensity of managers and improves work efficiency, thereby taking the modernization of farmland irrigation equipment management to a new level. And because there are many farmland irrigation equipments now but the level of automatic management is relatively low, many farmland irrigation equipments use the basic information and related information of the equipment to be registered and archived after the equipment is purchased. After archiving, the files are basically not recorded and maintained. As for future changes or damage to the equipment, they will not be recorded in the equipment files, which means that the real-time status of the equipment cannot be reflected. Even if some units have a farmland irrigation equipment management system, even if they can reflect the real-time information of the equipment in the equipment files, functions such as equipment defect processing and equipment defects have not been implemented, and equipment maintenance spare parts status and maintenance cost accounting have not been implemented. Realization, the informatization of the entire farmland irrigation equipment management is still at a low level. Divide management tasks into small pieces, implement them to individuals, and be able to query the current and historical conditions of the equipment at any time, which has a direct effect on the reliability analysis of the equipment, freeing managers from manual calculations and statistical work.

1.2 Research status

The farmland irrigation equipment management system is an indispensable part of a farmland irrigation system. Its content is crucial to farmland irrigation equipment and managers. Therefore, the farmland irrigation equipment management system should be able to provide sufficient information and fast management for agriculture. Inquiry means. The system can also help with effective equipment management for farmland irrigation, which is of great help in equipment maintenance and estimation of farmland irrigation equipment, improving the sustainable development capabilities and market competitiveness of agriculture.

At present, the level of automated management of domestic farmland irrigation equipment management systems is not very high. Most methods for learning farmland irrigation equipment management systems are to register and archive the basic situation and related information of the equipment after the equipment is purchased, and then archive the files. In the future, the files will basically not be maintained. Information such as the location of the equipment, maintenance status, and current operating status of the equipment will not be reflected in the equipment ledger at all. That is, equipment tracking information cannot be reflected in the equipment files in a timely manner. In some farmland irrigation equipment management systems, even though the tracking information of the equipment can be reflected in the equipment files, functions such as equipment defect processing and equipment defects are not implemented, and equipment maintenance spare parts status and maintenance cost accounting are not implemented. The entire farmland The informatization of irrigation equipment management is still at a low level. This information management system reasonably draws on the international leading farmland irrigation equipment management system ideas and combines the current status of domestic farmland irrigation equipment management systems, which can fully meet the needs of domestic farmland irrigation equipment management systems. Through long-term research and exploration on equipment management in various industries, with flexibility and versatility as the main design ideas, it can improve agricultural farmland irrigation efficiency and equipment reliability, reduce the labor intensity of staff, reduce consumables, and improve the agricultural farmland irrigation equipment management system. modern management level.

1.3 Characteristics of system development technology

(1) The backend of the web background management in the farmland irrigation equipment management system no longer uses the ancient jsp+javabean+servlet technology, but uses the current mainstream springboot framework, which reduces java configuration code and simplifies programming code. Currently, springboot The framework is also one of the frameworks chosen by many companies.

(2) The front-end of the web background management in the farmland irrigation equipment management system uses a JavaScript framework, which can beautify the page design in conjunction with ajax[8] and jquery[9].

(3) The database used in the farmland irrigation equipment management system is mysql5.7, which has high execution efficiency.

1.4 Paper structure and chapter arrangement

The paper will be organized hierarchically. In addition to the abstract, acknowledgments, and literature references, the main text will also analyze the website requirements, describe the general design and implemented functions, and finally list some debugging records. The main structure of the paper is as follows:

Chapter 1: Introduction. The first chapter mainly introduces the background of the project research, the current situation of system development and the research content and main work of this article.

Chapter 2: System requirements analysis. Chapter 2 mainly conducts demand analysis from the aspects of users and functions of the system.

Chapter 3: System Design. Chapter 3 mainly carries out functional design of the system framework, system function modules and database.

Chapter 4: System implementation. Chapter 4 mainly introduces the system framework construction and the implementation of the system interface.

Chapter 5: System Testing. Chapter 5 mainly tests some interfaces of the system and tests the main functions.

Chapter 6: Summary.

2 System analysis of farmland irrigation equipment management system

System analysis is a prerequisite for developing a project. Through system analysis, the basic needs of the main users of the system can be well understood, and this is also the reason for the development of the project. Then, a feasibility analysis is performed on the system development, which usually includes technical feasibility, economic feasibility, etc. The feasibility analysis is also an analysis from the overall perspective of the project. Then the specific requirements of the project are analyzed. The analysis method is generally implemented through the user's use case diagram. The following is a detailed introduction.

2.1 Feasibility analysis

(1) Economic feasibility:

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 funds during the project startup period, so It is still economically feasible. Try to meet the needs of users with the least amount of money. Save money on labor costs and equipment costs. We will go further and further on the road of paperlessness and high efficiency.

So there is no problem with economic feasibility.

(2) Operational feasibility:

The design of this project refers to several cases of website development under this mode, analyzes their operation interfaces, and combines many cases to highlight people-oriented simplified operations, so people with basic computer knowledge can operate this project.

Therefore, there is no problem with operational feasibility.

(3) Technical feasibility:

Technical feasibility refers to the feasibility of building a framework, as well as the system's adaptability to technological upgrading when better technologies emerge, and the development time and cost ratio.

The existing springboot technology can cater to the construction of all e-commerce systems. When developing this farmland irrigation equipment management system, I used springboot+MYSQL to run the overall program.

In summary, there is no problem with the technical feasibility.

(4) Legal feasibility:

From a developer's perspective, springboot and MYSQL are open source and free online, and there will be no legal disputes regarding intellectual property rights.

From a user perspective, as long as contraband is no longer sold on the system, treaties and agreements are made with the system, and illegal payments are eliminated.

In summary, there is no problem with the legal feasibility.

2.2 System process analysis

The business process uses some specific symbols and lines to demonstrate the user's process when using the system. When performing system analysis, the business process can help developers better understand the business, discover errors, and improve the system.

2.2.1 Data addition process

After the user successfully logs in to the system , he or she can add data. The number of the added data is specific and generated by the system. The user cannot fill it in at will. Except for the number, the user fills in other added information by himself. The filled-in information is verified by the system and is legal. If it passes, it will show that the data has been added successfully. If it is passed, it will not be added successfully. Figure 2-1 shows the process of adding data.

 

Figure 2-1 Data addition flow chart

2.2.2 Data modification process

The process of data modification is similar to the process of data addition described above, as shown in Figure 2-2 .

 

Figure 2-2 Data modification flow chart

2.2.3 Data deletion process

If there is some useless data in the system , the relevant managers can also delete the data. Figure 2-3 is the flow chart for data deletion.

 

Figure 2-3 Data deletion flow chart

2.3 System function analysis

2.3.1 Functional analysis

According to the role of the farmland irrigation equipment management system, I divided it into the administrator management module.

Administrator management module:

(1) User management: Administrators can manage and control administrator information.

(2) Equipment management: The administrator can add, delete, modify and check the equipment information displayed in the farmland irrigation equipment management system in the background.

(3) Equipment storage management: Administrators can control the storage of equipment in the farmland irrigation equipment management system.

(4) Equipment outbound management: Under the "Equipment Outbound" menu, you can control the outbound equipment operated by managers.

(5) Operation parameter management: Administrators can add, delete, modify and check the operation parameter information displayed in the farmland irrigation equipment management system.

(6) Maintenance management: The administrator can add, delete, modify and check the maintenance information displayed in the farmland irrigation equipment management system.

2.3.2 Non-functional analysis

 The non-functional requirements of the farmland irrigation equipment management system include the security, reliability, performance, scalability, etc. of the farmland irrigation equipment management system. The details can be expressed in the following 3-1 table:

Table 3-1 Non-functional requirements table for  farmland irrigation equipment management system

safety

Mainly refers to the installation of the database of the farmland irrigation equipment management system. The use of the database and the setting of the password must comply with the standards.

reliability

Reliability means that the farmland irrigation equipment management system can be installed and operated according to the user's instructions. After testing, the reliability is more than 90%.

performance

Performance is a necessary condition for farmland irrigation equipment management systems to occupy the market, so it is best to have good performance.

Scalability

For example, the database reserves multiple attributes, such as the use of interfaces, to ensure the non-functional requirements of the system.

Ease of use

Users only need to follow the page display content of the farmland irrigation equipment management system to operate.

maintainability

 The maintainability of farmland irrigation equipment management system development is very important. After testing, there is no problem with maintainability.

2.4 System use case analysis

The administrator on the web background management maintains all data information in the entire farmland irrigation equipment management system. An example of the administrator role is shown in Figure 2-3.

 

Figure 2-3 Farmland irrigation equipment management system administrator role use case diagram

2.5 Summary of this chapter

This chapter mainly determines the functions to be realized by the entire farmland irrigation equipment management system through feasibility analysis, process analysis, functional requirements analysis, and system use case analysis of the farmland irrigation equipment management system. It also provides standards for code implementation and testing of farmland irrigation equipment management systems.

3 Overall design of farmland irrigation equipment management system

The main contents discussed in this chapter include the functional module design and database system design of the farmland irrigation equipment management system.

3.1 System architecture design

This farmland irrigation equipment management system is architecturally divided into three layers: presentation layer (UI), business logic layer (BLL) and data layer (DL).

Figure 3-1 System architecture design diagram of farmland irrigation equipment management system

 

Presentation layer (UI): Also known as the UI layer, it mainly completes the UI interaction function of the farmland irrigation equipment management system. A good UI can improve the user experience and enhance the user's comfort when using the farmland irrigation equipment management system. . The UI interface design must also adapt to different versions of farmland irrigation equipment management systems and different size resolutions to achieve good compatibility. The UI interaction function requirements are reasonable, and users must obtain consistent interaction results when performing interactive operations. This requires the presentation layer to be well connected with the business logic layer.

Business logic layer (BLL): mainly completes the data processing function of this farmland irrigation equipment management system. The data transmitted by the user from the presentation layer is processed by the business logic layer and delivered to the data layer. The data read by the system from the data layer is processed by the business logic layer and delivered to the presentation layer.

Data layer (DL): Since the data of this farmland irrigation equipment management system is placed in the mysql database on the server side, the parts that belong to the service layer can be directly integrated into the business logic layer, so there is only the database in the data layer, which is mainly completed The data storage and management functions of this farmland irrigation equipment management system.

3.2 System function module design

3.2.1 Overall functional module design

In the previous chapter, the functional requirements and non-functional requirements of the system were mainly analyzed, and the use cases in this farmland irrigation equipment management system were analyzed based on the requirements. Then the next step is to start designing the architecture, main functions and database of this farmland irrigation equipment management system. The farmland irrigation equipment management system is derived based on the demand analysis in the previous chapter. Its overall design module diagram is shown in Figure 3-2.

Figure 3-2 Function module diagram of farmland irrigation equipment management system

 

3.2.2Device management module design

The backend manager can add, delete, modify, and check backend device management operations. The structure diagram of the device management module is as follows:

 

Figure 3-3 Device management module structure diagram

3.2.3 Inspection and maintenance management module design

The backend manager can add, delete, modify and check the backend maintenance management. The structure diagram of the maintenance management module is as follows:

 

Figure 3-4 Structure diagram of inspection and maintenance management module

3.3 Database design

Database design generally includes three major processes: demand analysis, conceptual model design, and database table creation. The demand analysis has been explained in the previous chapter, and the conceptual model design has two parts: conceptual model and logical structure design.

3.3.1 Database conceptual structure design

The following is the main ER entity relationship diagram of the main database tables in the entire farmland irrigation equipment management system.

Figure 3-6 Overall ER relationship diagram of farmland irrigation equipment management system

 

According to the total ER diagram of the database of the farmland irrigation equipment management system, it can be concluded that the farmland irrigation equipment management system requires many ER diagrams. Here are some main database ER model diagrams.

 

Figure 3-7 Operation parameter ER relationship diagram

 

Figure 3-8 ER relationship diagram of equipment storage information

 

Figure 3-9 Equipment outbound management ER relationship diagram

 

Figure 3-10 Device management ER relationship diagram

3.3.2 Database logical structure design

From the total ER relationship diagram in the farmland irrigation equipment management system in the previous section, it can be concluded that a total of many data tables need to be created. Here I mainly list several major database table structure designs.

overhaul_and_maintenance表:

name

type

length

not null

primary key

Comment

overhaul_and_maintenance_id

int

11

yes

yes

Maintenance ID

equipment_model

varchar

64

yes

no

Device model

equipment_name

varchar

64

no

no

Device name

equipment_type

varchar

64

no

no

Equipment type

repair_personnel

varchar

64

no

no

Maintenance staff

maintenance_time

datetime

0

no

no

Maintenance time

maintenance_status

varchar

64

no

no

Maintenance status

maintenance_quantity

int

11

no

no

Repair quantity

equipment_picture

varchar

255

no

no

Equipment pictures

maintenance_details

text

0

no

no

Repair details

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

Update time

operating_parameters table:

name

type

length

not null

primary key

Comment

operating_parameters_id

int

11

yes

yes

Run parameter ID

equipment_model

varchar

64

yes

no

Device model

equipment_name

varchar

64

no

no

Device name

equipment_type

varchar

64

no

no

Equipment type

operator

varchar

64

no

no

operator

running_state_

varchar

64

no

no

Operating status

running_quantity

int

11

no

no

Number of runs

running_time

datetime

0

no

no

operation hours

equipment_picture

varchar

255

no

no

Equipment pictures

operating_parameters

text

0

no

no

Operating parameters

operation_details

text

0

no

no

Run details

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

Update time

equipment_warehousing表:

name

type

length

not null

primary key

Comment

equipment_warehousing_id

int

11

yes

yes

Equipment storage ID

equipment_model

varchar

64

no

no

Device model

equipment_name

varchar

64

no

no

Device name

equipment_type

varchar

64

no

no

Equipment type

equipment_specification

varchar

64

no

no

Equipment Specifications

warehousing_personnel

varchar

64

no

no

Warehousing personnel

receipt_quantity

int

11

no

no

Inbound quantity

warehousing_time

datetime

0

no

no

Storage time

equipment_picture

varchar

255

no

no

Equipment pictures

equipment_parameters

text

0

no

no

Device parameters

warehousing_remarks

text

0

no

no

Warehousing remarks

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

Update time

equipment_ex_warehouse表:

name

type

length

not null

primary key

Comment

equipment_ex_warehouse_id

int

11

yes

yes

Equipment delivery ID

equipment_model

varchar

64

no

no

Device model

equipment_name

varchar

64

no

no

Device name

equipment_type

varchar

64

no

no

Equipment type

equipment_specification

varchar

64

no

no

Equipment Specifications

ex_warehouse_personnel

varchar

64

no

no

Departure personnel

outbound_quantity

int

11

no

no

Outbound quantity

delivery_time

datetime

0

no

no

Delivery time

equipment_picture

varchar

255

no

no

Equipment pictures

equipment_parameters

text

0

no

no

Device parameters

ex_warehouse_remarks

text

0

no

no

Warehouse Remarks

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

Update time

device_management table:

name

type

length

not null

primary key

Comment

device_management_id

int

11

yes

yes

设备管理ID

equipment_model

varchar

64

设备型号

equipment_name

varchar

64

设备名称

equipment_type

varchar

64

设备类型

number_of_equipment

int

11

设备数量

equipment_specification

varchar

64

设备规格

equipment_picture

varchar

255

设备图片

equipment_parameters

text

0

设备参数

device_details_

text

0

设备详情

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

Upload表:

名称

类型

长度

不是null

主键

注释

upload_id

int

11

上传ID

name

varchar

64

文件名

path

varchar

255

访问路径

file

varchar

255

文件路径

display

varchar

255

显示顺序

father_id

int

11

父级ID

dir

varchar

255

文件夹

type

varchar

32

文件类型

Group表:

名称

类型

长度

不是null

主键

注释

group_id

mediumint

8

用户组ID

display

smallint

4

显示顺序

name

varchar

16

名称

description

varchar

255

描述

source_table

varchar

255

来源表

source_field

varchar

255

来源字段

source_id

int

10

来源ID

register

smallint

1

注册位置

create_time

timestamp

0

创建时间

update_time

timestamp

0

更新时间

3.4本章小结

整个农田灌溉设备管理系统的需求分析主要对系统总体架构以及功能模块的设计,通过建立E-R模型和数据库逻辑系统设计完成了数据库系统设计。

4农田灌溉设备管理系统 详细设计与实现

 农田灌溉设备管理系统 的详细设计与实现主要是根据前面的 农田灌溉设备管理系统 的需求分析和 农田灌溉设备管理系统 的总体设计来设计页面并实现业务逻辑。主要从 农田灌溉设备管理系统 界面实现、业务逻辑实现这两部分进行介

4.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;

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

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

            map.put("username", username);

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

        }

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

            map.put("email", email);

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

        }

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

            map.put("phone", phone);

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

        }else{

            return error(30000, "账号或密码不能为空");

        }

        if (resultList == null || password == null) {

            return error(30000, "账号或密码不能为空");

        }

        //判断是否有这个用户

        if (resultList.size()<=0){

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

        }

        User byUsername = (User) resultList.get(0);

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

        groupMap.put("name",byUsername.getUserGroup());

        List groupList = userGroupService.select(groupMap, new HashMap<>()).getResultList();

        if (groupList.size()<1){

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

        }

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

        //查询用户审核状态

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

            String sql = "select examine_state from "+ userGroup.getSourceTable() +" WHERE user_id = " + byUsername.getUserId();

            String res = String.valueOf(service.runCountSql(sql).getSingleResult());

            if (res==null){

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

            }

            if (!res.equals("已通过")){

                return error(30000,"该用户审核未通过");

            }

        }

        //查询用户状态

        if (byUsername.getState()!=1){

            return error(30000,"用户非可用状态,不能登录");

        }

        String md5password = service.encryption(password);

        if (byUsername.getPassword().equals(md5password)) {

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

            accessToken.setToken(UUID.randomUUID().toString().replaceAll("-", ""));

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

            JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(byUsername));

            user.put("token", accessToken.getToken());

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

            return error(30000, "账号或密码不正确");

        }

}

4.2管理员管理模块

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

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

 

图5-3管理员管理界面

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

public String encryption(String plainText) {

        String re_md5 = new String();

        try {

            MessageDigest md = MessageDigest.getInstance("MD5");

            md.update(plainText.getBytes());

            byte b[] = md.digest();

            int i;

            StringBuffer buf = new StringBuffer("");

            for (int offset = 0; offset < b.length; offset++) {

                i = b[offset];

                if (i < 0)

                    i += 256;

                if (i < 16)

                    buf.append("0");

                buf.append(Integer.toHexString(i));

            }

            re_md5 = buf.toString();

        } catch (Exception e) {

            e.printStackTrace();

        }

        return re_md5;

    }

4.3设备管理模块

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

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

设备管理流程图如下所示。

 

图5-4设备管理流程图

设备添加界面如下图所示。

 

图5-5设备添加界面

设备查询界面如下图所示。

 

图5-6设备查询界面

设备管理关键代码如下所示。

  @PostMapping("/add")

    @Transactional

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

        service.insert(service.readBody(request.getReader()));

        return success(1);

    }

    @Transactional

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

        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){

        StringBuffer sql = new StringBuffer("INSERT INTO ");

        sql.append("`").append(table).append("`").append(" (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            sql.append("`"+humpToLine(entry.getKey())+"`").append(",");

        }

        sql.deleteCharAt(sql.length()-1);

        sql.append(") VALUES (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            Object value = entry.getValue();

            if (value instanceof String){

                sql.append("'").append(entry.getValue()).append("'").append(",");

            }else {

                sql.append(entry.getValue()).append(",");

            }

        }

        sql.deleteCharAt(sql.length() - 1);

        sql.append(")");

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

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

        query.executeUpdate();

    }

4.4设备入库管理模块

删除设备入库时,选择需要删除的设备进行删除,把主键的uId传到HetongController控制器,再调用控制器的deleteHetong方法,数据经过HetongService业务层解析和处理,请求HetongMapper持久层调用deleteByPrimaryKey方法操作数据库将设备入库数据从数据库中删除。

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

设备入库管理流程图如下所示。

 

图5-7设备入库管理流程图

设备入库添加界面如下图所示。

 

图5-8设备入库添加界面

设备入库管理关键代码如下所示。

@RequestMapping(value = "/del")

    @Transactional

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

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

        return success(1);

}

    @Transactional

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

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

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

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

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

        query1.executeUpdate();

    }

4.5检修维护管理模块

管理员选择添加检修维护,管理员在yifang_list查看检修维护,点击检修维护,跳转至zijinshoufu_add.Java,添加检修维护记录则将添加的检修维护记录数据封装在HashMap中,然后调用CommDAO的insert方法将检修维护记录内容插入检修维护记录表中。

检修维护管理流程图如下所示。

 

图5-9检修维护管理流程图

检修维护添加界面如下图所示。

 

图5-10检修维护添加界面

检修维护管理关键代码如下所示。

@PostMapping("/set")

@Transactional

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

        service.update(service.readQuery(request), service.readConfig(request), service.readBody(request.getReader()));

        return success(1);

}

    public Map<String,String> readConfig(HttpServletRequest request){

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

        map.put(FindConfig.PAGE,request.getParameter(FindConfig.PAGE));

        map.put(FindConfig.SIZE,request.getParameter(FindConfig.SIZE));

        map.put(FindConfig.LIKE,request.getParameter(FindConfig.LIKE));

        map.put(FindConfig.ORDER_BY,request.getParameter(FindConfig.ORDER_BY));

        map.put(FindConfig.FIELD,request.getParameter(FindConfig.FIELD));

        map.put(FindConfig.GROUP_BY,request.getParameter(FindConfig.GROUP_BY));

        map.put(FindConfig.MAX_,request.getParameter(FindConfig.MAX_));

        map.put(FindConfig.MIN_,request.getParameter(FindConfig.MIN_));

        return map;

}

    public Map<String,String> readQuery(HttpServletRequest request){

        String queryString = request.getQueryString();

        if (queryString != null && !"".equals(queryString)) {

            String[] querys = queryString.split("&");

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

            for (String query : querys) {

                String[] q = query.split("=");

                map.put(q[0], q[1]);

            }

            map.remove(FindConfig.PAGE);

            map.remove(FindConfig.SIZE);

            map.remove(FindConfig.LIKE);

            map.remove(FindConfig.ORDER_BY);

            map.remove(FindConfig.FIELD);

            map.remove(FindConfig.GROUP_BY);

            map.remove(FindConfig.MAX_);

            map.remove(FindConfig.MIN_);

            return map;

        }else {

            return new HashMap<>();

        }

}

    @Transactional

    public void update(Map<String,String> query,Map<String,String> config,Map<String,Object> body){

        StringBuffer sql = new StringBuffer("UPDATE ").append("`").append(table).append("`").append(" SET ");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            Object value = entry.getValue();

            if (value instanceof String){

                sql.append("`"+humpToLine(entry.getKey())+"`").append("=").append("'").append(value).append("'").append(",");

            }else {

                sql.append("`"+humpToLine(entry.getKey())+"`").append("=").append(value).append(",");

            }

        }

        sql.deleteCharAt(sql.length()-1);

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

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

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

        query1.executeUpdate();

}

    public String toWhereSql(Map<String,String> query, Boolean like) {

        if (query.size() > 0) {

            try {

                StringBuilder sql = new StringBuilder(" WHERE ");

                for (Map.Entry<String, String> entry : query.entrySet()) {

                    if (entry.getKey().contains(FindConfig.MIN_)) {

                        String min = humpToLine(entry.getKey()).replace("_min", "");

                        sql.append("`"+min+"`").append(" >= '").append(URLDecoder.decode(entry.getValue(), "UTF-8")).append("' and ");

                        continue;

                    }

                    if (entry.getKey().contains(FindConfig.MAX_)) {

                        String max = humpToLine(entry.getKey()).replace("_max", "");

                        sql.append("`"+max+"`").append(" <= '").append(URLDecoder.decode(entry.getValue(), "UTF-8")).append("' and ");

                        continue;

                    }

                    if (like == true) {

                        sql.append("`"+humpToLine(entry.getKey())+"`").append(" LIKE '%").append(URLDecoder.decode(entry.getValue(), "UTF-8")).append("%'").append(" and ");

                    } else {

                        sql.append("`"+humpToLine(entry.getKey())+"`").append(" = '").append(URLDecoder.decode(entry.getValue(), "UTF-8")).append("'").append(" and ");

                    }

                }

                sql.delete(sql.length() - 4, sql.length());

                sql.append(" ");

                return sql.toString();

            } catch (UnsupportedEncodingException e) {

                log.info("拼接sql 失败:{}", e.getMessage());

            }

        }

        return "";

    }

4.6个人资料模块

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

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

 

图5-11密码修改流程图

个人信息界面如下图所示。

 

图5-12个人信息界面图

修改密码界面如下图所示。

 

图5-13修改密码界面图

修改密码逻辑代码如下所示。

/**

     * 修改密码

     * @param data

     * @param request

     * @return

     */

    @PostMapping("change_password")

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

        // 根据Token获取UserId

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

        Integer userId = tokenGetUserId(token);

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

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

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

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

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

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

        List list = ret.getResultList();

        Object s = list.get(0);

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

        if(count > 0){

            // 修改密码

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

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

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

            return success(1);

        }

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

    }

5系统测试

5.1系统测试的目的

系统开发到了最后一个阶段那就是系统测试,系统测试对软件的开发其实是非常有必要的。因为没什么系统一经开发出来就可能会尽善尽美,再厉害的系统开发工程师也会在系统开发的时候出现纰漏,系统测试能够较好的改正一些bug,为后期系统的维护性提供很好的支持。通过系统测试,开发人员也可以建立自己对系统的信心,为后期的系统版本的跟新提供支持。

5.2 系统测试用例

系统测试包括:设备展示功能测试、设备添加、设备搜索、密码修改功能测试,如表5-1、5-2、5-3、5-4所示:

设备查看功能测试:

表5-1 设备查看功能测试表

用例名称

设备查看

目的

测试设备查看功能

前提

用户登录

测试流程

点击设备列表

预期结果

可以查看到所有设备信息

实际结果

实际结果与预期结果一致

管理员添加设备界面测试:

表5-2管理员添加设备界面测试表

用例名称

设备发布测试用例

目的

测试设备发布功能

前提

用户正常登录情况下

测试流程

1)点击设备信息管理就,然后点击添加后并填写信息。

2)点击进行提交。

预期结果

提交以后,页面首页会显示新的设备信息 

实际结果

实际结果与预期结果一致

设备搜索功能测试:

表5-3设备搜索功能测试表

用例名称

设备搜索测试

目的

测试设备搜索功能

前提

测试流程

1)在搜索框填入搜索关键字。

2)点击搜索按钮。

预期结果

页面显示包含有搜索关键字的设备

实际结果

实际结果与预期结果一致

密码修改功能测试:

表5-4密码修改功能测试表

用例名称

密码修改测试用例

目的

测试管理员密码修改功能

前提

管理员用户正常登录情况下

测试流程

1)管理员密码修改并完成填写。

2)点击进行提交。

预期结果

使用新的密码可以登录

实际结果

实际结果与预期结果一致

5.3 系统测试结果

通过编写 农田灌溉设备管理系统的测试用例,已经检测完毕设备查看模块、设备添加模块、设备搜索模块、密码修改功能测试,通过这4大模块为农田灌溉设备管理系统的后期推广运营提供了强力的技术支撑。

结论

至此,农田灌溉设备管理系统已经结束,在开发前做了许多的准备,在本系统的设计和开发过程中阅览和学习了许多文献资料,从中我也收获了很多宝贵的方法和设计思路,对系统的开发也起到了很重要的作用,系统的开发技术选用的都是自己比较熟悉的,比如Web、springboot技术、MYSQL,这些技术都是在以前的学习中学到了,其中许多的设计思路和方法都是在以前不断地学习中摸索出来的经验,其实对于我们来说工作量还是比较大的,但是正是由于之前的积累与准备,才能顺利的完成这个项目,由此看来,积累经验跟做好准备是十分重要的事情。

当然在该系统的设计与实现的过程中也离不开老师以及同学们的帮助,正是因为他们的指导与帮助,我才能够成功的在预期内完成了这个系统。同时在这个过程当中我也收获了很多东西,此系统也有需要改进的地方,但是由于专业知识的浅薄,并不能做到十分完美,希望以后有机会可以让其真正的投入到使用之中。

参考文献

[1]吴昊鹏,班剑锋,李建华.一种基于MR的电解槽设备辅助管理系统的实现方法[J].机械与电子,2022,40(03):40-44.

[2]陆昕,苏立清,曹耀兵. 一种数据处理的方法、多云管理系统以及相关设备[P]. 广东省:CN112104697B,2022-03-04.

[3]张诚,张杰,吴智晖,张斌.浅谈天然气净化厂设备综合管理系统应用及发展趋势[J].中国设备工程,2022(04):82-83.

[4]孙存虎.基于物联网的机械设备安全管理系统研究[J].河南科技,2022,41(04):21-24.DOI:10.19968/j.cnki.hnkj.1003-5168.2022.04.004.

[5]李博.基于物联网的设备停机管理系统设计及实现[J].物联网技术,2022,12(02):86-88.DOI:10.16667/j.issn.2095-1302.2022.02.023.

[6]张楠,何敏,孙有恒,郭雪卿,胡振中.基于BIM的地铁施工设备物资精细化管理系统[J/OL].施工技术(中英文):1-7[2022-03-30].http://kns.cnki.net/kcms/detail/10.1768.TU.20220210.1624.002.html

[7]熊柏祥.基于Springboot和Vue框架的考试资源服务平台的设计与实现[J].信息与电脑(理论版),2022,34(01):97-99+103.

[8]毛烁. 镭立设备管理系统助力生产经营企业“降本增效”[N]. 中国信息化周报,2021-12-06(017).DOI:10.28189/n.cnki.ndnjy.2021.000570.

[9]郑文国,安剑奇,董文佳,尹枫,岑延卓. 基于B/S网络架构的设备加工型企业管理系统的研究与实现[C]//.2021中国自动化大会论文集.,2021:162-166.DOI:10.26914/c.cnkihy.2021.053498.

[10]喻佳,吴丹新.基于SpringBoot的Web快速开发框架[J].电脑编程技巧与维护,2021(09):31-33.DOI:10.16184/j.cnki.comprg.2021.09.013.

[11]巢晟盛.基于SpringBoot微服务架构下前后端分离的MVVM模型浅析[J].电脑知识与技术,2021,17(23):128-129+141.DOI:10.14004/j.cnki.ckt.2021.2412.

[12]赵志威,张生月,蒋应举,屠晓光.基于SpringBoot的高新技术企业创新能力评价平台设计与实现[J].现代信息科技,2021,5(15):40-42.DOI:10.19850/j.cnki.2096-4706.2021.15.011.

[13]向福川,方玉,刘浪,唐振云,练瑶.基于SpringBoot+Vue框架的协同育才系统设计与开发[J].现代信息科技,2021,5(14):5-7+12.DOI:10.19850/j.cnki.2096-4706.2021.14.002.

[14]崔灿. 预防性维护设备管理系统研究[D].湖北工业大学,2021.DOI:10.27131/d.cnki.ghugc.2021.000447.

[15]鲁文行. 基于组态软件的印刷包装设备监控管理系统研究[D].西安理工大学,2021.DOI:10.27398/d.cnki.gxalu.2021.001270.

[16]Fuyuan Cheng. Talent Recruitment Management System for Small and Micro Enterprises Based on Springboot Framework[J]. Advances in Educational Technology and Psychology,2021,5(2).

[17]方璐, 云智实验设备管理系统. 河南省,泛锐云智科技,2021-02-01.

[18]Jian Chen,Chen Jian,Pan Hailan. Design of Man Hour Management Information System on SpringBoot Framework[J]. Journal of Physics: Conference Series,2020,1646(1).

[19]GB/T 37693-2019, 信息技术 基于感知设备的工业设备点检管理系统总体架构[S].

[20]Zhao Xiaoxu. Application of spacecraft manufacturing equipment management system[P]. Beijing Institute of Spacecraft Environment Engineering (China);South China Univ. of Technology (China);Guangdong Academy of International Academic Exchange (China),2021.

                                                                      致  谢

逝者如斯夫,不舍昼夜。转眼间,大用户用户活便已经接近尾声,人面对着离别与结束,总是充满着不舍与茫然,我亦如此,仍记得那年秋天,我迫不及待的提前一天到了学校,面对学校巍峨的大门,我心里充满了期待:这里,就是我新生活的起点吗?那天,阳光明媚,学校的欢迎仪式很热烈,我面对着一个个对着我微笑的同学,仿佛一缕缕阳光透过胸口照进了我心里,同时,在那天我认识可爱的室友,我们携手共同度过了这难忘的两年。如今,我望着这篇论文的致谢,不禁又要问自己:现在,我们就要说再见了吗?

感慨莫名,不知所言。遥想当初刚来学校的时候,心里总是想着工科学校会过于板正,会缺乏一些柔情,当时心里甚至有一点点排斥,但是随着我对学校的慢慢认识与了解,我才认识到了她的美丽,她的柔情,并且慢慢的喜欢上了这个校园,但是时间太快了,快到我还没有好好体会她的美丽便要离开了,但是她带给我的回忆,永远不会离开我,也许真正离开那天我的眼里会满含泪水,我不是因为难过,我只是想将她的样子映在我的泪水里,刻在我的心里。最后,感谢我的老师们,是你们教授了我们知识与做人的道理;感谢我的室友们,是你们陪伴了我如此之久;感谢每位关心与支持我的人。

少年,追风赶月莫停留,平荒尽处是春山。

免费领取本源代码,请关注点赞+私信

Guess you like

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