(Source code attached) Python Xingnong Shopping Website System Computer Graduation Design 38256

Django Xingnong shopping website system

Summary

 Assisting farmers is currently a key task for our country to build a moderately prosperous society in an all-round way. Due to the vast rural area of ​​our country, the large number of poor people, and the large regional differences, the poverty alleviation methods in different regions are also different. In recent years, with the popularity of the Internet. Many rural areas are rich in products, but due to poor sales channels and other reasons, farmers are in a state of poverty where they cannot get rich. The Xingnong shopping website system can solve this problem. Farmers can release and sell agricultural products on the system, and users can also You can purchase in the system and view traceability information, which has practical and far-reaching significance for expanding domestic demand and promoting the sales and development of agricultural products.

The Xingnong shopping website system mainly provides users with a platform to purchase agricultural products. This article mainly uses Python language and MySQL database technology, based on the Django framework as the development platform, to complete a Xingnong shopping website system.

Keywords: Django framework; shopping website; MySQL database

Django Xingnong Shopping Website System

ABSTRACT

The work of assisting agriculture is currently the key task for China to fully build a moderately prosperous society. Due to the vast rural area, large numbers of poor people, and large regional differences, the poverty alleviation methods in different regions are also different. In recent years, with the popularization of the network. Many rural areas are rich in products, but due to poor sales channels and other reasons, farmers are in a poverty situation where they cannot become rich. The Xingnong shopping website system can precisely solve this problem. Farmers can publish and sell agricultural products on the system, and users can also purchase products on the system. It can also conduct traceability information review, which has practical and far-reaching significance for expanding domestic demand and promoting the sales development of agricultural products.

The Xingnong shopping website system mainly provides users with a platform for purchasing agricultural products. This article mainly uses Python language and MySQL database technology, based on the Django framework as a development platform, to complete a Xingnong shopping website system.

Key words: Django framework; Shopping website; MySQL database

Table of contents

Summary  

ABSTRACT

Chapter 1 Introduction

1.1 Research background

1. 2 System Goals

1. 3 Structure of this article

Chapter 2 Introduction to Key Technologies

2.1 Introduction to Pycharm 3

2.2 MySQL description 3

2.3 Python programming language 3

2.4 Django framework 4

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 Logic design

4.3.3 Table design

Chapter 5 System Detailed Design

5.1 Login module

5.2 Registration module

5.3 Product information module

5. 4 Purchase product module

5. 5 User management module

5. 6 Product Category Module

5. 7 Traceability case management module

5. 8 Order Management Module

Chapter 6 System Testing 3 1

6.1 Test purpose 3 1

6.2 Test Case 3 3

Chapter 7 Conclusion 3 6

References 3 7

Acknowledgments 3  8

  1.  introduction

1.1 Research background

With the advancement of the reform and opening up process, my country's economic development has made great progress. However, due to the uncoordinated regional development, there are still tens of millions of rural poor people in our country. my country's existing rural poor population is characterized by strong dispersion, deep poverty, and large poverty areas. As the development strategic goal of building a moderately prosperous society in all respects by 2020 approaches, rural agricultural assistance methods based on geographical areas are no longer suitable to solve the existing poverty phenomenon. Designing a Xingnong shopping website system is an agricultural assistance system developed based on mobile terminals. By adapting measures to local conditions and household policies, promoting rural agricultural products and releasing sales, the system achieves informatization, real-time, and data-based efficiency to promote the sales development of agricultural products. , play a practical role in helping farmers in rural areas. In the process of rapid development of my country's information technology and e-commerce platforms, online sales of agricultural products have become one of the main means to increase the marketing channels and quantity of agricultural products and play a very important role. .

1.2 System goals

For a typical database system, especially a network system with large data traffic like the Xingnong shopping website system, it must meet the requirements of 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) Farmers can publish all agricultural products and display main agricultural products;

(3) Facilitate buyers to quickly query product information;

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

(5) Sellers can publish product information, and regulatory users can copy and review the release of agricultural products;

(6) Users can place orders online and check their product order information and product traceability 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.3 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

2.1 Introduction to Pycharm

PyCharm is the most popular IDE for the Python scripting language.

1. Each file has its output window.

2. You can terminate the process (just click the button).

3. Various prompts are super powerful: ① The color of unused variables will turn gray ② There will be a red wavy line under the wrong variable ③ Writing prompts (sublime also has them but it is weaker).

4. The indexing function is super powerful.

2.2MySQL description

Now the MySQL database can support many users on the network, and can also adapt to the deployment or configuration of customer machines and servers. Our servers and clients 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. It has always been the leader. It is not only very powerful, but also very convenient to use. MySQL's cross-platform capabilities are 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. Database management is achieved 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.

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

Advantage 2: MySQL can also support animation, graphics and sound data types, which shows that MySQL can also support multiple data types.

Advantage three: MySQL can also be developed on multiple platforms, and multiple programming languages ​​for software development can operate the MySQL database.

2.3Python programming language

Python is a development language that can be used as a computer language in a literal way and can be used for object-oriented programming. It was developed by Guido van Rossum in the late 1880s and released for public use in 1991. Python has many features, such as concise syntax, clear statements, and rich class libraries. Due to these advantages, it can be combined with other languages ​​very quickly to implement various functional modules. Many people have nicknamed it "sticky glue" language. Using Python to quickly generate program prototypes is a method used by many programmers today. If there are any special requirements, they can be easily modified.

Moreover, PyQt has dual certificates, which ensures that it can run across platforms (such as UNIX, Microsoft and Apple platforms).

Before using the Python language, you need to install the platform. Users need to download different versions according to different platforms, and then configure the environment variables before running.

Python features:

1. Compared with other computer languages, it is relatively easy to learn: Python has fewer keywords, a relatively simple structure, and simple syntax, making it easier for people who are just learning programming languages ​​to get started.

2. It is relatively easy to read: Python code structure is concise and clear, and the definition also looks very clear, so it is easier to read.

3. Easy to maintain: Python’s maintenance is simple and convenient.

4. The standard library is particularly extensive: The biggest advantage of Python is that it has a lot of libraries, which are cross-platform and have good compatibility with the system. For example, it is compatible with UNIX, Windows and Macintosh systems.

5. Convenient interactive mode: With the support of interactive mode, developers can see the results from the code, making it more convenient for developers to test and debug programs.

6. Good portability: Python can run across platforms.

7. Very good scalability: If there is critical code, you can write it in a special language and debug and run it in the system.

2.4Django framework

Django is an open source web framework written in Python with complete website building capabilities. Using Django, with very little code, Python program developers can easily complete most of the content required for a formal website, and further develop full-featured web services.

Django itself is based on the MVC model, that is, the Model + View + Controller design pattern, so it naturally has the excellent genes of MVC: fast development, easy deployment, high reusability, and low maintenance costs. Python plus Django is the best combination for rapid development, design, and deployment of websites.

  1.  system analysis

3.1 Feasibility analysis

The operation of this system is simple and easy to understand. The operation process of the agricultural products sales mall is similar to that of most e-commerce systems, which avoids complicated processes and low efficiency when users use it. This design is based on the Django framework and uses Python technology and MySQL. Database and Myeclipse implementation.

3.1.1 Operational feasibility

This system uses the popular development language, namely Python 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 Django framework and MySQL as the database management system to implement various functions of the system under the Windows 7 development environment. 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

This system is a agricultural shopping website system. Users can directly purchase farmers' products on the system. At the same time, the price of the computer is very low, but the 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, agricultural products can be sold and rural farmers can be assisted. According to the needs of conditions, the system structure is mainly composed of four major users. The first is the user composed of buyers, the second is the seller, the third is the supervisory user, and the fourth is the system administrator.

1User login and identity requirements       

Verify information of users, administrators, etc.

2 Functional requirements for product sales of this system (for users)

Allow users to leave messages online.

Allow users to review products.

Allows users to query product information.

Allow users to place orders for products and publish reviews.

Automatically generate orders.

Select the product, make the purchase, and fill in the address, contact number and other information.

Traceability case, you can view the traceability case information of a certain product.

3 Functional requirements for product release in this system (for sellers)

Product release, product information search.

Product information, title, product name, description, original price, selling price, classification, origin, specifications, pictures.

Order information, order, total price, logistics information, etc.

Traceability cases: publish product traceability case information.

Logistics information, update order logistics information.

4 Product traceability functional requirements of this system (for regulatory users)

Product release: Review product information released by sellers.

Order list: View the user's order information.

Order evaluation: View evaluation information posted by users.

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 registered user use case diagram.

Figure 3-2 Registered user use case diagram

  1. The figure below shows the seller use case diagram.

                     

      Figure 3-3 Seller use case diagram

  1. The following figure shows the supervisor use case diagram.

                    

        Figure 3-4 Supervisor 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-4 System data flow diagram (layer 0)

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

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

The second-layer data flow diagram of the Xingnong shopping website system 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-6 Product information management data flow diagram (layer 2)

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

Figure 3-7 Product 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 terms composed of data flow of product information.

Table 3-2 Product information description

data flow

Agricultural products information

Data flow source

Product table, product details table in MySQL database

Data destination

Product interface

Data flow composition

Product ID, price, pictures, origin

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, order details table in MySQL database

Data destination

User order interface, order management interface

Data flow composition

User ID, order ID, product ID, order amount

The following table describes the data flow, data source, data destination and data flow entries of logistics information.

Table 3-4 Logistics information information description

data flow

Logistics information

Data flow source

Logistics information table and product details table in MySQL database

Data destination

Product details interface, shopping cart interface, logistics information management interface

Data flow composition

Logistics company, order number, product details, logistics progress

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 the seller information through the seller information name after successfully logging into the system, and the data returned after the query is displayed on the interface.

Table 3-6 Seller Information Query

Handle logical names

Seller information information query

Brief description

Check the validity of the entered information

input data stream

Seller information name or seller information number or seller information category

Processing

Users who successfully log in can query the seller information required by the user through the seller information name.

Output data stream

seller info

The following table describes that seller users can add products after successfully logging into the system. After adding, re-query the product table, and the returned product data will be displayed on the interface.

Table 3-7 Add product information

Handle logical names

Product information added

Brief description

Check the validity of the entered information

input data stream

product information

Processing

Seller users who successfully log in will add a piece of product information data to the database.

Output data stream

Product information, order 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

The following table describes how the user queries the traceability case information through the traceability case title after successfully logging into the system. After the query, the returned traceability case data is displayed on the interface.

Table 3-9 Traceability case information query

Handle logical names

Traceability case information query

Brief description

Check the validity of the entered information

input data stream

Traceability case title

Processing

Users who successfully log in can query the traceability case information required by the user through the traceability case title.

Output data stream

Traceability case information

  1.  system design

4.1 Structural design

The design of this system is based on Django technology + MySQL database, using Python as the development tool, and using Photoshop CS6 technology to beautify the web page, supplemented by CSS technology. The main roles used in this system are system administrators and ordinary users (registered users, sellers, supervisors). The system is divided into front desk and back desk. The front desk is mainly used to facilitate the display and purchase of agricultural products, product information, orders, logistics information, and evaluation. , traceability cases, etc. The backend is used for the management of product information and product order information, logistics information, and traceability case management.

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 product details 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 management module: After the user purchases the product, he fills in the delivery address, consignee, phone number and other information to generate order information. The administrator can review the order, delete and modify the order, and deliver the corresponding product to the order information. 

The figure below shows the order management flow chart.

Figure 4-4 Order management flow chart

4. Product management module

Sellers can add, delete, modify, and check product information.

5. User management module

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

6. Purchase modules

Users can perform operations such as adding, deleting, modifying, and checking the purchased items that individuals have added to the purchase information.

The figure below shows the purchase module flow chart.

Figure 4-5 Purchase module flow chart

7.Logistics information management module

Users logistics goods online, sellers publish logistics, and manage and delete logistics information.

8. Traceability case management module

System administrators can add, delete, modify, and check traceability cases.

4.3 Database design

4.3.1 Concept design

The ER diagram of this system shows the connection between various entities in the system. After analysis, the entities of the system include product information, order list, logistics information, traceability cases, user information, etc.

产品实体图如下图所示。

图4-6品实体图

用户实体图如下图所示。

图4-7用户实体图

订单列表的实体图如下图所示。

图4-8订单列表实体图

4.3.2数据表设计

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

表address (收货地址:)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

address_id

int

10

0

N

Y

收货地址:

2

name

varchar

32

0

Y

N

姓名:

3

phone

varchar

13

0

Y

N

手机:

4

postcode

varchar

8

0

Y

N

邮编:

5

address

varchar

255

0

N

N

地址:

6

user_id

mediumint

8

0

N

N

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

7

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

8

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

9

default

bit

1

0

N

N

0

默认判断

表article (文章:用于内容管理系统的文章)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

article_id

mediumint

8

0

N

Y

文章id:[0,8388607]

2

title

varchar

125

0

N

Y

标题:[0,125]用于文章和html的title标签中

3

type

varchar

64

0

N

N

0

文章分类:[0,1000]用来搜索指定类型的文章

4

hits

int

10

0

N

N

0

点击数:[0,1000000000]访问这篇文章的人次

5

praise_len

int

10

0

N

N

0

点赞数

6

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

7

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

8

source

varchar

255

0

Y

N

来源:[0,255]文章的出处

9

url

varchar

255

0

Y

N

来源地址:[0,255]用于跳转到发布该文章的网站

10

tag

varchar

255

0

Y

N

标签:[0,255]用于标注文章所属相关内容,多个标签用空格隔开

11

content

longtext

2147483647

0

Y

N

正文:文章的主体内容

12

img

varchar

255

0

Y

N

封面图

13

description

text

65535

0

Y

N

文章描述

表article_type (文章分类)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

type_id

smallint

5

0

N

Y

分类ID:[0,10000]

2

display

smallint

5

0

N

N

100

显示顺序:[0,1000]决定分类显示的先后顺序

3

name

varchar

16

0

N

N

分类名称:[2,16]

4

father_id

smallint

5

0

N

N

0

上级分类ID:[0,32767]

5

description

varchar

255

0

Y

N

描述:[0,255]描述该分类的作用

6

icon

text

65535

0

Y

N

分类图标:

7

url

varchar

255

0

Y

N

外链地址:[0,255]如果该分类是跳转到其他网站的情况下,就在该URL上设置

8

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

9

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

表auth (用户权限管理)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

auth_id

int

10

0

N

Y

授权ID:

2

user_group

varchar

64

0

Y

N

用户组:

3

mod_name

varchar

64

0

Y

N

模块名:

4

table_name

varchar

64

0

Y

N

表名:

5

page_title

varchar

255

0

Y

N

页面标题:

6

path

varchar

255

0

Y

N

路由路径:

7

position

varchar

32

0

Y

N

位置:

8

mode

varchar

32

0

N

N

_blank

跳转方式:

9

add

tinyint

3

0

N

N

1

是否可增加:

10

del

tinyint

3

0

N

N

1

是否可删除:

11

set

tinyint

3

0

N

N

1

是否可修改:

12

get

tinyint

3

0

N

N

1

是否可查看:

13

field_add

text

65535

0

Y

N

添加字段:

14

field_set

text

65535

0

Y

N

修改字段:

15

field_get

text

65535

0

Y

N

查询字段:

16

table_nav_name

varchar

500

0

Y

N

跨表导航名称:

17

table_nav

varchar

500

0

Y

N

跨表导航:

18

option

text

65535

0

Y

N

配置:

19

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

20

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

表cart (购物车)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

cart_id

int

10

0

N

Y

购物车ID:

2

title

varchar

64

0

Y

N

标题:

3

img

varchar

255

0

N

N

0

图片:

4

user_id

int

10

0

N

N

0

用户ID:

5

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

6

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

7

state

int

10

0

N

N

0

状态:使用中,已失效

8

price

double

9

2

N

N

0.00

单价:

9

price_ago

double

9

2

N

N

0.00

原价:

10

price_count

double

11

2

N

N

0.00

总价:

11

num

int

10

0

N

N

1

数量:

12

goods_id

mediumint

8

0

N

N

商品id:[0,8388607]

13

type

varchar

64

0

N

N

未分类

商品分类:

14

description

varchar

255

0

Y

N

描述:[0,255]用于产品规格描述

表collect (收藏)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

collect_id

int

10

0

N

Y

收藏ID:

2

user_id

int

10

0

N

N

0

收藏人ID:

3

source_table

varchar

255

0

Y

N

来源表:

4

source_field

varchar

255

0

Y

N

来源字段:

5

source_id

int

10

0

N

N

0

来源ID:

6

title

varchar

255

0

Y

N

标题:

7

img

varchar

255

0

Y

N

封面:

8

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

9

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

表comment (评论)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

comment_id

int

10

0

N

Y

评论ID:

2

user_id

int

10

0

N

N

0

评论人ID:

3

reply_to_id

int

10

0

N

N

0

回复评论ID:空为0

4

content

longtext

2147483647

0

Y

N

内容:

5

nickname

varchar

255

0

Y

N

昵称:

6

avatar

varchar

255

0

Y

N

头像地址:[0,255]

7

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

8

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

9

source_table

varchar

255

0

Y

N

来源表:

10

source_field

varchar

255

0

Y

N

来源字段:

11

source_id

int

10

0

N

N

0

来源ID:

表goods (商品信息)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

goods_id

mediumint

8

0

N

Y

产品id:[0,8388607]

2

title

varchar

125

0

Y

N

标题:[0,125]用于产品和html的<title>标签中

3

img

text

65535

0

Y

N

封面图:用于显示于产品列表页

4

description

varchar

255

0

Y

N

描述:[0,255]用于产品规格描述

5

price_ago

double

8

2

N

N

0.00

原价:[1]

6

price

double

8

2

N

N

0.00

卖价:[1]

7

sales

int

10

0

N

N

0

销量:[0,1000000000]

8

inventory

int

10

0

N

N

0

商品库存

9

type

varchar

64

0

N

N

商品分类:

10

hits

int

10

0

N

N

0

点击量:[0,1000000000]访问这篇产品的人次

11

content

longtext

2147483647

0

Y

N

正文:产品的主体内容

12

img_1

text

65535

0

Y

N

主图1:

13

img_2

text

65535

0

Y

N

主图2:

14

img_3

text

65535

0

Y

N

主图3:

15

img_4

text

65535

0

Y

N

主图4:

16

img_5

text

65535

0

Y

N

主图5:

17

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

18

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

19

customize_field

text

65535

0

Y

N

自定义字段

20

source_table

varchar

255

0

Y

N

来源表:

21

source_field

varchar

255

0

Y

N

来源字段:

22

source_id

int

10

0

N

N

0

来源ID:

23

user_id

int

10

0

Y

N

0

添加人

表goods_type (商品类型)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

type_id

int

10

0

N

Y

商品分类ID:

2

father_id

smallint

5

0

N

N

0

上级分类ID:[0,32767]

3

name

varchar

255

0

Y

N

商品名称:

4

desc

varchar

255

0

Y

N

描述:

5

icon

varchar

255

0

Y

N

图标:

6

source_table

varchar

255

0

Y

N

来源表:

7

source_field

varchar

255

0

Y

N

来源字段:

8

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

9

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

seller

int

10

0

Y

N

0

卖家

4

product_name

varchar

64

0

Y

N

产品名称

5

specifications

varchar

64

0

Y

N

规格

6

user_no

int

10

0

Y

N

0

用户编号

7

purchase_quantity

varchar

64

0

Y

N

购买数量

8

consignee_name

varchar

64

0

Y

N

收货人姓名

9

contact_number

varchar

64

0

Y

N

联系电话

10

ship_to_address

varchar

64

0

Y

N

收货地址

11

logistics_status

varchar

64

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

更新时间

表notice (公告)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

notice_id

mediumint

8

0

N

Y

公告id:

2

title

varchar

125

0

N

N

标题:

3

content

longtext

2147483647

0

Y

N

正文:

4

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

5

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

表order (订单)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

order_id

int

10

0

N

Y

订单ID:

2

order_number

varchar

64

0

Y

N

订单号:

3

goods_id

mediumint

8

0

N

N

商品id:[0,8388607]

4

title

varchar

32

0

Y

N

商品标题:

5

img

varchar

255

0

Y

N

商品图片:

6

price

double

10

2

N

N

0.00

价格:

7

price_ago

double

10

2

N

N

0.00

原价:

8

num

int

10

0

N

N

1

数量:

9

price_count

double

8

2

N

N

0.00

总价:

10

norms

varchar

255

0

Y

N

规格:

11

type

varchar

64

0

N

N

未分类

商品分类:

12

contact_name

varchar

32

0

Y

N

联系人姓名:

13

contact_email

varchar

125

0

Y

N

联系人邮箱:

14

contact_phone

varchar

11

0

Y

N

联系人手机:

15

contact_address

varchar

255

0

Y

N

收件地址:

16

postal_code

varchar

9

0

Y

N

邮政编码:

17

user_id

int

10

0

N

N

0

买家ID:

18

merchant_id

mediumint

8

0

N

N

0

商家ID:

19

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

20

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

21

description

varchar

255

0

Y

N

描述:[0,255]用于产品规格描述

22

state

varchar

16

0

N

N

待付款

订单状态:待付款,待发货,待签收,已签收,待退款,已退款,已拒绝,已完成

表order_evaluation (订单评价)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

order_evaluation_id

int

10

0

N

Y

订单评价ID

2

order_number

varchar

64

0

Y

N

订单号

3

seller

int

10

0

Y

N

0

卖家

4

product_name

varchar

64

0

Y

N

产品名称

5

specifications

varchar

64

0

Y

N

规格

6

user_no

int

10

0

Y

N

0

用户编号

7

purchase_quantity

varchar

64

0

Y

N

购买数量

8

evaluation_score

varchar

64

0

Y

N

评价分数

9

evaluation_content

text

65535

0

Y

N

评价内容

10

recommend

int

10

0

N

N

0

智能推荐

11

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

12

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表praise (点赞)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

praise_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:

8

status

bit

1

0

N

N

1

点赞状态:1为点赞,0已取消

表product_information (产品信息)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

product_information_id

int

10

0

N

Y

产品信息ID

2

seller

int

10

0

Y

N

0

卖家

3

product_name

varchar

64

0

Y

N

产品名称

4

specifications

varchar

64

0

Y

N

规格

5

place_of_origin

varchar

64

0

Y

N

产地

6

recommend

int

10

0

N

N

0

智能推荐

7

cart_title

varchar

125

0

Y

N

标题:[0,125]用于产品html的标签中

8

cart_img

text

65535

0

Y

N

封面图:用于显示于产品列表页

9

cart_description

varchar

255

0

Y

N

描述:[0,255]用于产品规格描述

10

cart_price_ago

double

8

2

N

N

0.00

原价:[1]

11

cart_price

double

8

2

N

N

0.00

卖价:[1]

12

cart_inventory

int

10

0

N

N

0

商品库存

13

cart_type

varchar

64

0

N

N

未分类

商品分类:

14

cart_content

longtext

2147483647

0

Y

N

正文:产品的主体内容

15

cart_img_1

text

65535

0

Y

N

主图1:

16

cart_img_2

text

65535

0

Y

N

主图2:

17

cart_img_3

text

65535

0

Y

N

主图3:

18

cart_img_4

text

65535

0

Y

N

主图4:

19

cart_img_5

text

65535

0

Y

N

主图5:

20

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

创建时间

21

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间

表registered_users (注册用户)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

registered_users_id

int

10

0

N

Y

注册用户ID

2

user_no

varchar

64

0

N

N

用户编号

3

full_name

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

更新时间

表seller (卖家)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

seller_id

int

10

0

N

Y

卖家ID

2

seller_no

varchar

64

0

N

N

卖家编号

3

seller_name

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

更新时间

表slides (轮播图)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

slides_id

int

10

0

N

Y

轮播图ID:

2

title

varchar

64

0

Y

N

标题:

3

content

varchar

255

0

Y

N

内容:

4

url

varchar

255

0

Y

N

链接:

5

img

varchar

255

0

Y

N

轮播图:

6

hits

int

10

0

N

N

0

点击量:

7

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

创建时间:

8

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

更新时间:

表supervise_users (监管用户)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

supervise_users_id

int

10

0

N

Y

监管用户ID

2

supervision_job_number

varchar

64

0

N

N

监管工号

3

name_of_supervisor

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

更新时间

表traceability_case (溯源案例)

编号

名称

数据类型

长度

小数位

允许空值

主键

默认值

说明

1

traceability_case_id

int

10

0

N

Y

溯源案例ID

2

case_name

varchar

64

0

Y

N

案例名称

3

product_name

varchar

64

0

Y

N

产品名称

4

production_company

varchar

64

0

Y

N

生产公司

5

production_address

varchar

64

0

Y

N

生产地址

6

time_to_market

date

10

0

Y

N

上市时间

7

product_indicators

text

65535

0

Y

N

产品指标

8

fertilizer_records

text

65535

0

Y

N

肥料记录

9

pesticide_records

text

65535

0

Y

N

农药记录

10

environmental_data

text

65535

0

Y

N

环境数据

11

pesticide_test_report

varchar

255

0

Y

N

农药检测报告

12

case_details

text

65535

0

Y

N

案例详情

13

hits

int

10

0

N

N

0

点击数

14

praise_len

int

10

0

N

N

0

点赞数

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

更新时间

  1.  系统详细设计

5.1登录模块

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

登录界面如下所示。

图5-1登录界面

5.2注册模块

客户在第一次进行注册时,需要填写自己的名字和密码,填写完成后,提交表单,该表单将自动验证你的信息,如果文件格式不正确,则会在窗口提醒你不正确,如果文件格式正确,窗口将会弹出注册成功。

用户注册界面如下所示:

图5-2用户注册界面

5.3产品信息模块

系统为用户提供简洁的产品信息视图,卖家可以自由发布,可以以列表的形式排列产品信息,也可以以网格状的形式显示产品信息,方便用户找到自己需要的产品信息。在chanpinxinxilist.jsp实现产品信息列表的展示,用户点击某个产品信息,通过产品信息id传递值,找到数据表的该产品的信息。

如下图所示为产品信息界面。

图5-3产品信息界面

5.4购买产品模块

用户在浏览产品后,登录系统前台,进行产品购买,可将产品先添加至购物车,然后在购物车里结算,在个人后台可以查看购买车里面的产品,确定产品之后可以生成订单,然后支付。

如下图所示为购买产品的部分界面。

图5-4购买产品界面

5.5用户管理模块

用户注册后在数据库生成一条用户户数据,并显示在用户户管理列表中,管理员可对用户数据增删改查,禁用用户账号,让用户无法登录系统。

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

图5-5用户管理界面

5.6产品类别模块

用户在系统前台浏览产品类别,管理员登录系统后,可以对添加、删除、修改产品类别,产品类别管理包括添加产品类别、查询产品类别、修改产品类别,系统前台的产品类别信息时随系统后台变化而变化的,同时能进行详细产品类别的打印和产品类别列表,管理员还可以通过标题等关键字进行产品类别信息的搜索。

产品类别的界面如下图所示。

图5-6产品类别界面

5.7溯源案例管理模块

管理人员可以对溯源案例进行增删查改的操作,这些操作将在溯源案例界面进行。

如下图所示为溯源案例管理界面。

图5-7溯源案例管理界面

5.8订单管理模块

首先登录系统,进行订单表浏览,管理员登录后台进行用户订单信息维护管理,包括订单中的产品名称,产品种类,订单号,购买数量,价格,支付状态等。

如下图为订单管理界面。

图5-8订单管理界面

  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

59

上架

产品B

B

18

上架

产品C

C

20

上架

添加时应注意事项:

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

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

表6-6添加产品信息测试用例

输入

输出

产品信息名

产品信息价格

产品信息图片

A123

参数错误

产品信息A

123

Coid.doc

参数错误

产品信息A

59

请选择上传图片

产品信息A

59

a.jpg

添加成功

5.订单生成测试 

名称:订单生成测试        目的:测试提交订单界面

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

下表描述了订单生成的测试用例,防止订单生成错误,造成企业和客户的损失。

表6-8订单生成测试用例

输入

输出

订单编号

联系人

地址

电话

11

张三

上海市静安区11号

212312323

订单生成成功

22

张三

123423423

请填写收货地址

33

张三

上海市静安区11号

请填写联系电话

44

上海市静安区11号

123423423

请填写联系人姓名

  1.  结论

经过这几个月的设计和开发,“基于Django的兴农购物网站系统”已经完成了,其功能符合设计需求,能够完成用户的注册、用户的在线购买、购物车管理、物流信息管理和管理员的产品信息管理、订单管理、溯源案例、用户管理、评价信息维护等功能。经过最后的使用,证明系统完全具有可行性与可扩充性。

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

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

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

参考文献

  1. 鞠红凤,张瑛,黄琳倩,付慧敏,胡湘.一站式助农电商服务平台的设计[J].电子世界,2022(01):198-199+203.
  2. 马富春. 甘肃青春助农 唱响“甘味”之歌[N]. 中国青年报,2021-12-24(001).
  3. 孟静.基于平台经济视角下直播助农模式探讨[J].黑龙江工业学院学报(综合版),2021,21(11):91-96.
  4. 郭沛,张成鹏,李梦琪.电商助农:运作实践、增收机理、创新绩效和优化路径[J].中共云南省委党校学报,2021,22(05):151-160+2.
  5. Shuhua CAO,Yujun HU,Peijun FU.Present Situation and Problems of Application of New Media in Rural E-commerce: A Case Study of Anhui Province[J].Asian Agricultural Research,2021,13(10):12-17.
  6. 孙晟妤,马悦鸣,党浩轩,黄佳瑶,张丰钰.利用新媒体平台对辽扶贫助农的新路径研究[J].营销界,2021(38):126-128.
  7. 徐涛,陶佳,曾聪,唐江兰.乡村振兴视域下“互联网+”农业互助平台的开发与应用[J].南方农业,2021,15(24):144-145.
  8. 朱悦彤,于雅洁,朱硕闻,马思怡,李佳怡.基于新媒体的助农方法研究[J].营销界,2021(20):32-33.
  9. 孙丹丽,郭月朦.基于“互联网+”的乡村产品品牌价值探索[J].包装工程,2021,42(08):234-240.
  10. 谢倩.电商助农政策有关问题研究[J].农村经济与科技,2021,32(03):143-144.

[11]  焦瑾,陈梦梦,董思颖,侯冰洁,王梦茹.助农专家科技平台的设计和应用[J].南方农机,2020,51(22):74-75.

[12]  戴月,陈俊雅,纪倩倩,周稿,石官平.基于移动社交电商的农产品上行探究[J].湖北开放职业学院学报,2020,33(13):124-126.

[13]  电商平台、网络直播、微信发挥大作用重庆21万志愿者利用农业信息工具助农[J].农业工程技术,2020,40(09):68-69.

[14]  William J.DAVIES,Susan E.WARD,Alan WILSON.Can crop science really help us to produce more betterquality food while reducing the world-wide environmental footprint of agriculture?[J].Frontiers of Agricultural Science and Engineering,2020,7(01):28-44.

[15]  阚丽丽.电商平台“花式”助农 机遇与挑战并存[J].新产经,2020(03):65-67.

[16]  肖佳敏,徐凯丽,张如意,杨明凯,叶丽莎,朱立飞.电商网络平台助力农村经济发展办法研究——基于“绿屏菜园”的平台研究以浙江丽水为例[J].现代营销(信息版),2019(08):239.

[17]  琚书存,程文杰,徐建鹏,王晖,伍琼.打造三大服务平台 做好气象助农扶贫工作[J].中国农村科技,2018(08):25-28.

致 谢

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

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

请关注点赞+私信博主,免费领取项目源码
 

Guess you like

Origin blog.csdn.net/ID3461074420/article/details/134638691
Recommended