(with source code) Design and Implementation of Springboot Aquatic Product Sales System Graduation Project 041700

Design and Realization of Aquatic Products Sales System

Summary

With the rapid development of information today, the network has become an important information exchange platform for people. Aquatic product companies have a lot of information that needs to be released through the Internet every day. For this reason, I have developed an aquatic product sales system based on the B/S (browser/server) model.

The system uses Java programming language, MySQL and front-end UI as development technologies to realize adding, modifying, viewing and deleting system data. This system splits the system in a componentized way, and analyzes and designs the addition, deletion, query and modification of each table in the database, and the constraint relationship between tables, and finally realizes a commercial-level application that meets the user's needs.

The system interface is simple and elegant, the layout is reasonable, and it is easy to operate and learn. Corresponding to every step of the user's operation, the system can give feedback with high responsiveness. The system specifically includes functions such as user management, sales list, supplier information, customer information, product information, purchase order, purchase storage, sales storage, etc., providing a management platform for the aquatic product sales system to achieve efficient and efficient data management. Manage safely.

Keywords: B/S mode, Java programming language, easy to operate

Design and implementation of aquatic products sales system

Abstract

Today, with the rapid development of information, the network has become an important information exchange platform for people. Aquatic products companies have a lot of information to publish through the network every day. Therefore, I developed an aquatic products sales system based on B / S (Browser / server) mode.

The system takes Java programming language, MySQL and front-end UI as development technology to add, modify, view and delete system data. The system adopts the component-based way to split the system, and analyzes and designs the addition, deletion, query and modification of each table in the database, and the constraint relationship between tables, so as to finally realize the commercial application that meets the needs of users.

The system interface is simple and generous, the layout is reasonable, easy to operate and easy to use. The system can respond to each step of the user's operation with high response. The system specifically includes the functions of user management, sales order, supplier information, customer information, commodity information, purchase order, purchase receipt, sales delivery and so on. It provides a management platform for the aquatic product sales system to realize the efficient and safe management of data.

Key words:B / S mode, Java programming language, easy to operate

Table of contents

Chapter 1 Introduction 1

1.1 Background and significance 1 

1.2 Overview of research at home and abroad 1 

1.3  Development status 1

1.4  Organizational structure of this paper 2

Chapter 2 Introduction to Related Technologies 3

2.1 Myeclipse description 3 

2.2 Mysql description 4

2.3 Tomcat description 4

2.5 Introduction to springboot framework 5

Chapter 3 System Analysis 5

3.1  Feasibility Analysis 5

3.1.1  Legal Feasibility Analysis 5

3.1.2  Technical Feasibility Analysis 5

3.1.3  Economic feasibility analysis 5

3.2  Analysis of Functional Requirements 5

3.3  Analysis of non-functional requirements 6

3.4  Use case analysis 7

3.5  Business Process Analysis 8

3.6  Data Flow Analysis 9

Chapter 4 System Design 11

4.1  System Architecture Design 11

4.2  System function structure 11

4.3  Functional module design 13

4.4  Database Design 14

4.4.1 ER Diagram 15

4.4.2  Table structure design 15

Chapter 5 System Implementation 18

5.1  Development Tools 18

5.2 Login module 18 

5. 3  User Module 2 0

5. 3 .1 User Homepage Module 2  0

5. 3 .2 Personal information module 2  1

5.3.3 Supplier information module 22 

5.3.4 Commodity information module 23 

5.4  Administrator Module 24

5.4.1 Buyer Management Module 24 

5.4.2  Commodity Management Module 26

5.4.3 Customer Management Module 28 

5. 4 .4 Sales Outbound Management Module 3  0

Chapter 6 System Testing 3 2

6.1  Test overview 3 2

6.2  Test process 3 2

6.2.1  Login test 3 2

6.2.2  Information entry test 3 2

6.2.3  Information update test 336

6.2.4  Information deletion test 3 3

6.3  Test results 3 3

Chapter 7 Summary and Outlook 3 5

7.1  Summary 3 5

7.2  Outlook 3 5

References 3 6

Thanks 38

  1. introduction
    1. background and significance

With the rapid development of society, the impact of computers is comprehensive and in-depth. With the continuous improvement of people's living standards, people's requirements for the aquatic product sales management system in daily life are also constantly improving, and the number of aquatic products is increasing, making the development of aquatic product sales management system necessary and urgent. The aquatic product sales management system mainly uses computers to increase the choice of administrators through the information management required by the aquatic product sales management system, and at the same time it is convenient for the timely query and modification of the administrator information and the timely understanding of the administrator information . The aquatic product sales management system brings more convenience to the administrator, and the system meets the administrator's needs by cooperating with the database management system software. The application of computer technology in modern management makes computer an important tool for people to apply modern technology. It can effectively solve the problem of convenient and comprehensive access to information and improve efficiency.

    1. Overview of Research at Home and Abroad

With the continuous development of the domestic economic situation, China's Internet has entered a rare period of peak development, which makes Chinese and foreign capitalists turn to the Internet market one after another. However, the unreasonable structure of many management areas, the shortage of personnel and the increase of management needs make more people have the awareness of Internet management.

In today's highly developed information, information management reform has become a more extensive and comprehensive trend. "Aquatic product sales management system" is based on Mysq1 database and implemented on the basis of springboot program design. In order to ensure the sustainable development of China's economy, the information age has been updated and flourished day by day. At the same time, with the rapid development of the information society, the aquatic product sales management system is faced with more and more information, so it is difficult to obtain their needs for efficient information, how to use a convenient and quick way to make the inquirer in the vast ocean of information It is effective in querying, storing, managing and sharing information, and has important practical significance to our work and life. Therefore, domestic and foreign academic circles have carried out deep and extensive research on this, and a new research field-aquatic product sales management system was born.

    1. development status

At present, many people still use traditional paper tools as the main tool for information management, while the application of network technology only plays an auxiliary role. In terms of awareness of network tools, the more traditional office software is still the main tool people use, while the relatively comprehensive and professional information management software of the aquatic product sales management system is still not understood or recognized by most people. This topic is designed to manage homepage, personal center, user management, sales list, supplier information, customer information, product information, purchase order, purchase storage, sales delivery, administrator management and other information through label classification management. Management functions, so as to achieve efficient management of information in the aquatic product sales management system.

    1. Organization of this article

Six chapters together constitute the research and design content of this paper, including:

Chapter One Introduction. At the beginning of this article, some textual descriptions are made of the background, significance and research significance of this topic.

Chapter Two: Introduction of related technologies. Mainly introduces Java programming technology, Java development tools, B/S mode, etc.

Chapter Three: System Analysis. Including the overall system requirements description, analysis of system requirements from a functional point of view, and non-functional analysis of whether the system can be realized.

Chapter Four: System Design. The important part of this article provides the detailed design of the system architecture and the design description of some main functional modules.

Chapter Five: System Realization. The system is divided into the introduction of the development tools of the premise and the realization of the function code in the later stage.

Chapter Six: System Testing. After the system is completed, the functional test of each module is carried out according to the test cases of each module.

  1. Related technology introduction

2.1 Myeclipse Description

The software we usually use when we use Java to develop the system is Myeclipse, which is used to design the collection of Eclipse plug-ins for Java and JavaEE. Most of Myeclipse can realize the research and development of Mysql database and Javaee. Using Myeclipse greatly facilitates developers, and the progress of system development will also be improved.

2. 2 Mysql description 

Now the Mysql database can support many users on the network, and it can also adapt to the deployment or configuration of customer service machines and servers. Our server and client machines here are actually a software concept, and the computer hardware we use is also There is no one-to-one correspondence with them.

Mysql is a very popular relational database management system, and its appearance has always been a leader. It is not only very powerful, but also very convenient to use, and Mysql's cross-platform ability is also very good, software developers like it very much of these powerful advantages. Different from other relational databases, it has its own set of solutions for database management, and manages the database by setting corresponding permissions and roles for users. It can be seen that Mysql is a database management software suitable for high throughput, high reliability and high efficiency [4].

Advantage 1: Mysql sets different permissions for users with different identities to complete different business logics, which makes Mysql far exceed other relational databases in terms of security and integrity.

Advantage 2: Mysql can also support the data types of animation, graphics and sound, which means that multiple data types can also be supported by Mysql.

Advantage 3: Mysql can also be developed on multiple platforms, and various programming languages ​​for software development can realize the operation of Mysql database.

2. 3 Tomcat Description

Tomcat is a free server. The usage scenario is more suitable for situations where the number of visits is relatively small. It means that when Tomcat is installed on the computer, the access request of the front-end HTML page can be parsed through it. In fact, Tomcat is an extension of Apache, but it works relatively independently of Apache, so it can be seen that it runs relatively independently of Apache.

Tomcat was originally developed and applied by Davidson of Sun Company. After his efforts, he has continuously turned it into an open source server. It was also handed over to the Apache Software Foundation by the sun company. The ever-evolving tomcat server has undergone a lot of refactoring and combing in a recent version to make it more convenient to use. The Tomcat-based load balancing algorithm is an open source software implementation. There is no need to add additional hardware investment, and it is very convenient to implement, especially suitable for the expansion of general small business website servers at present and in the future. Judging from the current practice, it can be used as a reference for similar applications.

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 inversion of control features. 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 (EnterpriseJavaBeans) model. The Spring framework provides a series of solutions for development, such as using the core features of inversion of control, and implementing inversion of control through dependency injection to realize the containerization of the management object life cycle, using aspect-oriented programming for declarative transaction management, and integrating 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 feature of inversion of control (IOC). IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through the Java reflection mechanism. The Spring framework uses the container 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. Aspect Oriented Programming(AOP) framework, the Spring AOP framework is based on the proxy mode, and can be configured at runtime; the AOP framework is mainly modularized for the 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 the basic needs through integration with AspectJ. Functions such as transaction management and remote access 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 multiple 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 addresses 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 Apache Cayne, but also can be used with Spring's transaction management to provide data access Flexible abstraction. The Spring framework initially did not 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 Struts Web framework and between the request processing layer and the model was not enough, so they created Spring MVC.

  1. system analysis
    1. Feasibility Analysis
      1. Legal Feasibility Analysis

Whether the development of software violates the law involves the issue of whether the software or system can be released. If you violate the law, you will be punished by law. A common legal problem is software plagiarism. If you copy someone else's software, you will be severely punished.

      1. Technical Feasibility Analysis

After years of development, the software industry has now reached a large scale, and there are countless professionals engaged in software development. The importance of the software industry has risen to the core position that affects and promotes the development of the national economy. The architecture on which this system is based, the current technology is very mature, and there is no trouble that is difficult to achieve technically.

      1. Economic Feasibility Analysis

In-depth consideration of the time, manpower and material costs required to develop the software, the income after the development is completed, and whether the required functions of the software can be realized under the existing economic conditions from the perspective of return on investment are all in line with the actual requirements. Therefore, the laundry management system is economically feasible and practical, and can save management costs

    1. Functional Requirements Analysis

1. Registration: First check whether the user name and email address exist. If they do not exist, the user can register and encrypt the password entered by the user with MD5. After the registration is successful, it will prompt that the registration is successful, and the user information will be saved in the database.

2. The product display function module mainly includes the functions of product search and viewing product details. Both unregistered users (tourists) and registered users can search for products and view product details on the homepage. The specific functional requirements are as follows:

(1) Commodity search: Front-end users can enter keywords in the front-end to search, and after a successful search, a dynamic sorting list of the product will be returned, which can be displayed in pages.

(2) View product details: Users can click on the corresponding product to view the product details of the product.

3. The functional modules of purchase and storage management mainly include purchase and storage, update purchase and storage, and delete purchase and storage commodities:

  1. Add purchase storage: purchase storage is to store the goods that the user wants to store.

(2) Update the quantity of goods in storage: the user can update the quantity of goods to be purchased when checking the purchase and storage.

4. Commodity management:

(1) Commodity list: display all commodity information and form a list style.

(2) Commodity search: Search for commodities by commodity name and commodity category.

(3) Image upload: add a product image to the product.

(4) Adding commodities;

(5) Update product: update product information, such as product name, product picture, price, quantity, etc.

(6) The goods are put on and off the shelves;

5. Customer information management:

(1) Add customers: the administrator can manage customer information, click Add Customer to select a customer and enter the customer to add customer information.

(2) Modify customer information: administrators can modify customer information.

(3) View customer information: the administrator can view all customer information, etc.

6. Sales order management:

(1) Query orders by order number:

(2) View sales details:

    1. Non-Functional Requirements Analysis

There are many non-functional requirements of the system, such as performance requirements, maximum number of users that can be carried, stability, and usability requirements. The analysis of this system takes into account the requirement of ease of use, because the system is used by people, so it is necessary to fully consider the user experience from the user's point of view, so that the system is easy to understand, easy to use and easy to operate.

    1. use case analysis

1. The purchasing supervisor mainly uses the online purchase business of the system. The following figure shows the use case diagram of the purchasing supervisor.

 

Figure 3-1 Purchasing supervisor use case diagram

2. The administrator is mainly responsible for user management, sales order, supplier information, customer information, commodity information, purchase order, purchase storage, and sales storage. The use case diagram for the administrator is shown in the figure below.

 

Figure 3-2 Administrator use case diagram

    1. business process analysis

The system business flow chart is shown below.

 

Figure 3-3 System business flow chart

First of all, there are two types of system users. Those who use the purchase function are ordinary users, and those who use the management function are administrator users. After successful registration, ordinary users get account numbers and passwords. After entering the account password on the login page, they log in to the system, and ordinary users can Browse to the products displayed by the system, then purchase the products, and then form a personal purchase order; the administrator user maintains the data of the system, including the maintenance of product information, updates and edits the quantity of products, etc., and confirms the customer's order and maintenance etc.

    1. Data Flow Analysis

The following is the top-level data flow diagram of the system. The external entities include users and administrators, who input data into the system respectively to obtain the data to be output.

    

 

Figure 3-4 System top-level data flow diagram

The following figure shows the underlying data flow diagram of the system.

 

Figure 3-5 System underlying data flow diagram

The underlying data flow diagram of the aquatic product sales system mainly describes the data flow, data carrier, data processing, and specific interaction of external entities of the underlying modules of the system. This system is the data interaction between administrators and ordinary users on modules such as commodity maintenance, sales order maintenance, and user maintenance .

  1. system design
    1. System architecture design

The aquatic product sales system adopts a three-layer development and design model, which is divided into: user interface layer, business logic layer and data access layer. The user interface layer is used to interact with users, the business logic layer is responsible for business processing and data transfer between layers; the data access layer is responsible for accessing and retrieving the database.

The architecture diagram of the system is shown in the figure below.

Figure 4-1 System architecture diagram

 

The call process between the various layers of the system is as follows:

(1) The user accesses the system through the user interface layer, submits a request to the system, and the interface layer performs preliminary processing and packaging on the request, and judges whether to interact with the business logic layer.

(2) The business logic layer receives the request from the interface layer and processes the data of the request. Then call the data access layer to implement database access, the data access layer accesses the database, reads out the data and returns it to the logic layer.

(3) The logic layer returns the processed result to the interface layer. The interface layer handles the presentation to the user.

    1. System function structure

In order to implement the system from "what to do" to "how to do it", based on the system design principles, the system functions are divided into functions that are more suitable for coding implementation. According to the system architecture design in the above figure, a standardized system function structure diagram is sorted out to prepare for the system's implementation and coding.

The following figure shows the functional structure diagram of the system.

 

Figure 4-2 System function structure diagram

(1) Management of user information: the system administrator can perform CRUD operations on user data information that has registered in the system.

(2) Commodity data information resource management: administrators can perform basic operations of adding, deleting, modifying and checking commodity information in the system.

(3) Display product classification information: All product categories will be displayed on the home page, and users can quickly find their favorite products based on these categories.

(4) Search for products: When there are many products, it is not easy for users to find them. Therefore, the product search function is provided, and the products can be searched by product labels.

    1. Functional module design

User management is for all users and administrators. Unregistered users click Register to enter the registration page and fill in the new user information. After obtaining a custom generated account, the registration is complete. The activity diagram for unregistered user registration is shown in the figure below.

 

Figure 4-3 Unregistered user registration activity diagram

Users can log in to use more functions. First, enter the user login interface, enter the user account and password, and check and verify the account and password information in the background. If the verification is successful, the page will directly display the login user nickname to indicate successful login, otherwise return to the user login interface. The user login activity diagram is shown below.

 

Figure 4-4 User login activity diagram

After the user logs in, he enters the function page, where he can manage his own information, including personal information, personal information, purchase order management, personal order management, and online payment. The user usage function activity diagram is shown in the figure below.

 

Figure 4-5 User usage function activity diagram

The user function interface can modify its own password. After entering the password modification interface, check the current password, and fill in the new password after the verification is successful. As shown below.

 

Figure 4-6 Change password activity diagram

    1. Database Design

The database used in the aquatic product sales system is MySQL, and this part will design a reasonable database according to the system requirements and design. This system takes into account the extended cluster of the system in the future, and the database will not use foreign keys. In addition, data management is simpler when foreign keys are not used, and the operation is more convenient and the performance is higher.

      1. ER diagram

The ER diagram more intuitively tells developers the attributes of each data in the system, the relationship between each data, and the type of each data. Through this model, you can understand the design of the database more intuitively, and gradually improve it accordingly.

The system diagram design is shown in the figure below.

 

Figure 4-7 System ER Diagram

      1. table structure design

This system designs the database according to the idea of ​​the third paradigm to reduce the redundancy to the greatest extent. There are a total of multiple tables, user table, customer information table, commodity table, sales list table, supplier information table, salesperson table, purchasing supervisor The structure of table, buyer table, purchase storage table, sales delivery table, and purchase order table is as follows.

supplier_information表:

name

type

length

not null

primary key

note

supplier_information_id

int

11

yes

yes

Supplier Information ID

supplier_number

varchar

64

no

no

supplier code

supplier_name

varchar

64

no

no

Supplier name

supplier_telephone

varchar

64

no

no

Supplier phone

supplier_address

varchar

64

no

no

supplier address

person_in_charge

varchar

64

no

no

principal

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

salesperson table:

name

type

length

not null

primary key

note

salesperson_id

int

11

yes

yes

Salesperson ID

gender

varchar

64

no

no

gender

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

user_id

int

11

yes

no

User ID

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

sales_slip table:

name

type

length

not null

primary key

note

sales_slip_id

int

11

yes

yes

Sales order ID

commodity_number

varchar

64

no

no

Product Number

commodity_type

varchar

64

no

no

Product Types

trade_name

varchar

64

no

no

product name

sales_time

date

0

no

no

sales time

sales_volumes

int

11

no

no

Sales volume

customer_card_number

varchar

64

no

no

customer card number

customer_name

varchar

64

no

no

Customer Name

selling_price

int

11

no

no

selling price

total_amount

varchar

64

no

no

lump sum

salesperson

int

11

no

no

Seller

cumulative_integral

int

11

no

no

accumulated points

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

sales_delivery表:

name

type

length

not null

primary key

note

sales_delivery_id

int

11

yes

yes

Sales Outbound ID

commodity_number

varchar

64

no

no

Product Number

commodity_type

varchar

64

no

no

Product Types

trade_name

varchar

64

no

no

product name

sales_volumes

int

11

no

no

Sales volume

delivery_time

date

0

no

no

Delivery time

salesperson

int

11

no

no

Seller

ex_warehouse_remarks

text

0

no

no

Remarks

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

purchasing_supervisor表

name

type

length

not null

primary key

note

purchasing_supervisor_id

int

11

yes

yes

Purchasing Supervisor ID

gender

varchar

64

no

no

gender

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

user_id

int

11

yes

no

User ID

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

purchase_warehousing表:

name

type

length

not null

primary key

note

purchase_warehousing_id

int

11

yes

yes

Purchase warehousing ID

commodity_number

varchar

64

no

no

Product Number

commodity_type

varchar

64

no

no

Product Types

trade_name

varchar

64

no

no

product name

purchase_quantity

int

11

no

no

Purchase quantity

warehousing_time

date

0

入库时间

buyer

int

11

采购员

warehousing_remarks

text

0

入库备注

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

purchase_order表:

名称

类型

长度

不是null

主键

注释

purchase_order_id

int

11

采购单ID

commodity_number

varchar

64

商品编号

commodity_type

varchar

64

商品类型

trade_name

varchar

64

商品名称

procurement_time

date

0

采购时间

purchase_quantity

int

11

采购数量

supplier_name

varchar

64

供应商名称

purchase_price

int

11

采购价格

total_amount

varchar

64

总金额

buyer

int

11

采购员

purchasing_supervisor

int

11

采购主管

purchase_remarks

text

0

采购备注

examine_state

varchar

16

审核状态

examine_reply

varchar

16

审核回复

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

product_information表:

名称

类型

长度

不是null

主键

注释

product_information_id

int

11

商品信息ID

commodity_number

varchar

64

商品编号

commodity_type

varchar

64

商品类型

trade_name

varchar

64

商品名称

commodity_specifications

varchar

64

商品规格

commodity_unit

varchar

64

商品单位

merchandise_inventory

int

11

商品库存

supply_price

int

11

供应价

retail_price

int

11

零售价

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

customer_information表:

名称

类型

长度

不是null

主键

注释

customer_information_id

int

11

客户信息ID

customer_card_number

varchar

64

客户卡号

customer_name

varchar

64

客户姓名

customer_gender

varchar

64

客户性别

customer_age

varchar

64

客户年龄

customer_address

varchar

64

客户地址

customer_telephone

varchar

64

客户电话

customer_id_card

varchar

64

客户身份证

customer_points

int

11

客户积分

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

buyer表:

名称

类型

长度

不是null

主键

注释

buyer_id

int

11

采购员ID

gender

varchar

64

性别

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

user_id

int

11

用户ID

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

  1. 系统实现
    1. 开发工具

系统中应用的开发工具总结如下表所示。

表5-1开发工具

名称

工具

版本

操作系统

IDE(Integrated Development Environment)

windows

ZendStudio

7/8/10

2017

服务器

Apache

9.10.7

数据库

浏览器

界面工具

MySQL

谷歌

Photoshop

5.6

6.0

2016

    1. 登录模块

用户在首页点击登录,进入用户登录界面uerLogin.Java,输入用户账号和密码,点击登录,用户账号和密码信息由界面传入控制层,调用userLogin方法,通过实现登录的接口向数据库用户表搜索该用户账号与密码,将最终结果反馈到前端。若成功则回到首页;用户成功登录,若失败则回到登录界面,并显示登录失败。

用户点击注销,清空浏览器session值,然后返回登录页或者首页。

登录界面如下所示。

 

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

        }

}

    1. 用户模块
      1. 用户首页模块

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

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

 

图5-1用户首页界面

      1. 个人信息模块

登录用户在首页点击进入用户中心userCenter.Java,再点击修改个人信息按钮进入userChangeInfo.Java界面,系统根据session中存储的目前登录的用户的账号,向控制层发送请求,搜索当前用户信息,控制层向用户接口调用查询用户方法,向数据库的用户表搜索当前用户信息并将用户信息以对象的形式层层返回到userChangeInfo.Java界面,显示出当前用户的个人信息。

若用户要对个人信息进行修改,则通过修改当前信息之后点击确认,向控制层发送更改后的用户信息,调用修改用户信息的方法,通过实现用户接口向数据库用户表更新用户信息,若成功则反馈注册成功,则返回的userChangeInfo.Java界面被更改成功;若失败则显示修改失败。

 

图5-1个人信息界面

      1. 供应商信息模块

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

供应商信息界面如图所示。

 

图5-1供应商信息界面

      1. 商品信息模块

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

 

图5-1商品购买界面

    1. 管理员模块
      1. 采购员管理模块

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

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

 

图5-1采购员管理界面

采购员管理逻辑代码如下所示。

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

    }

      1. 商品管理模块

管理员在后台管理界面点击到所有商品界面shangpin_list.Java,向控制层发送请求,搜索当前所有商品信息,商品控制类向商品实现接口调用搜索全部商品的请求,向数据库的商品表搜索当前所有商品并将商品信息以对象的形式层层返回到shangpin_list.Java界面,显示出当前所有商品信息。若要对商品信息进行修改和删除,则分别进入shangpin_updt.Java或shangpin_delete.Java,通过商品的控制层向商品实现接口调用对应的修改或删除方法,向数据库的商品表做相应的持久层操作。

商品管理界面如下所示。

 

图5-1商品管理界面

商品管理关键代码如下所示。

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

    }

      1. 客户管理模块

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

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

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

 

图5-1客户管理流程图

客户管理界面如下图所示。

 

图5-1客户管理界面

客户管理关键代码如下所示。

@RequestMapping("/get_list")

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

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

        return success(map);

}

      1. 销售出库管理模块

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

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

销售出库管理流程图如下所示。

 

图5-1销售出库管理流程图

销售出库管理界面如下图所示。

 

图5-1销售出库管理界面

  1. 系统测试
    1. 测试概述

软件测试是软件开发完成后必须经过的一道程序,它在软件开发过程中地位十分重要,需要由专业的测试工程师来对软件进行各方面的测试,大到功能模块测试,小到代码的单元测试,这对测试工程师来说需要有足够的耐心和专业的测试方案,软件测试归根结底就是对软件的结构和功能的综合测评,需要做到结构稳定和功能正确,二者兼顾。软件测试也叫寻找系统bug的过程,世界上没有完美无缺、不存在bug的软件,只能将软件的bug降到最低最小,来追求极致。

    1. 测试过程
      1. 登录测试

登录测试是系统最开始就要进行,测试用户能否登录,才能完成后续的功能操作。

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

表6-1登录测试

用例编号

YL001

程序版本

1.00

功能名称

使用者登录测试

编制人

李铁蛋

功能描述

根据用户的登录情况测试

用例目的

测试用户登录情况是否正确

测试项

测试数据

测试结果

预期结果

用户名

为空

请输入用户名

请输入用户名

密码

为空

请输入密码

请输入密码

用户密码组合

用户名:klouse 密码 klouses

用户与密码不匹配

用户与密码不匹配

用户密码组合

用户名 : klouse 密码

klouse

进入系统

正确的用户名和密码

登录系统

      1. 信息录入测试

管理员在发布信息页面,通过按照预先格式发布信息,如果因为输入时候缺少相关内容,就不能发布成功,且有相应错误提示

信息录入发布测试用例表如下所示。

表6-1信息录入发布测试

用例编号

YL002

程序版本

1.00

功能名称

信息发布测试

编制人

李铁蛋

功能描述

对使用者发布或者录入信息进行测试,判断其功能是否达到预期的要求

用例目的

对系统使用者录入发布信息进行原型测试。

测试项

测试数据

测试结果

预期结果

属性1

为空

请输入属性1对应的数据

请输入属性1对应的数据

属性2

为空

请输入属性2对应的数据

请输入属性2对应的数据

属性3

为空

请输入属性3对应的数据

请输入属性3对应的数据

全部输入

数据均填入

录入发布成功

录入发布成功

      1. 信息更新测试

管理员在更新信息页面,通过按照预先格式更新信息,如果因为输入时候缺少相关内容或者更新的数据不符合当前规范的话,就不能更新成功,且有相应错误提示

信息更新测试用例表如下所示。

表6-1信息更新测试

用例编号

YL003

程序版本

1.00

功能名称

信息更新测试

编制人

李铁蛋

功能描述

对使用者更新信息进行测试,判断其功能是否达到预期的要求

用例目的

对系统使用者更新信息进行原型测试。

测试项

测试数据

测试结果

预期结果

属性1

编号:321

编号更新成功

编号更新成功

属性2

名称:名称1

名称更新成功

名称更新成功

属性3

内容:内容1234内容

内容更新成功

内容更新成功

全部输入

数据均未更改

更新成功

更新成功

      1. 信息删除测试

管理员在信息页面,通过点击数据删除按钮来删除该条数据,如果该数据和其他数据有关联,则提示是否确定删除。

信息删除测试用例表如下所示。

表6-1信息删除测试

用例编号

YL004

程序版本

1.00

功能名称

信息删除测试

编制人

李铁蛋

功能描述

对使用者删除信息进行测试,判断其功能是否达到预期的要求

用例目的

对系统使用者删除信息进行原型测试。

测试项

测试数据

测试结果

预期结果

数据1

无任何关联的数据1

数据删除成功

数据删除成功

数据2

和其他数据有关联的数据2

请确认是否删除

请确认是否删除

    1. 测试结果

在经过之前的所有的工作之后,通过对软件的测试方法、测试原则还有典型的测试用例进行全面的、深入的介绍。经过对系统的全面测试,系统目前所具有的所有功能均成功的实现并且通过了测试,整个系统实现了基于 Java 开发的期望。

  1. 总结与展望
    1. 总结

水产品销售系统采用MVC结构,该结构非常完美的集优点于一身,成熟、强大、易理解易使用,通过使用这个结构,降低了开发的难度。本系统实现了基于Java的水产品销售系统,将销售流程转化成电脑操作流程,具体实现了对销售订单和客户的管理、系统人员管理、商品和商品类型管理,并提供查询统计功能来对订单和商品的相关数据进行统计分析,让使用者能更清晰的掌握运营情况,帮助使用者进行销售管理,简化工作流程,提高工作效率和盈利。

    1. 展望

目前完成的水产品销售系统,还有许多有待改进的地方。一个是功能上的改进,用户理应可以修改自己的相关信息,故应增设个人中心功能;另外,系统如果能提供更多查询统计功能就会使得系统更加丰富和多样化,比如客户购买力排行功能、购买积分功能等。第二个是技术上的改进,由于对开发框架不太熟悉,权限管理这部分,本系统采用一个Java页面来规定好导航栏,即跳转的页面,这相对比较不灵活,如果将URL路径记录到数据库并实现增删查改会比较好;另外就是对EasyUI的使用还不够熟练,视觉效果和界面观感有待提升,希望日后能对这个系统有所改进。

参考文献

[1]于旭蕾,李相泽.基于JAVA技术平台的气动轻量机械臂伺服控制系统设计[J/OL].计算机测量与控制:1-8[2022-05-08].http://kns.cnki.net/kcms/detail/11.4762.tp.20220506.1000.004.html

[2]栗岩,栗国栋. 水产品识别检测智能销售系统一体机[P]. 上海市:CN114333183A,2022-04-12.

[3].武汉白沙洲:水产品进入销售旺季,价格保持稳定[J].科学养鱼,2022(01):58.DOI:10.14184/j.cnki.issn1004-843x.2022.01.030.

[4]吴微微.基于MVC模式的电子产品销售系统的设计与研究[J].信息与电脑(理论版),2021,33(23):113-115.

[5]He Xinbin,Bai Yongbin,Yue Lisen,Wang Haixiao,Liu Yi. Design and Implementation of Information System Based on Java Technology Platform[J]. Journal of Physics: Conference Series,2021,2033(1).

[6]Qu Xiaona. Application of Java Technology in Dynamic Web Database Technology[J]. Journal of Physics: Conference Series,2021,1744(4).

[7]朱春雨, 新荒渔场 水产品销售. 张文实 主编,大安年鉴,吉林文史出版社,2018,271,年鉴.DOI:10.40187/y.cnki.yjlda.2020.001744.

[8]Duqing Qu, Guangzhong Hu, Cong Deng , Yuan Liu. Web Online Teaching Answering System based on Java Technology[J]. Frontiers in Economics and Management,2020,1(5).

[9].宁夏水产品市场:价格比较平稳,产地水产品有零星销售[J].科学养鱼,2020(04):59.

[10]莫嘉延,麦国通,区子阳,黄志权,曾云龙.广东佛山高明区销售水产品中副溶血性弧菌污染状况分析[J].公共卫生与预防医学,2019,30(06):37-39.

[11]郭胜男. 生鲜水产品冷链物流销售环节风险管理研究[D].安徽理工大学,2019.

[12]许敏慧,焦朝霞.浙江省水产品网上销售存在的问题及对策[J].电脑知识与技术,2018,14(30):283-285.DOI:10.14004/j.cnki.ckt.2018.3599.

[13] Liu Junmin, Heyuan Aquatic Product Sales Order Management System. Hubei Province, Xiaochang County Heyuan Aquaculture Professional Cooperative, 2018-10-11.

[14] Zhang Ningning. SWOT Analysis of Aquatic Product Sales [J]. Rural Economy and Technology, 2018, 29(12): 80.

[15] Fan Yu. Innovative research on aquatic product sales and cold chain distribution under the omni-channel retail model [J]. Modern Economic Information, 2018 (08): 169-170.

[16] Sheng Huijuan. Research on the e-commerce sales model of fresh aquatic products in Zhoushan [J]. Management Observation, 2017(36):57-58.

[17] GB/T 34767-2017, Good practice for sales and distribution of aquatic products [S].

thank you

With the guidance and help of my teacher, I completed this thesis. The teacher has very strict requirements on the content and format of the thesis. During the process of writing my graduation thesis, he gave suggestions many times and checked them regularly. He has strict requirements on us and helps us write the documents to the extreme and be correct. His teaching and work attitude makes me have infinite admiration and respect for him. While writing my graduation thesis, as a freshman, I was also busy looking for a job. When I encountered many choices and felt confused, the teacher gave me a lot of advice. I thank the teacher for her patience and enlightenment. I learned a lot from the chat with her. .

I would also like to thank my parents, who have always supported and believed in me, and have given me a lot of strength both spiritually and financially. Now that I will graduate and start working, I can finally repay the kindness of my parents for their upbringing and teaching. And all the teachers and classmates during my university, when I encountered problems, these teachers and classmates always helped me selflessly. I am really grateful, and I will work hard to grow into a useful person.
 

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

Guess you like

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