SSM+mysql e-commerce WeChat applet-computer graduation project source code 09228

Summary

As the use of WeChat mini programs becomes more and more widespread, in the traditional business model, people are accustomed to purchasing various daily commodities from various merchants and stores. However, in the fast-paced new era, people may not always be able to spare time for purchasing goods, let alone have the patience to choose the goods they want. Therefore, designing an e-commerce WeChat mini program not only caters to the general trend of e-commerce, but is also a breakthrough in the traditional commodity industry, which can bring changes and opportunities to the traditional commodity industry. E-commerce WeChat mini programs mainly provide users with a platform to purchase goods, attracting many consumers to purchase through price advantages, and achieving normal operations. This article mainly uses Java language, SSM framework, Mysql database, and Tomcat server as the development platform. The system uses the B/S structure to develop and complete an e-commerce WeChat applet. The goal is to implement a sales-centered computer system and build a business system that organically combines user information with account numbers, and account number and order information.

Keywords: e-commerce WeChat applet; shopping system; Mysql database

ABSTRACT

With the increasingly widespread use of WeChat mini programs, in traditional business models, people are accustomed to purchasing various daily goods from various merchant stores. However, in the fast-paced new era, people may not be able to make time for purchasing goods, let alone patiently choose the products they want. So designing an e-commerce WeChat mini program not only caters to the trend of e-commerce, but also serves as a breakthrough point for the traditional commodity industry, which can bring transformation and opportunities to the traditional commodity industry. The e-commerce WeChat mini program mainly provides users with a platform to purchase goods, attracting many consumers to make purchases through price advantages, and achieving normal operation. This article mainly uses Java language, SSM framework, MySQL database, and Tomcat server as the development platform, and the system adopts B/S structure for development, completing an e-commerce WeChat mini program. The goal is to achieve a sales centric computer system, building a business system that organically combines user information and account information, as well as account and order information.

Key words:E-commerce WeChat mini program; Shopping system; MySQL database

Table of contents

Summary  

ABSTRACT

Chapter 1 Introduction

1.1 Research background

1.2 Research significance

1.3 System goals

1.4 Structure of this article

Chapter 2 Introduction to Key Technologies

(1) Development technology 2

(2) mysql database 2

(3) B/S structure 2

(4) SSM Framework 2

(5) WeChat Developer Tools 3

Chapter 3 System Analysis

3.1 Feasibility analysis

3.1.1 Operational feasibility

3.1.2 Technical feasibility

3.1.3 Economic feasibility

3.2 Functional requirements analysis

3.3 Use case analysis

3.4 Data flow analysis

3.5 Data Dictionary

Chapter 4 System Design

4.1 Structural design

4.2 Functional design

4.3 Database design

4.3.1 Concept design

4.3. 2 table design

Chapter 5 System Detailed Design

5.1 Java EE connects to database

5.2 Login module

5.3 Consulting information module

5. 4 Product review module

5. 5 Purchase product module

5. 6 System user management module

5. 7 After-sales information management module

5. 8 Product management module

Chapter 6 System Testing

6.1 Test purpose

6.2 Test cases

Chapter 7 Conclusion

references

Acknowledgments 

  1.  introduction

1.1 Research background

Various items are people's daily consumer goods, and the supply of items has an extremely important relationship with consumer demand. Social pressure has led to increasingly busy work and an increasingly strong sense of time. Simplifying affairs and making consumption more convenient has made online sales gradually become a need for socialized consumption. At the same time, due to the continuous improvement of people's quality of life and consumption, the consumption of various items needs to change from "quantity" to "quality", and the consumability and diversification of item consumption have also become a consumer demand.

This general trend of consumer-oriented society has provided good business opportunities for the development of the online sales industry. It is understood that most of the sales companies are currently operating in the inland provinces. They have not started for a long time, and there are not many large-scale formal companies. Some are still private transactions after the buyer and seller negotiate the price. Large-scale product sales centers have appeared in Guangdong, Shandong, Beijing, Shanghai, Tianjin and other places. In particular, product sales services for family customers have emerged in large cities.

However, with the continuous growth of business volume, many companies are currently facing a more or less serious problem, that is, due to the lack of information support, the entire business process from product production to customer ordering to logistics and transportation has been disrupted. Lack of effective management, relatively primitive operating methods, rising management costs, and difficult to control error rates. This system is designed in response to the difficulties and current situations faced by enterprises, using relevant technologies to facilitate consumers' purchases and to better integrate online and offline.

1.2 Research significance

With the rapid development of e-commerce in our country, online sales have formed a certain scale and achieved great success, and its benefits to enterprises have become increasingly prominent. The rise of large e-commerce companies such as Taobao, JD.com, Amazon, Suning.com, and Gome shows the huge potential and new profit model of online sales. Online sales can speed up the release and promotion of products, simplify and automate the transaction process. The seller only needs to hand over the products to the logistics industry for operation, eliminating the cumbersomeness of the traditional transaction model. In terms of space, it can reduce store rental expenses, and there is no need to frequently purchase, unload, load, and put products on the shelves. On the other hand, it reduces the number of physical stores and provides certain relief to the current congested urban status quo.

However, there are currently some problems in the practical process of online sales:

(1) The laws and regulations regarding e-commerce are imperfect. Unscrupulous merchants unscrupulously sell fake and shoddy products through the Internet, pretending to be genuine and deceiving consumers.

(2) There is a shortage of network security technical talents. Currently, many sales systems are attacked by hackers and even information and money are stolen.

(3) Online publicity is not in place. At present, many companies have opened online sales systems, but they are not well-known among consumers.

1.3 System goals

For typical database systems, especially network systems with particularly large data traffic such as e-commerce WeChat applets, they must meet requirements such as ease of use and flexible operation. This system should meet the following goals when designing

(1) It adopts human-machine dialogue operation mode, with beautiful and friendly interface, flexible and convenient information query, accurate, safe and reliable data storage;

(2) Comprehensively display all products and be able to display major products;

(3) Facilitate customers to quickly query product information;

(4) Users can modify their basic information at any time;

(5) Implement the function of placing orders;

(6) Customers can check their order information at any time;

(7) The system conducts strict data inspection on the data input by customers to eliminate human errors as much as possible;

(8) The system maximizes ease of maintenance and operation;

(9) The system operates stably, safely and reliably.

1.4 Structure of this article

The specific content of this article includes: introduction, key technologies used in the system, system analysis, system design, system implementation and system testing. This article focuses on describing the composition and structure of the system, expounding the system's design scheme, implementation methods, and the development tools and related technologies used. In addition, it focuses on analyzing the development process of some links. This system conducted simulation tests on important modules of the system under a certain environment, confirming the usability and reliability of the system.

  1.  Introduction to key technologies

(1) Development technology

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

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

Back-end part: Use ssm as the development framework, and integrate MyBatis, Redis and other related technologies.

(2) mysql database

MySQL is a relational database management system that stores data in different tables instead of putting all the data in one big warehouse, which increases speed and flexibility. The SQL language used by MySQL is the most commonly used standardized language for accessing databases. Because its own functions are quite powerful, it has become one of the most popular database software.

MySQL is an open source small relational database management system developed by the Swedish MySQL AB company. MySQL is currently widely used in small and medium-sized websites on the Internet. Due to its small size, fast speed, low total cost of ownership, and especially the characteristics of open source, many small and medium-sized websites choose MySQL as their website database in order to reduce the total cost of website ownership.

(3) B/S structure

The system plans to adopt the BS model because it has obvious advantages over the traditional C/S structure. The B/S mode does not require deployment on each PC client, only the server side needs to be deployed, and the maintenance cost is low. There are almost no requirements for the client, and you can log in through a browser on a PC or mobile phone.

(4) SSM framework

SSM is SpringMVVM+Spring+MySQL. These three frameworks have their own unique advantages, so combining them can create strong sparks. Designers can create Web applications without spending a lot of effort, and this program also has the characteristics of clear hierarchy, upgrade and update operations that do not affect normal use, and allows multiple uses. This composite framework forms a system with a complete structure, powerful functions and good structure: SpringMVVM separates each module, Spring makes development more flexible and convenient, allowing developers to directly manipulate objects, details the division of labor at each level, and realizes inter-level communication. Decoupling makes the code more flexible and streamlined. This framework allows programmers to avoid individual errors during the development period that will lead to overall destruction, and to respond to new customer demands for the product in the later stages.

  • WeChat Developer Tools

WeChat developer tools have now been developed and run by the mini program development team. At present, WeChat developer tools are still being continuously improved, and they often need to be constantly updated when developing mini programs. You can use WeChat to scan the QR code to log in to the developer tools. The developer tools will use the information of this WeChat account to develop and debug small programs.

Model selection: The mini program uses the screen size of the smartphone as the design standard to cut the picture.

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

Console: Convenient for debugging and printing output information.

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

Resource file: Generally, breakpoint debugging of the file directory corresponding to the project can be performed in the resource file.

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

Local data storage: Displays locally stored data.

View debugging: Standard components are presented in a child-parent hierarchical structure to facilitate debugging.

WeChat limits the code size to less than 2M; legal domain name information is generally not verified during development; the server domain name needs to be configured in the background of the mini program.

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

  1.  system analysis

3.1 Feasibility analysis

This system is simple to operate and easy to understand. The operation process of e-commerce WeChat applet is similar to that of most e-commerce systems, which saves users the time and burden of learning to use the system.

3.1.1 Operational feasibility

This system uses the popular development language, Java technology. At the same time, all information is displayed in the form of web pages, and the information in the system can operate the database in the background to achieve data update effects. Users only need to know basic computer operations or know how to surf the Internet to use this system. System administrators only need to know how to upload files and process text to operate the management background. The system layout is relatively simple and the functional operations are not complicated, fully meeting the needs of the modern market. Therefore, this system is operationally feasible.

3.1.2 Technical feasibility

This system uses the Myeclipse10 development tool under the Windows7 development environment, and uses Mysql as the database management system to realize various functions of the system. Mysql is a master-slave database server, which is also the characteristic of the master-slave database server. The server itself focuses on data management and provides a consistent interface for client applications. It can improve the performance of the system and reduce its limitations.

3.1.3 Economic feasibility

Customers can purchase goods directly on the mini program. At the same time, the price of computers is very low, and their performance has made great progress. The development of this system can effectively improve work efficiency, reduce management costs, save management expenses, and bring a qualitative leap to the company's work efficiency. Therefore, this system is completely economically feasible.

3.2 Functional requirements analysis

Through this system, sellers save investment in trading venues, service quality, store maintenance and other miscellaneous expenses, thereby reducing prices; buyers not only save time costs, but also reduce purchase costs, and can "compare goods". "Three companies" to choose cost-effective products at will. It accelerates the speed of transactions and currency circulation, which in turn promotes economic growth.

According to the requirements of conditions, the system structure mainly consists of two major users. One is the user (system user, merchant, express delivery), and the other is the administrator user.

1User login and identity requirements       

Verify user and administrator information

2. Sales function requirements of this system

Allow users to leave messages online.

Allow users to consult online.

Allows users to query product information.

Allows users to manage purchase orders.

Automatically generate orders.

Users pay for their orders online.

The buyer selects the product, makes the purchase, and fills in the shipping address, contact number and other information.

Users can view logistics details for express delivery contact.

Users can submit product after-sales information online.

3 Backend management functional requirements of this system

Management of product information (add, delete, modify, query).

Management of user orders (delete, modify, query).

Product category management (add, delete, modify product categories).

Logistics information, consultation information, and after-sales information management

3.3 Use case analysis

1. The figure below describes the use case of the administrator.

Figure 3-1 Administrator use case diagram

2. The figure below shows the user use case diagram.

Figure 3-2 User use case diagram

3.4 Data flow analysis

The design of the data flow diagram is mainly because the current functions of the system have not yet been determined. You can first describe the functional content that may be used, and learn from the user information such as "what data the system receives from the outside world" and "what data the system sends to the outside world." Design a data flow diagram based on the responses given by users.

The following is the layer 0 data flow diagram of the system. System users are divided into administrators and ordinary users.

    

Figure 3-3 System data flow diagram (layer 0)

The following figure shows the system layer 1 data flow diagram.

Figure 3-4 System data flow diagram (layer 1)

The second-layer data flow diagram of the e-commerce WeChat applet mainly reflects in detail the principles of interaction between operations and data corresponding to each functional module. It also displays the data flow of each role's operation of functional modules in more detail, allowing developers to understand the development direction of the system and develop a system model more accurately.

The product information maintenance is refined to obtain the second-layer data flow chart of product information management, as shown in the figure below.     

Figure 3-5 Product management data flow diagram (layer 2)

The order information management is refined to obtain the second-layer data flow chart of order information management, as shown in the figure below.

Figure 3-6 Order management data flow diagram (layer 2)

3.5 Data Dictionary

1. Data storage description

The following table describes the data flow, data source, data destination and terms composed of data flow of user information.

Table 3-1 User information description

data flow

User Info

Data flow source

User information table, user details table in Mysql database

Data destination

System interface, user information management interface

Data flow composition

User name, user password, addition time, number

The following table describes the data flow, data source, data destination and data flow terms of purchase order information.

Table 3-2 Purchase order information description

data flow

Purchase order information

Data flow source

Purchase order table and purchase order details table in Mysql database

Data destination

Purchase order interface

Data flow composition

Purchase order ID, user ID, product ID, quantity

The following table describes the data flow, data source, data destination and terms composed of data flow of order information.

Table 3-3 Order information description

data flow

order information

Data flow source

Order table and order details table in Mysql database

Data destination

User order interface, order management interface

Data flow composition

User ID, order ID, product ID, order time, order amount

The following table describes the data flow, data source, data destination and data flow terms of commodity management.

Table 3-4 Product information description

data flow

Product information

Data flow source

Product table and product category table in Mysql database

Data destination

Product query interface, product details interface, purchase order interface, product management interface

Data flow composition

Product name, product price, inventory quantity, product category

2. Description of data processing

The following table describes the user's authentication process by entering the user name and password. After successful authentication, the returned information is displayed on the interface.

Table 3-5 User authentication

Handle logical names

User authentication

Brief description

Check the validity of the entered information

input data stream

Username + Password

Processing

According to the entered user name and password, retrieve the user and display the query information

Output data stream

User information, product information

The following table describes how the user can query logistics information through the user name after successfully logging into the system, and the data returned after the query is displayed on the interface.

Table 3-6 Logistics information query

Handle logical names

Logistics information inquiry

Brief description

Check the validity of the entered information

input data stream

Username or logistics status

Processing

Users who have successfully logged in can query the logistics details of the user's order through their username.

Output data stream

User logistics information

The following table describes that users can add consultations after successfully logging into the system. After adding, the consultation table is re-queried, and the returned consultation data is displayed on the interface.

Table 3-7 Adding consultation information

Handle logical names

Consulting information added

Brief description

Check the validity of the entered information

input data stream

Consulting Information

Processing

Users who successfully log in will add a piece of consultation information data to the database.

Output data stream

Consult product information

The following table describes that after the administrator user successfully logs into the system, he purchases goods and fills in the order consignee, delivery address, contact number, etc. After generating the purchase order, he re-queries the order form and the returned order data is displayed on the interface.

Table 3-8 Order generation

Handle logical names

Order generation

Brief description

Check the validity of the entered information

input data stream

order information

Processing

Users who successfully log in add an order information data to the database.

Output data stream

order information

  1.  system design

4.1 Structural design

The design of this system is based on Java technology + Mysql database + Tomcat server. Myeclipse10 is used as the development tool, and Photoshop CS6 technology is used to beautify the web page, supplemented by CSS technology. The main roles used in this system include system administrators, system users, merchant users, and express delivery users. The system is divided into front desk and back desk.

The system functional structure diagram is shown below.

Figure 4-1 System functional structure diagram

4.2 Functional design

1. User login module: Ensuring the authenticity of user registration information is an important factor in improving system efficiency and profitability. Only real users can bring value. Registration is the first step to ensure that real users use the main business of the system. By reviewing user registration information, machine registration can be prevented. Use the more popular administrator verification method for account activation to filter user registration information. User information that is not activated will not be able to use the main functions of the system.

The figure below shows the user login flow chart.

Figure 4-2 User login flow chart

2. Product browsing module: Both non-logged-in users and logged-in users can browse products in the system front desk. Users can view detailed information of products and select the corresponding product category to view products under that category. Users can also browse products by product name. Search with keywords.

The figure below shows the product browsing flow chart.

Figure 4-3 Product browsing flow chart

3. Order module: After the user purchases the goods, he fills in the delivery address, consignee, phone number and other information to generate order information. The administrator can maintain and manage the order. 

The figure below shows the order management flow chart.

Figure 4-4 Order management flow chart

4. Product management module

System administrators can add, delete, modify, and check product information.

5. User management module

System administrators can add, delete, modify, and check user information.

4.3 Database design

4.3.1 Concept design

The ER diagram of this system shows the relationship between various entities in the system. After analysis, the entities of the system include commodities, commodity categories, users, etc.

The entity diagram of product information is shown in the figure below.

Figure 4-5 Product information entity diagram

The product category entity diagram is shown in the figure below.

Figure 4-6 Product category information entity diagram

The order information entity diagram is shown in the figure below.

Figure 4-7 Order information entity diagram

The logistics information entity diagram is shown in the figure below.

Figure 4-8 Logistics information entity diagram

The overall entity diagram of the system is shown in the figure below.

4.3.2 Table design

    数据库表设计:经过前期的需求分析、可执行分析、数据流分析等各个流程分析,结合软件工程的高内聚、低耦合规则,并考虑到以后的程序功能扩展,设计如下几张表

表after_sales_information (售后信息)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

after_sales_information_id

int

10

0

N

Y

售后信息ID

2

order_number

varchar

64

0

Y

N

订单编号

3

store_name

varchar

64

0

Y

N

店铺名称

4

merchant_users

int

10

0

Y

N

0

商户用户

5

product_number

varchar

64

0

Y

N

商品编号

6

product_name

varchar

64

0

Y

N

商品名称

7

user_information

int

10

0

Y

N

0

用户信息

8

user_name

varchar

64

0

Y

N

用户姓名

9

contact_number

varchar

64

0

Y

N

联系电话

10

purchase_quantity

varchar

64

0

Y

N

购买数量

11

after_sales_type

varchar

64

0

Y

N

售后类型

12

after_sales_reasons

text

65535

0

Y

N

售后原因

13

merchant_review

varchar

64

0

Y

N

商户审核

14

merchant_response

text

65535

0

Y

N

商户回复

15

recommend

int

10

0

N

N

0

智能推荐

16

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

17

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表consultation_information (咨询信息)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

consultation_information_id

int

10

0

N

Y

咨询信息ID

2

consultation_title

varchar

64

0

Y

N

咨询标题

3

store_name

varchar

64

0

Y

N

店铺名称

4

merchant_users

int

10

0

Y

N

0

商户用户

5

product_name

varchar

64

0

Y

N

商品名称

6

user_information

int

10

0

Y

N

0

用户信息

7

consultation_content

text

65535

0

Y

N

咨询内容

8

merchant_response

text

65535

0

Y

N

商户回复

9

recommend

int

10

0

N

N

0

智能推荐

10

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

11

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表express_contact (快递联系)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

express_contact_id

int

10

0

N

Y

快递联系ID

2

order_number

varchar

64

0

Y

N

订单编号

3

store_name

varchar

64

0

Y

N

店铺名称

4

product_name

varchar

64

0

Y

N

商品名称

5

user_information

int

10

0

Y

N

0

用户信息

6

user_name

varchar

64

0

Y

N

用户姓名

7

contact_number

varchar

64

0

Y

N

联系电话

8

shipping_address

varchar

64

0

Y

N

收货地址

9

express_delivery_users

int

10

0

Y

N

0

快递用户

10

express_content

text

65535

0

Y

N

快递内容

11

customer_response

text

65535

0

Y

N

客户回复

12

recommend

int

10

0

N

N

0

智能推荐

13

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

14

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表express_delivery_users (快递用户)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

express_delivery_users_id

int

10

0

N

Y

快递用户ID

2

user_name

varchar

64

0

Y

N

用户姓名

3

user_gender

varchar

64

0

Y

N

用户性别

4

examine_state

varchar

16

0

N

N

已通过

审核状态

5

recommend

int

10

0

N

N

0

智能推荐

6

user_id

int

10

0

N

N

0

用户ID

7

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

8

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表hits (用户点击)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

hits_id

int

10

0

N

Y

点赞ID:

2

user_id

int

10

0

N

N

0

点赞人:

3

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

4

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

5

source_table

varchar

255

0

Y

N

来源表:

6

source_field

varchar

255

0

Y

N

来源字段:

7

source_id

int

10

0

N

N

0

来源ID:

表logistics_information (物流信息)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

logistics_information_id

int

10

0

N

Y

物流信息ID

2

order_number

varchar

64

0

Y

N

订单编号

3

store_name

varchar

64

0

Y

N

店铺名称

4

merchant_users

int

10

0

Y

N

0

商户用户

5

product_name

varchar

64

0

Y

N

商品名称

6

user_information

int

10

0

Y

N

0

用户信息

7

user_name

varchar

64

0

Y

N

用户姓名

8

contact_number

varchar

64

0

Y

N

联系电话

9

shipping_address

varchar

64

0

Y

N

收货地址

10

express_delivery_users

int

10

0

Y

N

0

快递用户

11

logistics_status

varchar

64

0

Y

N

物流状态

12

logistics_description

text

65535

0

Y

N

物流描述

13

recommend

int

10

0

N

N

0

智能推荐

14

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

15

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表merchant_users (商户用户)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

merchant_users_id

int

10

0

N

Y

商户用户ID

2

store_name

varchar

64

0

Y

N

店铺名称

3

merchant_name

varchar

64

0

Y

N

商户姓名

4

merchant_gender

varchar

64

0

Y

N

商户性别

5

examine_state

varchar

16

0

N

N

已通过

审核状态

6

recommend

int

10

0

N

N

0

智能推荐

7

user_id

int

10

0

N

N

0

用户ID

8

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

9

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表order_information (订单信息)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

order_information_id

int

10

0

N

Y

订单信息ID

2

order_number

varchar

64

0

Y

N

订单编号

3

store_name

varchar

64

0

Y

N

店铺名称

4

merchant_users

int

10

0

Y

N

0

商户用户

5

product_number

varchar

64

0

Y

N

商品编号

6

product_name

varchar

64

0

Y

N

商品名称

7

commodity_price

varchar

64

0

Y

N

商品价格

8

user_information

int

10

0

Y

N

0

用户信息

9

user_name

varchar

64

0

Y

N

用户姓名

10

contact_number

varchar

64

0

Y

N

联系电话

11

shipping_address

varchar

64

0

Y

N

收货地址

12

purchase_quantity

int

10

0

Y

N

0

购买数量

13

total_purchase_price

varchar

64

0

Y

N

购买总价

14

purchase_notes

text

65535

0

Y

N

购买备注

15

order_status

varchar

64

0

Y

N

订单状态

16

order_remarks

text

65535

0

Y

N

订单备注

17

pay_state

varchar

16

0

N

N

未支付

支付状态

18

pay_type

varchar

16

0

Y

N

支付类型: 微信、支付宝、网银

19

recommend

int

10

0

N

N

0

智能推荐

20

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

21

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表product_information (商品信息)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

product_information_id

int

10

0

N

Y

商品信息ID

2

store_name

varchar

64

0

Y

N

店铺名称

3

merchant_users

int

10

0

Y

N

0

商户用户

4

product_number

varchar

64

0

Y

N

商品编号

5

product_name

varchar

64

0

Y

N

商品名称

6

product_type

varchar

64

0

Y

N

商品类型

7

commodity_price

int

10

0

Y

N

0

商品价格

8

inventory_of_goods

int

10

0

Y

N

0

商品库存

9

product_specifications

varchar

64

0

Y

N

商品规格

10

product_image

varchar

255

0

Y

N

商品图片

11

product_introduction

longtext

2147483647

0

Y

N

商品介绍

12

hits

int

10

0

N

N

0

点击数

13

praise_len

int

10

0

N

N

0

点赞数

14

recommend

int

10

0

N

N

0

智能推荐

15

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

16

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间


  1.  系统详细设计

5.1登录模块

一个系统最基本的功能就是登录功能,本系统可以进行系统登录的角色有系统用户、商户用户、快递用户、管理员,用户对应前台登录界面,管理员对应后台登录界面,首先进入登录页,输入用户名和密码,然后提交至服务端进行数据库数据验证,通过JavaEE逻辑代码判断数据库是否存在用户输入的这一个记录,如果存在,则判断用户身份,如果是用户,则进入用户前台,如果是管理员用户,则进入系统主页,并把用户对象存放在session中,如果不存在这样一条记录,则返回登录界面。

登录界面如下所示。

图5-1前台登录界面

图5-2用户注册界面

登录关键代码如下:

 /**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

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

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

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

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

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

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

        List resultList = null;

        QueryWrapper wrapper = new QueryWrapper<User>();

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

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

            map.put("username", username);

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

        }

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

            map.put("email", email);

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

        }

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

            map.put("phone", phone);

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

        }else{

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

        }

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

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

        }

        //判断是否有这个用户

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

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

        }

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

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

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

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

        if (groupList.size()<1){

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

        }

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

        //查询用户审核状态

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

            String res = service.selectExamineState(userGroup.getSourceTable(),byUsername.getUserId());

            if (res==null){

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

            }

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

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

            }

        }

        //查询用户状态

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

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

        }

        String md5password = service.encryption(password);

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

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

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

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

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

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

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

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

        }

}

    public String select(Map<String,String> query,Map<String,String> config){

        StringBuffer sql = new StringBuffer("select ");

        sql.append(config.get(FindConfig.FIELD) == null || "".equals(config.get(FindConfig.FIELD)) ? "*" : config.get(FindConfig.FIELD)).append(" ");

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

        if (config.get(FindConfig.GROUP_BY) != null && !"".equals(config.get(FindConfig.GROUP_BY))){

            sql.append("group by ").append(config.get(FindConfig.GROUP_BY)).append(" ");

        }

        if (config.get(FindConfig.ORDER_BY) != null && !"".equals(config.get(FindConfig.ORDER_BY))){

            sql.append("order by ").append(config.get(FindConfig.ORDER_BY)).append(" ");

        }

        if (config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE))){

            int page = config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE)) ? Integer.parseInt(config.get(FindConfig.PAGE)) : 1;

            int limit = config.get(FindConfig.SIZE) != null && !"".equals(config.get(FindConfig.SIZE)) ? Integer.parseInt(config.get(FindConfig.SIZE)) : 10;

            sql.append(" limit ").append( (page-1)*limit ).append(" , ").append(limit);

        }

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

        return sql.toString();

}

    public List selectBaseList(String select) {

        List<Map<String,Object>> mapList = baseMapper.selectBaseList(select);

        List<E> list = new ArrayList<>();

        for (Map<String,Object> map:mapList) {

            list.add(JSON.parseObject(JSON.toJSONString(map),eClass));

        }

        return list;

}

5.3咨询信息模块

用户可以在线进行问题咨询提交店铺,咨询信息展示界面。

如下图所示为咨询信息界面。

图5-3咨询信息界面

咨询信息关键代码如下:

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

}

5.4商品评论模块

系统提供商品评论功能,在pinglunadd.jsp实现商品的评论,添加评论后,存入数据库的评论表。管理员管理商品的评论信息。

如下图所示为评论的部分界面。

图5-4评论界面

5.5购买商品模块

用户可以搜索查看商品后进行商品购买,确定商品之后可以生成订单,然后支付。

如下图所示为订单信息的界面。

图5-5购买商品界面

购买商品的关键代码

@RequestMapping("/get_obj")

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

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

        if (resultList.size() > 0) {

            JSONObject jsonObject = new JSONObject();

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

            return success(jsonObject);

        } else {

            return success(null);

        }

}

5.6系统用户管理模块

过去传统的手工登记管理系统人员信息很不方便,也很容易造成数据出错,所以本系统需要一个可以管理登记人员信息的功能,管理员登入系统,可以添加新的管理员用户,删除现有的管理员,也可以对自己的密码和管理员用户的密码进行修改。修改密码是经过跟数据库的原来的密码字段的数据进行判断,如果输入两次的新密码一致,则更新密码这属性对应的一条数据。

如下图所示为系统用户管理的部分界面。

图5-6系统用户管理界面

如下图所示为个人资料修改界面。

图5-7修改个人资料界面

系统用户管理关键代码如下:

@PostMapping("/upload")

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

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

        if (file.isEmpty()) {

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

        }

        try {

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

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

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

            File targetDir = new File(filePath);

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

                if (targetDir.mkdirs()) {

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

                } else {

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

                }

            }

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

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

            String fileName = file.getOriginalFilename();

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

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

            String suffix = fileName.substring(lastIndexOf);

            fileName = IdWorker.getId()+suffix;

            File dest = new File(filePath + fileName);

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

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

            file.transferTo(dest);

            JSONObject jsonObject = new JSONObject();

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

            return success(jsonObject);

        } catch (IOException e) {

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

        }

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

}

5.7售后信息管理模块

用户可以在线进行商品售后提交,完善用户信息、联系电话、售后类型、购买数量、售后原因信息后进行提交商户,由商户进行审核处理,管理员端可以对售后信息进行管理。

售后信息提交的界面如下图所示。

图5-8售后信息提交界面

5.8商品管理模块

商品可以对商品进行增删查改的操作,这些操作将在商品管理界面进行,管理员端可以对商品信息进行管理。

如下图为商品管理界面。

图5-9商品管理界面

商品管理关键代码如下:

@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.  系统测试

6.1测试目的

该系统能够完成商品管理、商品展示、物流信息管理、订单管理、售后管理、快递联系管理等功能,做到所开发的系统操作简单,尽量使系统操作不受用户对电脑知识水平的限制,符合系统可维护性,由于系统涉及的信息比较广,数据库中的数据需定期修改,系统可利用的空间及性能也随之下降,为了使系统更好地运转,系统可以对系统数据及一些简单的功能进行独立的维护及调整;符合系统开放性要求,该系统能够在开放的硬件体系结构中运行,并且能与其他系统顺利连接。

6.2测试用例

1.注册测试

表6-1注册测试用例

字段名称

描述

测试项

首页注册功能测试

输入数据

1、输入正确的邮箱、用户名、密码、确认密码、以及验证码之后点击“注册”按钮

2、输入错误的用户名或密码、邮箱、验证码等,单击“注册”按钮

3、不输入邮箱、用户名、密码、确认密码、以及验证码之后点击“注册”按钮

预计输出数据

1、用户能正确注册账号,成功插入数据库用户的账户资料,提示注册成功。

2、无法注册用户信息,注册失败。

3、无法注册用户信息,注册失败。

使用上述测试用例对前台首页注册界面进行测试,当在输入正确的邮箱、用户名、密码、确认密码、以及验证码之后,系统将弹出注册成功信息提示对话框。

使用上述测试用例对前台首页注册界面进行测试,当在输入错误的用户名或密码、邮箱、验证码之后,系统将提示错误。

使用上述测试用例对前台首页注册界面进行测试,当在不输入用户名、密码、邮箱、验证码之后,点击注册按钮。

2.登录界面进行测试 

表6-2登录测试用例

测试项

首页登录功能测试

输入数据

1、输入正确的用户名和密码,单击“登录”按钮

2、输入错误的用户名和密码,单击“登录”按钮

3、不输入用户名和密码,单击“登录”按钮

预计输出数据

1、数据库中存在的用户能正确登录,。结果弹出主界面。

2、错误的或者无效用户登录,登录系统失败。

3、输入用户名或密码信息为空,登录系统失败。

3.商品管理进行测试 

名称:用户管理测试        目的:测试商品管理界面 

内容:口令的输入,合法性检查,合理性检查,界面的显示控制。 

下表描述了商品表中目前所存在的记录。

表6-5商品表预存数据

    商品名

商品规格

商品价格

商品状态

A

A

389

上架

B

B

249

上架

C

C

322

下架

D

D

168

上架

添加时应注意事项:

管理员添加商品时必须添加已存在的商品类别,若该商品不属于现有的所有类别,则应该先添加商品类别。

下表描述了添加商品进行测试的用例,主要是为了防止添加商品时出现异常和存在的漏洞。

表6-6添加商品测试用例

输入

输出

商品名

商品价格

商品图片

   空

参数错误

参数错误

请选择上传图片

A

1

a.jpg

添加成功

4.购买商品测试 

名称:购买商品测试        目的:测试购买商品界面 

内容:口令的输入,合法性检查,合理性检查,界面的显示控制。 

下表描述了购买商品的测试用例,防止购买时出错。

表6-7购买商品测试用例

输入

输出

用户ID

商品ID

商品数量

11

1

1

购买商品成功

22

薯片

请填写商品数量

33

薯片

a

购买失败

用户购买商品时,首先判断商品数量是否小于库存,若超出库存数量,则提示商品数量不足。

  1.  结论

经过这几个月的设计和开发,“基于SSM的电商微信小程序”已经完成了,其功能符合设计需求,能够完成用户的注册、在线购买、商品管理、售后处理、物流信息管理、咨询信息管理、快递联系管理等功能。经过最后的使用,证明系统完全具有可行性与可扩充性。

在系统的分析阶段,主要是分析系统的需求,理解系统要完成的基本功能,找出系统的用例(Use Case)和角色(Actor),画出系统的用例模型图,用例模型是此后系统建模的基础。在用例的基础上分析顺序图和协作图,得到系统的所有对象,然后建立对象模型。抽象出系统的类,并将系统中联系紧密的类划分为若干个包,画出包图。有了这些基础,就可以将系统划分为小单元功能模块。

整个过程中,我必须认可UML统一建模语言,它让我很清晰的知道自己想做什么,想实现什么,对系统后面的代码编写起到决定性的帮助,同时经过本次系统的设计与实现,让我积累了很多经验,提高了编写程序的能力,为以后的学习和工作打下了坚实的基础。

由于时间有限,本系统还有待继续完善和改进,因此需要进一步进行分析和修改,以使其更加完善! 

参考文献

  1. 王江霖,黄彩霞,樊旭龙.基于SSM框架的网络资源共享平台的研究与实现[J].电脑知识与技术,2021,17(28):76-78.
  2. 曹华山.SSM框架在Web应用开发中的设计与实现[J].无线互联科技,2021,18(11):108-109.
  3. 程红琳. 网上购物系统品目扩容效果几何[N]. 中国政府采购报,2021-05-18(005).
  4. 马君峰, 农产品自营网上购物系统智慧平台V1.0. 甘肃省,甘肃科博科技咨询有限责任公司,2021-02-01.

[5]王娟.基于Android系统的手机网上购物系统设计与实现[J].电子技术与软件工程,2021(03):43-44.

[6]韩己峰.综合性网上购物系统引领山东政府采购驶入高速路[J].中国政府采购,2020(12):39-41.

[7]袁江琛.基于MVC框架网上购物系统的设计与实现[J].信息与电脑(理论版),2020,32(20):126-128.

[8]袁江琛.Ajax+jQuery在网上购物系统购物车模块中的设计与实现[J].电脑编程技巧与维护,2020(10):34-35+68.

[9]王柯梦,王瑞平.基于B2C网上购物系统前台系统数据库设计与实现[J].广西质量监督导报,2020(09):70-71.

[10]薄志强. 基于SSM框架的网上购物系统系统的设计与实现[D].西安电子科技大学,2020..

[11]张浩. 基于网上购物系统服务对话系统的研究与实现[D].黑龙江大学,2020.

[12]孙建英.分布式、集中式、区块链技术在网上购物系统中的应用[J].商场现代化,2020(01):13-15.

[13]李颖,方浪,武瑞婵.“Free-Try”虚拟试衣在网上购物系统中的实现[J].襄阳职业技术学院学报,2019,18(06):64-66.

[14]王一凡. 基于MOT的云南移动网上购物系统O2O手机营销策略优化研究[D].云南大学,2019.

[15]布祉颖.论B2C和O2O的进口商品营销的模式——关于零始科技有限公司的零始网研究[J].现代妇女(下旬),2018(12):75-76.

[16]老潘,花椰菜.商品控的购物车[J].宠物世界(狗迷),2018(12):50-55.

致 谢

大学的学习生活总是感觉短暂的,总感到知识还没有学够,但大学毕业就在我们面前,即毕业设计即将的结束,意味着我们的大学生涯即将结束。毕业设计是我们在大学所学知识的一次总结,更是对我们过去所学知识的提炼和升华,通过毕业设计,我们认识到大学学习过程中还有那些知识没有掌握,那些知识需要我们进入深入研究。这次毕业设计让我学到了很多新的知识,研究了一些新的以前自己不熟悉的领域,使我处理问题的能力得到了一定的提升,同时也为今后的继续深造或踏入社会大门提供了很好的锻炼机会。

我也曾经沮丧过,失落过,想放弃过,可是因为你们这不厌其烦的鼓励和支持才使得我坚持了下来,这里我要对我的老师和同学们说句“谢谢你们”。因为我们的知识是有限的,所以本文将不可避免的会出现一些错误和不足之处,还请老师指正。

免费领取项目源码,请关注❥点赞收藏并私信博主,谢谢~

Guess you like

Origin blog.csdn.net/vx2_Biye_Design/article/details/132901676