(Source code attached) Springboot + Ziyang Agricultural Products Promotion System APP Computer Graduation Setup 40177

Summary

Today, with the rapid development of information, the Internet has become an important platform for people to exchange information. A large number of agricultural products need to be released through the Internet every day. To this end, I have developed an agricultural product promotion system based on Android mode.

For the design of this agricultural product promotion system, it mainly uses Java language and springboot framework in the background. It uses mysql database, Android and other technologies for dynamic programming and databases to study hard and practice a lot, and it is applied to the construction of APP. The design of the entire system is developed based on the current status of the online agricultural product promotion system. The networked management of the online agricultural product promotion system is implemented specifically based on user needs. All types of information are stored in an orderly manner. After entering the agricultural product promotion system page, You can start operating the main control interface. The system functions include the administrator server: backend homepage, site management (carousel chart, bulletin board) user management (administrator, system user) content management (community sharing, sharing classification) mall management (products) information, category list, order list); user client: home page, news information, mine (ride booking information, order making information, passenger orders, order grabbing information) and other functions.

This paper mainly describes the development background of the agricultural product promotion system. This system mainly introduces the demand analysis and functional requirements, and makes a detailed test and summary of the system. Specifically, it covers various issues such as business processes, database design and system structure. It is hoped that advanced computer technology and network technology can be used to change the current management status of the agricultural product promotion system and improve management efficiency.

Keywords: agricultural product promotion system; Android technology; Mysql database; Java language 

Abstract

With the rapid development of information, the network has become an important information exchange platform. A large number of agricultural products need to be released online every day. For this reason, I developed an agricultural product promotion system based on Android mode.

As for the design of this agricultural product promotion system, it mainly adopts java language and spring boot framework in the background. It uses mysql database, Android and other technologies for dynamic programming and database for hard learning and a lot of practice, and has been applied to the construction of APP in the design of the whole system, specifically according to the current situation of online agricultural product promotion system, The online agricultural product promotion system shall be managed in a network way according to user requirements. All kinds of information shall be stored orderly. After entering the agricultural product promotion system page, the main control interface can be operated. The system functions include administrator server: background home page Site management (broadcast map, bulletin board) User management (administrator, system user) Content management (community sharing, sharing classification) Mall management (commodity information, classification list, order list); User client: Home page, news information, My (car hailing information, voucher preparation information, passenger order, order grabbing information) and other functions.

This paper mainly describes the development background of the agricultural product promotion system, which mainly introduces the demand analysis and functional requirements, and makes a detailed test and summary of the system. Specifically from the business process, database design and system structure and other aspects. We hope that we can use advanced computer technology and network technology to change the current management situation of agricultural product extension system and improve the management efficiency.

Key words: Ziyang agricultural product extension system; Android technology; MySQL database; Java Language

Table of contents

1 Overview

1.1 Research background

1.2 Research significance

1.3 Main work of this topic

2 System development environment

2.1 java technology

2.2 Mysql database

2.3 Android technology

2.4 Introduction to spring boot framework

3 System analysis

3.1 Feasibility analysis

3.1.1 Technical feasibility

3.1.2 Operational feasibility

3.1.3 Economic feasibility

3.1.4 Legal feasibility

3.2 System process analysis

3.2.1 System development process

3.2.2 User login process

3.2.3 System operation process

3.2.4 Add information process

3.2.5 Modify information flow

3.2.6 Information deletion process

3.3 Use case analysis

3.4 System process analysis

3.4.1 Add information process

3.4.2 Operation process

3.4.3 Deletion of information process

4System Overview

4.1 System structure design

4.2 Database design

4.2.1 Database design principles

4.2.2 Database entities

4.3 Database design principles

4.3.1 Database table design

5 system interface implementation

5.1 Login

5.2 Administrator function module

5.3 User client function module

6 system test

6.1 The significance of system testing

6.2 Test methods

6.3 Test analysis

in conclusion

Thanks

references

1 Overview

1.1 Research background

System management will also be carried out through computers for overall intelligent operation. The agricultural product promotion system involves a lot of management and data storage, such as administrator; home page, site management (carousel chart, bulletin board) user management (management Members, system users) content management (community sharing, sharing categories) mall management (product information, category list, order list) , users; homepage, orders, shopping cart, community sharing, mine (basic information, delivery address, collection , orders, shopping carts), etc., which brings huge challenges to the work of managers. In the face of a large amount of information, traditional management systems all collect statistics of detailed information through notes. Later, computers appeared, and through computers Input software counts paper information to the computer. This method is relatively traditional, and it is troublesome to collect statistical information. It is also affected by time and space. Therefore, an agricultural product promotion system was developed for this purpose ; it provides users with convenient management. The platform is convenient for administrators to view and maintain, and can edit and maintain content according to requirements; for users , they can query the required information at any time , and administrators can obtain system data information, etc. without leaving home. , and it can also save users a lot of time, so the development of agricultural product promotion system brings great convenience to managers, and it also facilitates administrators to process user information.

This paper's agricultural product promotion system mainly involves programs, databases and computer technology. Covering a wide range of knowledge can greatly improve the work efficiency of system personnel .

1.2 Research significance

With the continuous development of the domestic economic situation, China's Internet has entered a rare period of peak development, which has caused Chinese and foreign capitalists to turn to the Internet market. However, the unreasonable structure, shortage of personnel and the increase in market management needs in many management fields have made more people aware of Internet management.

In today's highly developed information, information management reform has become a more extensive and comprehensive trend. The " agricultural product promotion system " is based on Mysql database and implemented on the basis of springboot framework programming. In order to ensure the sustainable development of China's economy, the information age is increasingly updated, and the service industry is still booming . At the same time, with the rapid development of the information society, various management systems are faced with more and more data that need to be processed. How to enable managers to query, store, manage and share effective data in the vast data ocean in a convenient and fast way? Information has important practical significance for our study, work and life. Therefore, academic circles at home and abroad have conducted in-depth and extensive research on this, and a new research field- agricultural product promotion system was born.

1.3 Main work of this topic

At the beginning, this article gives an overall description of the basic knowledge discussed in the system, and conducts a system analysis on this basis. In order to enable this system to be designed and implemented in a better and more complete manner, analysis and investigation must be conducted first. Based on the previous related foundations, a detailed analysis of the new system was carried out in terms of functionality. Then through detailed analysis, system design was carried out. Secondly, in terms of the feasibility of system implementation, I chose Android technology for development and design. For data storage, I used Mysql database for design. Since both Android and Mysql are very mature, they are very reliable, safe and practical in all aspects. Finally, the system is tested, perfected and released.

2 System development environment  

2.1 java technology

The Java language was released by Sun at the end of the 20th century, and the source code was open. This advantage attracted many outstanding programming enthusiasts from all over the world, and also enabled them to develop classic and fun games one after another at that time. The Java language is one of the pure object-oriented languages. From the early days of its release to the present, it can be said that it has a history of nearly 20 years and has developed into a profound influence in the history of human computer programming language development.

The Java language has a variety of features: (1) Cross-platform independence; (2) Object-oriented; (3) Security is guaranteed; (4) Supports multiple tasks; (5) Multiple writing methods, code writing Simple. Compared with other low-level languages ​​and high-level languages, the Java language has obvious advantages and broad prospects in the future. It can be widely used in personal laptops, big data, large-scale games, etc.

First of all, the Java language has object-oriented characteristics and is easy to understand. Regarding objects, it can actually be understood that every thing is an object, including us humans. Utilize the basic characteristics of object-oriented languages ​​to solve practical problems in software development and provide technical support for effective software development.

Secondly, the Java language has good cross-platform independence. The application program written is written in Java language, so there is no need to use a compiler to modify the program code, and it can be run directly on any computer system, including Windows systems and Linux systems, that is, after one compilation , can run everywhere, so the Java language has excellent portability and can be implemented well across platforms.

2. 2  Mysql database

The mysql database has many advantages, such as its easy-to-understand operation, powerful functions, and high information storage capacity. Therefore, it is widely used by people. For mysql database, it is generally mainly used for encoding and querying data, and it is applied to this database in many designs. In this process, we can query and combine conventional data, so When we use the mysql database, we only need to write a small piece of data to achieve the corresponding function. A database is a storage room for data storage, but the data is stored on a computer instead of a real storage room. The data is stored in a fixed format, not disordered. The definition is: a fixed format for a long time. Storage on computer memory that can be shared. Database management mainly includes the establishment of data tables, data storage, modification and addition of data. In order to ensure that the database system can operate normally, the management work carried out by relevant personnel. The establishment of the data table can adjust the data in the data table, recombine and reconstruct the data to ensure the security of the data.

2.3 Android technology

Android is an operating system based on the Linux kernel. It was developed by Google in the early days and later by the Open Handset Alliance. It adopts a software heap architecture and is mainly divided into three parts. The bottom layer is based on the Linux kernel and only provides basic functions; other application software is developed by each company, using Java as part of the program. In addition, in order to promote this technology, Google and dozens of other mobile phone companies established the Open Mobile Alliance. Android was often rumored to be GPhone before it was made public.

It adopts a software stack (also known as software stack) architecture, which is mainly divided into three parts: the bottom layer is based on the Linux core, developed in C language, and only provides basic functions. The middle layer includes the function library Library and the virtual machine Virtual Machine, which is developed in C++. The top layer is various application software, including call programs, text message programs, etc. The application software is developed by each company and written in Java.

2.4 Introduction to spring boot framework

The Spring framework is an open source application framework on the Java platform that provides a container with control inversion characteristics. Although the Spring framework itself has no restrictions on the programming model, its frequent use in Java applications made it so popular that it was later used as a supplement or even a substitute for the EJB (Enterprise JavaBeans) model. The Spring framework provides a series of solutions for development, such as utilizing the core features of inversion of control and implementing inversion of control through dependency injection to implement containerization of the managed object life cycle, using aspect-oriented programming for declarative transaction management, and integration A variety of persistence technologies manage data access, provide a large number of excellent web frameworks to facilitate development, and so on. The Spring framework has the Inversion of Control (IOC) feature. IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through Java's reflection mechanism. The Spring framework uses containers to manage the life cycle of objects. The container can configure objects by scanning XML files or specific Java annotations on classes. Developers can obtain objects through dependency lookup or dependency injection. The Spring framework has an aspect-oriented programming (AOP) framework. The Spring AOP framework is based on the proxy mode and is configurable at runtime; the AOP framework mainly modularizes cross-concerns between modules. The AOP framework of the Spring framework only provides basic AOP features. Although it cannot be compared with the AspectJ framework, it can also meet basic needs through integration with AspectJ. Transaction management, remote access and other functions under the Spring framework can be realized by using Spring AOP technology. Spring's transaction management framework brings an abstraction mechanism to the Java platform that enables local and global transactions, as well as nested transactions, to work with savepoints and in almost any environment on the Java platform. Spring integrates a variety of transaction templates. The system can configure transactions through transaction templates, XML or Java annotations, and the transaction framework integrates functions such as messaging and caching. Spring's data access framework solves common difficulties developers encounter when using databases in their applications. It not only provides support for all popular data access frameworks such as Java: JDBC, iBATS/MyBATIs, Hibernate, Java Data Objects (JDO), ApacheOJB and ApacheCayne, but can also be used with Spring's transaction management to provide data access. Flexible abstraction. The Spring framework did not initially intend to build its own Web MVC framework . During the development process, its developers believed that the separation between the presentation layer and the request processing layer of the existing StrutsWeb framework, as well as between the request processing layer and the model, was not enough, so they created SpringMVC.

3 System analysis

The so-called system analysis is that the administrator obtains information through communication with the user client, and then displays this information to users and developers in the form of requirements specifications. In the long history of the development of software functions, for a long time, especially in the beginning, the importance of requirements analysis was not recognized by people. For example, at that time, the American company IBM developed an information management system for British Telecom. Development started without clarity, and the initial construction period was one year. Due to unclear requirements, the construction period was delayed by more than half a year, causing huge losses. This situation also exists in many of our software companies. They develop while developing, and even without clear communication with customers, directly copy the same type of projects and make changes. As a result, when the system is accepted, changes are made again, resulting in a loss of manpower and material resources. A huge waste. The reason for all these consequences is that the demand acquisition is not timely, unclear, and incomplete.

3.1 Feasibility analysis

The main goal of the agricultural product promotion system APP is to realize related information management services such as community sharing, product information, classification lists, and order lists. After determining the goals, we conduct a feasibility analysis on whether the goals of this system can be achieved from the following four aspects.

3.1.1 Technical feasibility

The APP Ziyang agricultural product promotion system mainly uses Android technology, Java language, and Mysql database. The development of applications requires complete functions, simple use, and the establishment of a database with complete, safe and stable data. The development technology of the agricultural product promotion system APP is highly feasible, and the developers have mastered certain development technologies, so the development of the system is feasible.

3.1.2 Operational feasibility

The login interface of the APP Ziyang Agricultural Products Promotion System is simple and easy to operate. It uses a common interface window to log in to the interface and access the operation through a computer. Users can access the operation as long as they have used a computer in daily life. The development of this system uses Android development, and the background is combined with Java language. These development environments make the system more complete. This system has the characteristics of easy operation, easy management, good interactivity, and is very simple in operation. Therefore this system can be developed.

3.1.3 Economic feasibility

The agricultural product promotion system APP is based on the B/S model and Java technology on the server side. The client uses Android and Mysql database to store data. The required hardware and software environment are easy to purchase in the market. Program development is mainly the development of the management system. And maintenance. Therefore, the program does not require high development manpower and financial resources, and the system is not very complex, the development cycle is short, and it has high economic feasibility.

3.1.4 Legal feasibility

This agricultural product promotion system APP is a self-designed management system and has great practical significance. Because both the software and the database use open source code, the development and design of this system does not have problems such as infringement and is completely legally feasible.

In summary, the agricultural product promotion system APP is technically, economically, operationally and legally feasible, and it is feasible to develop this program.

3.2 System process analysis

3.2.1 System development process

When developing the Ziyang agricultural product promotion system, we first conduct a demand analysis, and then conduct an overall design plan for the system, design system functional modules, database selection, etc. The development process of this system is shown in Figure 3-1.

Figure 3-1 System development flow chart

3.2.2 User login process

In order to ensure the security of the system, if you want to use this system to manage system information, you must first log in to the system. As shown in Figure 3-3.

Figure 3-2 Login flow chart

3.2.3 System operation process

After the user opens the client and enters the system, the login interface will be displayed first, and the correct user name and password will be entered. The system will automatically detect the information. If the information is correct, the user will enter the system function interface and perform operations. Otherwise, an error will be displayed and the user cannot log in. The operation The process is shown in Figure 3-3.

Figure 3-3 System operation flow chart

3.2.4 Add information process

Administrators can add, delete, and modify user information, etc. Users can also add, delete, modify, etc. the information within their own authority. After entering the information, the system will verify the entered information and data on its own. If If the information is correct, it will be added to the database. If the information is incorrect, you will be prompted to re-enter the information. The process of adding information is shown in Figure 3-4.

Figure 3-4 Add information flow chart

3.2.5 Modify information flow

Administrators can modify information such as job information, job recommendations, etc. Users can also modify information within their own authority. First, enter the modification information interface and enter the modification information data. The system will judge and verify the data. If the modified information is legal, modify it. If successful, the information is updated to the database. If the information is illegal, the modification fails and needs to be re-entered. The modified information flow chart is shown in Figure 3-5.

Figure 3-5 Modify information flow chart

3.2.6 Information deletion process

Administrators can delete information in job information management, system management, etc. After selecting the information to be deleted, click the delete button, and the system will ask if you are sure. If you click OK, the system will delete the selected information and The information is deleted in the database. The flow chart of deleting information is shown in Figure 3-6.

Figure 3-6 Deletion information flow chart

3.3Use case analysis

1. Ordinary users mainly use the system’s agricultural product promotion APP to publish product information. The figure below shows the use case diagram of ordinary users.

Figure 3-1 Common user use case diagram

3. The administrator is mainly responsible for homepage and site management (carousel, bulletin board) user management (administrator, system user) content management (community sharing, sharing classification) mall management (product information, classification list, order list), and The figure shows a use case diagram describing an administrator.

Figure 3-3 Administrator use case diagram

3.4System process analysis

3. 4. 1 Add information process

Add information, the numbering system uses the automatic numbering mode, there is no user to fill in, the user adds information and enters the information, the system will automatically confirm the information and data, the successful verification is that the valid information is added to the database, if the information is invalid, re-enter the information. The process of adding information is shown in Figure 3-3 .

Figure 3-3 Add  information flow chart

3. 4. 2 Operation process

If a user wants to enter the system, he must first enter the system login interface, enter the correct user name and password, and select the login type to log in. The system will check the login information, and if the information is correct, then enter the corresponding function interface, and it will prompt that the information is incorrect and the login failed. The system operation flow is shown in Figure 3-4 .

Figure 3-4 Operation flow chart

3.4.3Delete information process

The user selects the information to be deleted and clicks the Delete button. The system prompts whether to delete the information. If the user wants to delete the information, the system will delete the information. System database delete information. The flow chart of deleting information is shown in Figure 3-5.

Figure 3-5  Deletion information flow chart

4System Overview

After the system analysis, we begin to memorize system design. System design includes overall design and detailed design. The overall design is just a general design. After the overall design, we can divide some things of the system, such as files, documents, data, etc. And through the overall design, we can roughly divide the modules and functions of the program. But it is only a preliminary classification and has no real implementation.

The overall design is just a preliminary design. Moreover, for a project, we can carry out multiple overall designs. Through comparison, including performance comparison, cost comparison, and benefit comparison, we can finally determine an optimal design plan and choose the best one. The overall design can reduce development costs and increase company benefits. From this point of view, the overall design is still very important.

The working principle diagram of the agricultural product promotion system is shown in Figure 4-1:

Figure 4-1 System working principle diagram

4. 1  System structure design

The system architecture diagram belongs to the system design stage. The system architecture diagram is only a product of this stage. The overall architecture of the system determines the model of the entire system and is the foundation of the system. The overall structural design based on the agricultural product promotion system is shown in Figure 4-2.

Figure 4-2 System structure diagram

4. 2 Database design

Database is the basis of computer information system. At present, the key and core part of the computer system is the database. The quality of database development has a direct impact on the quality and speed of the entire system.

4.2.1 Database design principles

The conceptual model is mainly based on the analysis of data requirements. It usually uses a conceptual data model to represent the relationship between various data, and processes and manages information for system users. At the same time, it establishes an ER diagram to represent specific Entities, attributes, and relationships.

4.2.2 Database entities

4. 3  Database design principles

The applications of each database are separated from each other. When running into a certain program, it will communicate with the client through its own related protocols. Then this system will connect these data. When we choose which segment, we will briefly describe how the database is created. When you click the Finish button, the name of the data source will automatically pop up in the dialog box. Just click Next and directly enter the corresponding authentication and login password. 

Data process of agricultural products sales website :

Figure 4-4 System   data flow chart

The entity ER diagram of Ziyang agricultural product promotion system is shown in Figure 4.5 .

Figure 4.5 Entity ER diagram

4.3. 1  Database table design

The table information of the database is part of the design. The detailed information of each table in the database is introduced below.

address

Field Name

type

length

not null

primary key

Field description

address_id

int

11

yes

primary key

Shipping address

name

varchar

32

no

Name

phone

varchar

13

no

cell phone

postcode

varchar

8

no

post code

address

varchar

255

yes

address

user_id

mediumint

8

yes

User ID

create_time

timestamp

0

yes

creation time

update_time

timestamp

0

yes

Update time

default

tinyint

1

yes

Default judgment

cart

Field Name

type

length

not null

primary key

Field description

cart_id

int

11

yes

primary key

Cart ID

title

varchar

64

no

title

img

varchar

255

yes

picture

user_id

int

10

yes

User ID

create_time

timestamp

0

yes

creation time

update_time

timestamp

0

yes

Update time

state

int

1

yes

state

price

double

8

yes

unit price

price_ago

double

8

yes

original price

price_count

double

10

yes

total price

num

int

8

yes

quantity

goods_id

mediumint

8

yes

Product id

type

varchar

64

yes

Categories

description

varchar

255

no

describe

chart

Field Name

type

length

not null

primary key

Field description

chart_id

int

10

yes

primary key

Chat ID

user_id

int

11

yes

User ID

title

varchar

64

no

title

content

longtext

0

yes

content

nickname

varchar

32

yes

Nick name

avatar

varchar

255

no

avatar

create_time

timestamp

0

yes

creation time

update_time

timestamp

0

yes

Update time

reply_id

int

11

yes

Reply ID

goods_type

Field Name

type

length

not null

primary key

Field description

type_id

int

11

yes

primary key

Product category ID

father_id

smallint

5

yes

Parent category ID

name

varchar

255

no

product name

desc

varchar

255

no

describe

icon

varchar

255

no

icon

source_table

varchar

255

no

Source table

source_field

varchar

255

no

Source field

create_time

timestamp

0

yes

creation time

update_time

timestamp

0

yes

Update time

notice

Field Name

type

length

not null

primary key

Field description

notice_id

mediumint

8

yes

primary key

Announcement id

title

varchar

125

yes

title

content

longtext

0

no

text

create_time

timestamp

0

yes

creation time

update_time

timestamp

0

yes

Update time

order

Field Name

type

length

not null

primary key

Field description

order_id

int

11

yes

primary key

Order ID

order_number

varchar

64

no

order number

goods_id

mediumint

8

yes

Product id

title

varchar

32

no

Product title

img

varchar

255

no

product picture

price

double

10

yes

price

price_ago

double

10

yes

original price

num

int

8

yes

quantity

price_count

double

8

yes

total price

norms

varchar

255

no

Specification

type

varchar

64

yes

Categories

contact_name

varchar

32

no

Contact name

contact_email

varchar

125

no

Contact email

contact_phone

varchar

11

no

Contact mobile phone

contact_address

varchar

255

no

Recipient address

postal_code

varchar

9

邮政编码

user_id

int

10

买家ID

merchant_id

mediumint

8

商家ID

create_time

timestamp

0

创建时间

update_time

timestamp

0

更新时间

description

varchar

255

描述

state

varchar

16

订单状态

product_information

字段名称

类型

长度

不是null

主键

字段说明

product_information_id

int

11

主键

商品信息ID

article_no

varchar

64

商品编号

place_of_production

varchar

64

生产地

recommend

int

11

智能推荐

cart_title

varchar

125

商品标题

cart_img

text

0

封面图

cart_description

varchar

255

描述

cart_price_ago

double

8

原价

cart_price

double

8

卖价

cart_inventory

int

11

商品库存

cart_type

varchar

64

商品分类

cart_content

longtext

0

正文产品的主体内容

cart_img_1

text

0

主图1

cart_img_2

text

0

主图2

cart_img_3

text

0

主图3

cart_img_4

text

0

主图4

cart_img_5

text

0

主图5

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

slides

字段名称

类型

长度

不是null

主键

字段说明

slides_id

int

10

主键

轮播图ID

title

varchar

64

标题

content

varchar

255

内容

url

varchar

255

链接

img

varchar

255

轮播图

hits

int

10

点击量

create_time

timestamp

0

创建时间

update_time

timestamp

0

更新时间

system_user

字段名称

类型

长度

不是null

主键

字段说明

system_user_id

int

11

主键

系统用户ID

user_no

varchar

64

用户编号

user_name

varchar

64

用户姓名

id_number

varchar

255

身份证号

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

user_id

int

11

用户ID

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

5系统界面实现

5.1 登录

管理员输入个人的账号、密码登录系统,这时候系统的数据库就会在进行查找相关的信息,如果我们输入的账号、密码不正确,数据库就会提示出错误的信息提示,同时会提示管理员重新输入自己的账号、密码,直到账号密码输入成功后,会提示登录成功的信息。管理员登录效果图如图5.1所示:

     

图5.1登录界面

登录代码如下:

/**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

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

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

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

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

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

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

        List resultList = null;

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

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

            map.put("username", username);

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

        }

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

            map.put("email", email);

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

        }

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

            map.put("phone", phone);

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

        }else{

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

        }

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

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

        }

        //判断是否有这个用户

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

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

        }

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

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

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

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

        if (groupList.size()<1){

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

        }

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

        //查询用户审核状态

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

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

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

            if (res==null){

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

            }

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

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

            }

        }

        //查询用户状态

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

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

        }

        String md5password = service.encryption(password);

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

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

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

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

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

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

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

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

        }

}

5.2  管理员功能模块

 管理员首页

管理员可以查看后台服务端后台首页、站点管理(轮播图、公告栏)用户管理(管理员、系统用户)内容管理(社区分享、分享分类)商城管理(商品信息、分类列表、订单列表)等操作。管理员服务端效果图如图5.2所示。

图5.2管理员服务端界面图

管理员功能页代码如下:

   @RequestMapping("/get_obj")

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

        Query select = service.select(service.readQuery(request), service.readConfig(request));

        List resultList = select.getResultList();

        if (resultList.size() > 0) {

            JSONObject jsonObject = new JSONObject();

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

            return success(jsonObject);

        } else {

            return success(null);

        }

}

 public Query 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 runEntitySql(sql.toString());

    }

用户信息管理

管理员对用户信息管理进行审核等操作,并可进行进行删除、修改、查看等操作。用户信息管理效果图如图5.3所示。

图5.3用户信息管理界面图

用户管理代码如下:

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

}

商品信息管理

管理员对商品信息进行管理审核、查看、编辑等操作。商品信息效果图如图5.4所示。

图5.4商品信息界面图

商品信息代码如下:

 @PostMapping("/upload")

    public Map<String, Object> upload(@RequestParam("file") MultipartFile file) {

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

        if (file.isEmpty()) {

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

        }

        try {

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

            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 fileName = file.getOriginalFilename();

            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乘客订单界面图

订单管理代码如下:

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

    }

5.3用户客户端功能模块

用户注册

用户注册在登陆页面填写账号、密码、邮箱、手机昵称、姓名等信息,进行注册如图5.7所示

图5.7用户注册界面图

注册代码如下:

/**

     * 注册

     * @param user

     * @return

     */

    @PostMapping("register")

    public Map<String, Object> signUp(@RequestBody User user) {

        // 查询用户

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

        query.put("username",user.getUsername());

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

        if (list.size()>0){

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

        }

        user.setUserId(null);

        user.setPassword(service.encryption(user.getPassword()));

        service.save(user);

        return success(1);

}

/**

     * 用户ID:[0,8388607]用户获取其他与用户相关的数据

     */

    @Id

    @GeneratedValue(strategy = GenerationType.IDENTITY)

    @Column(name = "user_id")

    private Integer userId;

    /**

     * 账户状态:[0,10](1可用|2异常|3已冻结|4已注销)

     */

    @Basic

    @Column(name = "state")

    private Integer state;

    /**

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

     */

    @Basic

    @Column(name = "user_group")

    private String userGroup;

    /**

     * 上次登录时间:

     */

    @Basic

    @Column(name = "login_time")

    private Timestamp loginTime;

    /**

     * 手机号码:[0,11]用户的手机号码,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "phone")

    private String phone;

    /**

     * 手机认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "phone_state")

    private Integer phoneState;

    /**

     * 用户名:[0,16]用户登录时所用的账户名称

     */

    @Basic

    @Column(name = "username")

    private String username;

    /**

     * 昵称:[0,16]

     */

    @Basic

    @Column(name = "nickname")

    private String nickname;

    /**

     * 密码:[0,32]用户登录所需的密码,由6-16位数字或英文组成

     */

    @Basic

    @Column(name = "password")

    private String password;

    /**

     * 邮箱:[0,64]用户的邮箱,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "email")

    private String email;

    /**

     * 邮箱认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "email_state")

    private Integer emailState;

    /**

     * 头像地址:[0,255]

     */

    @Basic

    @Column(name = "avatar")

    private String avatar;

    /**

     * 创建时间:

     */

    @Basic

    @Column(name = "create_time")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    private Timestamp createTime;

    @Basic

    @Transient

    private String code;

}

用户信息

在用户信息页面用户信息可以进行添加、查看、编辑基本信息、收货地址、收藏、订单、购物车等操作如图5.8所示。

图5.8用户信息界面图

   前台首页

用户对查看首页详情页面,如图5.9所示。

图5.9前台首页功能界面图

   产品展示列表

产品展示详情页面可查看名称、产品图片、价格、加入购物车等操作,如图5.10所示。

图5.10产品展示界面图

订单详情

订单列表详情页面可订单状态、收货地址、电话、购买商品、价格、订单编号、下单时间等信息,如图5.11所示。

图5.11订单界面图

6系统测试

系统开发的最后一个步骤就是系统测试,系统测试也是整个系统十分重要的一个环节,测试的好坏关系到产品的发展。客户对软件的质量、性能和可靠性等需求就要通过测试来实现。测试过程要必须遵循严谨性、完善性、规范性的原则,测试的主要目的就是看看在系统运行中,是否会出现bug,然后对出现的bug进行调试,直到程序完美运行。但是软件的测试只能尽可能的减少bug,理论上来说是无法达到消除bug。但是bug越少,系统出错的几率就越低,用户使用起来也更方便、更安全。

近年来,软件包含测试从现在的检验当中来看,系统接近预期目标可能出现的问题,并对这些错误做出相应的修正,假如我们不进行早期的测试错误就会延续下去,最后所做出的成品就会有很大的困难。

我们要在这个测试的过程当中找出错误。测试成软件开发的主要一部分,自从有了程序的设计那天开始,它就成为了重要的组成部分。经过统计来看,软件测试可以占据这个系统45%的工作量,而在软件开发的成本当中,对于测试成本来说它包含了很多的测试工作。每个程序测试时都会出现和遇到错误。在整个程序的开发过程当中,人为去查找错误是非常复杂和困难的,所以我们一般都会找一些测试的工具来进行测试

6.1系统测试的意义

随着现代信息的快速发展,在社会各大领域中已经都开始应用网络信息技术,在应用网络技术的同时人们也开始把软件的质量问题作为了一个重要焦点来关注,因为一个软件的好与坏它决定着这个系统在市场上的生存,所以我们必须要把软件质量来做好,这样才有一定的生存能力。对于用户来说它们首先选用的都是保证这个系统软件的质量问题,因为一个系统的软件质量决定着用户在后期上成本经济的问题。图6-1就是纠错测试流程。

图6-1 测试与纠错信息流程

6.2 测试方法

具体测试方法包括:黑盒测试和白盒测试。

黑盒测试又被人们称作为功能测试,通常是在程序的接口来做一些测试的方法,它一般包括对程序的功能和使用的方法来做出一些数据的接受和输出,同时还可以做出正确的输出信息,并保证与外部信息的完整性。

白盒测试通常被人们称作为结构测试,在整个程序的结构和处理当中它是由程序当中的逻辑测试和检验程序来完成一些正确的工作。

具体的功能测试它是包括:系统的适用性、准确性、安全性等功能测试。

6.3测试分析

本农产品推广系统APP满足相关信息的管理需求,在设计时借鉴了国内外优秀网站的优点,从界面到系统设计都保证了管理员以及用户能够方便操作。系统的主要特点和优点归纳如下:

(1)本系统用的移置性和针对性都比较高,因为针对性高可以提供更好的服务而移置性可以在多个系统上运行,更给用户带来了极大的方便。

(2)该农产品推广系统APP内容全面,管理方便可以及时的全面的处理各种错误,异常,这样避免了很多因用户的马虎操作而出现的失误,其操作方便,用户界面友好,能够上网的人都可以很好的进行操作。

经过对上述的测试结果分析,所有基本功能齐全,操作简单,系统运行性能良好,系统安全可靠,能促进农产品推广系统的发展,发展前景广阔。

结    论

本系统通过对Android、java和Mysql数据库的简介,从硬件和软件两反面说明了农产品推广系统APP的可行性,本文结论及研究成果如下:实现了Android、java与Mysql相结合构建的农产品推广系统APP,网站可以响应式展示。通过本次农产品推广系统APP的研究与实现,我感到学海无涯,学习是没有终点的,而且实践出真知,只有多动手才能尽快掌握它,经验对系统的开发非常重要,经验不足,就难免会有许多考虑不周之处。比如要有美观的界面,更完善的功能,才能吸引更多的用户。

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

通过这次农产品推广系统APP的开发,我参考了很多相关系统的例子,取长补短,吸取了其他系统的长处,逐步对该系统进行了完善,但是该系统还是有很多的不足之处,有待以后进一步学习。

实践证明,农产品推广系统APP有着非常好的发展前景,经过测试运行,系统各项功能都十分完善,界面漂亮,使用方便,操作容易,在技术理论上已经成熟。

致    谢

大学的学习生活在这个季节将结束,但是在我的生命这仅仅只是一个逗号,我将面对另一个的开始。通过这次毕业设计的整个开发过程,从需求分析到具体功能实现,再到最终测试和维护的理解有了很大的进步,让我对系统开发有了更深刻的认识,对我个人的实践能力和解决问题的能力,都有了很大的帮助。这是这次毕业设计最大的收获。

First of all, I would like to thank my supervisor. He gave me all kinds of selfless help in writing my thesis. He is rigorous in scholarship and has strict requirements, which enabled me to gain a lot. The teacher's profound theoretical knowledge and rich practical experience have deeply influenced me. In this regard, I would like to express my sincere gratitude.

Secondly, I would also like to express my gratitude to all the teachers and classmates. They actively provided a lot of help during my study process, whether it was professional knowledge or practical operation skills, which also enabled me to encounter difficulties in writing my thesis. Some of the problems encountered were easily solved.

Finally, I would like to express my heartfelt thanks to all the teachers who read and reviewed this paper!

references 

[1] Yang Bo, Wen Zhiping. Design and implementation of online collaborative office system based on SpringBoot [J]. Computer Knowledge and Technology, 2022, 18(22): 49-51.DOI: 10.14004/j.cnki.ckt.2022.1515 .

[2]Yadav Chandra Shekhar, Singh Jagendra, Yadav Aruna, Pattanayak Himansu Sekhar, Kumar Ravindra, Khan Arfat Ahmad, Haq Mohd Anul, Alhussen Ahmed, Alharby Sultan. Malware Analysis in IoT & Android Systems with Defensive Mechanism[J]. Electronics,2022,11(15).

[3] Song Yang. Knowledge discussion on using Java language to develop Web application software [J]. China Equipment Engineering, 2022(14):121-123.

[4]. Data transmission status of main agricultural product promotion systems [N]. China Communications News, 2022-07-22(004).DOI:10.28099/n.cnki.ncjtb.2022.001641.

[5] Zhang Haiyue, Fan Xi. A brief analysis of the life cycle and implementation methods of threads in Java language [J]. Popular Science and Technology, 2022, 24(07): 18-20+28.

[6] Li Yiqiu, Wang Xiaoyu, Zhu Shulei, Sheng Ziyi. Research on the current situation and optimization of user experience for college students in agricultural product promotion system [J]. Chinese Market, 2022(20):183-187.DOI:10.13939/j.cnki.zgsc.2022.20.183 .

[7] Li Zhang, Zhao Honghao, Huang Zhen, Chen Yifan, Yang Zhou. Application of Java in programming language courses [J]. Yangtze River Information and Communications, 2022, 35(07): 108-111.

[8] Wu Tuo. Application of Java programming language in computer software development [J]. Wireless Internet Technology, 2022, 19(12): 35-37.

[9] Zhao Jun. Design of English reading mobile learning APP based on Android system [J]. Automation Technology and Application, 2022, 41(06): 154-156. DOI: 10.20033/j.1003-7241.(2022)06 -0154-03.

[10] Xia Yu, Zhu Junwu, Jiang Yi, Gao Xin, Sun Maosheng. Cross-regional order allocation mechanism for online ride-hailing under tight transportation capacity [J]. Computer Applications, 2022, 42(06): 1776-1781.

[11] Wang Jiashun, Li Zhiyong, Dou Runliang, Nan Guofang, Li Minqiang. Research on opening strategies of agricultural product promotion systems in competitive markets [J]. Systems Engineering Theory and Practice, 2022, 42(07): 1884-1899.

[12]. The CursedMasters - A Java Edition Minecraft Server[J]. M2 Presswire,2022.

[13]. Java Developer Survey Reveals Teams Not Realizing Full Promise of Microservices[J]. M2 Presswire,2022.

[14]Guan Dejun. Mobile Learning Platform in Cloud Computing with Information Security and Android System[J]. Security and Communication Networks,2022,2022.

[15] Zhang Yuhao, Yan Hui. Research on the behavior of taxi drivers after adoption of online car-hailing APP [J]. Library and Information Service, 2021, 65(18): 117-124.DOI: 10.13266/j.issn.0252-3116.2021 .18.012.

[16] Liu Yong, Lu Xiaohui. A big data computing and storage platform based on Android system [J]. Guangdong Communication Technology, 2021, 41(09): 53-59.

[17] Zhou Yuanlin, Zhang Changquan, Deng Guoyin. Research on APP security reinforcement technology for Android systems [J]. Southern Agricultural Machinery, 2021, 52(11): 164-165+175.

[18] Li Kundong. Design and implementation of Android malicious application detection system based on deep learning [D]. Xi'an University of Electronic Science and Technology, 2021.DOI:10.27389/d.cnki.gxadu.2021.002017.

[19] Wang Qiannan. Construction method of mobile phone processor microarchitecture benchmark test set based on Android system [D]. University of Chinese Academy of Sciences (Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences), 2021.DOI:10.27822/d.cnki.gszxj.2021.000029 .

[20] Liao Xiangsen. Research on customized Android system service testing technology [D]. Nanjing University, 2021. DOI: 10.27235/d.cnki.gnjiu.2021.000964.

Please follow and like + privately message the blogger to receive the project source code for free
 

Guess you like

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