Springboot is based on JAVA game peripheral mall design and realization of graduation project - with source code 261622

Development of Springboot game peripheral mall

                                                                           Summary

Nowadays, people's lifestyles are gradually enriched. Computers and networks have been integrated into people's lives, affecting our daily lives all the time. Online games have entered the lives of most people. In the game world, people will get a lot of game products. However, these products are just like real-life items. The trend of the times, and will have its distinctive and essential status.

This paper mainly analyzes the functional requirements of the platform's foreground and background management, and analyzes the non-functional requirements of the system's security and scalability. On the basis of detailed demand analysis, the database structure is determined according to the functional design of the system, and complete code writing is realized. The game peripheral mall has completed the page design and function realization of the main modules of the system. This article shows the implementation effect diagram of the home page, and introduces the implementation process of the user registration function, mall information, mall center, commodity purchase, and online payment functions through codes and pages.

Keywords: e-commerce; Springboot framework; game peripheral mall

Development of shopping malls around springboot games

Abstract

Nowadays, people's lifestyles are gradually enriched. Computers and networks have been integrated into people's lives, affecting our daily life all the time. Online games have entered most people's lives. In the game world, people will get a lot of game commodities. However, these commodities are just like those in real life. Some commodities will be often used to make players feel energetic and outstanding in the game; The emergence of shopping malls around the game has become the trend of the times, and will have its unique and essential position.

This paper mainly analyzes the functional requirements of the foreground and background management of the platform, and analyzes the non functional requirements of the security and scalability of the system. Based on the detailed demand analysis, the database structure is determined according to the functional design of the system to realize the complete coding. The mall around the game has completed the page design and function realization of the main modules of the system. This paper shows the implementation effect of the home page, and introduces the implementation process of user registration function, mall information, mall center, commodity purchase and online payment function through code and page.

Key words:Electronic Commerce; Springboot framework; Shopping mall around the game

Table of contents

1. Introduction

(1) Research background and significance

(2) Development Status

2. Introduction of development tools and related technologies

(1)  Java development language

(2) Springboot framework 

( 3 )  Mysql database

( 4 ) B/S structure 

( 5 )  Working principle of B/S system

( 6 )  MVVM pattern

3. System analysis

(1) Feasibility analysis

1.  Economic feasibility

2.  Technical feasibility

3.  Operation feasibility

(2) Functional requirements analysis

(3) Non-functional requirements analysis

(4) Business process analysis

4. System design

(1) Functional structure design

( 2 ) Functional design

(2) Database design

5. System Implementation

(1) Realization of user login

(2) Realization of the main functions of the front desk of the system

1.  Realization of the homepage

2.  Realization of user registration

3. Realization of mall display 

4. Realization of mall information 

5. Realization of product purchase 

(3) Realization of the main functions of the system background

1. Realization of user management 

2. Realization of mall information management 

3.  Realization of order management

6. System test

(1) System reliability test

(2) System functional test

(3) System qualification test

(4) Test results

7. Summary and Outlook

references

thank you

Game Peripheral Mall

  • introduction
  • research background and meaning

In the 21st century, the world is networked and technology is advancing by leaps and bounds. Our lives have also undergone tremendous changes. With the pervasiveness of computers, every area of ​​our social and economic life is changing. The depth and breadth of people's information exchange is constantly increasing, which makes the traditional industry model follow the pace of the times and provide users with more convenient and personalized services. E-commerce has been greatly popularized and developed here.

Today, with the rapid development of information technology, there are endless opportunities, but at the same time, in the current environment, the online transaction mode of game products relying on human hands is basically unable to meet the requirements of enterprise operation and management. , That is to say, the traditional game commodity trading model is not only unable to meet the development of enterprises, but also unable to meet the basic requirements of current life and social development trends. In the early days when the Internet was not as developed and popular as it is today, the transactions of game commodities were completely dependent on manual operations. However, in the information age, the pace of life is accelerating, and the changes in society are breathtaking. Traditional game commodity transactions The system has completely failed to keep up with the pace, and will be eliminated by the times sooner or later. Need to go through a lot of procedures, and the whole process must be manually operated. The efficiency of traditional game product transaction information management is too low, and it is simply not enough for enterprises to count and process the huge amount of game product transaction information. At the same time, the relationship generated during the transaction process is extremely complex, and each unit processes information in different ways, which is very prone to omission or duplication of information.

Therefore, a new, information-based technology platform must emerge to improve the current chaotic situation. The game peripheral mall was born under such a big environment. The ideal solution is to formally create a game merchandise store. This innovation is of great significance. On the one hand, it can not only get rid of the traditional inefficient working methods, but on the other hand, it can ensure the efficient operation of the business chain. Another advantage of establishing an information management system is that it can greatly promote enterprise management innovation, technological innovation, system innovation and cultural innovation.

  • Development Status

In the global scope, the research on game commodity trading platforms in the United States is relatively early, and it is relatively advanced. In 2009, the game commodity trading in the United States has published "Theoretical Explanation of Basic Game Commodity Trading Information", which mentioned the following indicators to evaluate game commodity trading information: relevance, verifiability, detachment, and quantification . Since then, for the first time in the world, there has been a quality standard for game product transaction information. ―Not only took the first step in game commodity trading, but also had a huge and far-reaching impact on the creation and research of game commodity trading platforms in the future. Now many enterprises in our country have achieved information management through the establishment of internal LAN systems and external Internet connections, and also have complete hardware facilities. However, there are still many deficiencies in our country, especially in software. In terms of software, the most unsatisfactory thing is that the information system of the game commodity trading platform that our country can develop at present has not been in line with international standards, and the functions are not powerful and perfect enough, which ultimately makes international friends not buy it. , causing great difficulties to the promotion and popularization of the system.

Our country is facing a very difficult problem, that is how to respond to and adapt to the requirements of international development. In recent years, the information industry has developed rapidly, and the manual management method cannot keep up with the pace of the times, especially in the application of online game commodity transaction information management, because it includes a huge amount of transaction processing. Only by using IT technology can we Fully improve service quality and improve management level. We not only have to face domestic competition, but also face various challenges from abroad, keep up with the international pace, and integrate with the international standards at the fastest speed.

  • Introduction to development tools and related technologies
  • Java development language

Java is an object-oriented programming language. A class is the basic unit of a Java program. A class contains attributes and methods, and countless objects can be created in a class. The main members contained in the class are fields and methods. A field refers to a data variable, and a method refers to a collection of operations on fields, including assigning values ​​to other variables, calling methods, etc. [1].

  • 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. The Spring framework has an aspect-oriented programming (AOP) framework. The Spring AOP framework is based on the proxy mode and is configurable at runtime. The AOP framework is mainly modularized for 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.

  • Mysql database

The logical structure of Mysql database includes tablespace, segment, extend, datablock, and schemaobject [9]. Each database can be logically divided into one or more table spaces, and each table space is composed of one or more data files. Mysql database is divided into system table space and non-system table space, each Mysql database contains a system table space called SYSTEM.           

The language of Mysql is unstructured, and users can work on the data. MySQL gets a lot of attention for its speed, reliability, and adaptability. Most people agree that MySQL is the best choice for managing content when transactional processing is not required. And because the language and structure of Mysql are relatively simple, but the function and the amount of stored information are very powerful, it has been widely used.

The role of Mysql database in the programming process is very extensive, which brings convenience for users to query data. Because of its flexibility and powerful functions, the application of Mysql database only needs a small piece of code to realize a certain function, unlike other programs that need to write a large piece of code. Generally speaking, the language of Mysql database is relatively concise.

Data flow analysis is mainly a storage room for data storage, which is performed on a computer, not a storage room in reality. Data is stored in a fixed format rather than in disorder. Its definition is: it has a fixed format for a long time and can be shared and stored on the computer memory. Database management is mainly data storage, modification and addition, and the establishment of data tables. In order to ensure the normal operation of the system data, some capable processors can manage it without the need for professional people to handle it. The establishment of the data table can adjust the data in the data table, recombine and reconstruct the data to ensure the security of the data. Due to the powerful features of the database, the development of this system mainly uses Mysql to manage the data.

  • B/S structure

B/S (Browser/Server) is a more convenient architecture than its predecessor architecture. It uses the Web server to complete the data transfer and exchange. You only need to download the browser as the client, then the work will achieve a "slimming" effect, and there is no need to consider the problem of non-stop installation of software.           

  • Working principle of B/S system

The B/S architecture adopts the working mode of browser request and server response.

Users can access information such as text, data, pictures, animation, video on demand and sound generated by the web server on the Internet through a browser;

And each web server can be connected with the database server in various ways, and a large amount of data is actually stored in the database server;

Download the program from the Web server to execute locally. If an instruction related to the database is encountered during the download process, the Web server will hand it over to the database server for interpretation and execution, and return it to the Web server, and the Web server will return it to the user. In this structure, many networks are connected together to form a huge network, that is, the global network. Each enterprise can build its own Internet on the basis of this structure.

In the B/S mode, the user requests access to many servers distributed on the network through the browser. The browser's request is processed by the server, and the processing result and corresponding information are returned to the browser. Other data Processing and requests are all completed by the Web Server. Through the frame structure and the browser embedded in the operating system, this structure has become the mainstream structure mode of today's software applications.

   (6) MVVM pattern

The MVVM model is a commonly used development model, which is mainly divided into M layer, V layer and C layer in terms of code implementation.

View (View) represents the user interaction interface. A web application may have many interfaces. In the MVVM mode, the view only deals with data collection, processing, and user requests, and does not include the processing of business processes and business processes. Handled by the Model.

Model (Model) is the processing of business processes/states and the formulation of business rules. The process of the model processing the business process cannot be seen by other layers. It is like a black box. After receiving the data requested by the view, it returns the final processing result. The main core of MVVM is the design of the business model. A typical application example is the popular EJB model. It further divides the model from the perspective of application technology implementation in order to make full use of existing components, but it cannot be used as a A framework for applying design models.

The controller (Controller) can be understood as receiving the user's request, and then the view and the model are matched together to complete the user's request together. It has a very obvious role in dividing the control layer, and can clearly tell you that it is a distributor, which model and view to choose, and what kind of request from the user can be completed. The control layer does not do all the data processing, for example: the user clicks a connection, after the control layer receives the request, it does not process the business information, it just transmits the user's information to the model, and tells the model what to do, and then chooses the one that meets the requirements The view is returned to the user.

           

     

  • system analysis

The feasibility analysis of this system will be carried out from the perspectives of economy, technology and operation.

  1. economic feasibility

The entire system has rigorous steps from design to development and testing. All work tasks are completed by myself without external technical support, which saves all service costs and labor costs. In terms of hardware, a second-hand mobile phone is used to save costs. The workstation is used as the project deployment server and database server, and the cost is less than 10,000 yuan. The actual network deployment is also completed by myself without other labor costs involved. The entire development process is based on the principle of low cost and low consumption.

  1. technical feasibility

The purpose of the technical feasibility analysis is to confirm whether the system can be implemented using existing technologies, and to evaluate the development efficiency and completion. Technical feasibility refers to whether the development of computer software and hardware can meet the requirements of development under the current technical conditions. Because the development of the system is based on the Java language, the software and hardware conditions required for the development of the system can be met on an ordinary computer. Because it takes up relatively little memory, there is theoretically no problem in developing and designing software with the Mysql database because it takes up too little memory. The above techniques can effectively guarantee the successful and efficient development of the system.

  1. operational feasibility

The user interface of the game peripheral mall is simple and easy to operate. Common interface windows are used to log in to the interface, and access operations are performed through computers. Users can access operations as long as they have used computers. The development of this system is developed with Java technology. Humanization and perfection are the more prominent features of B/S structure development, which makes user operations more concise and convenient than others. Easy to operate, easy to manage, and good interactivity are fully reflected in the operation of this system.

  • Functional Requirements Analysis

Front desk requirements:

(1) User module: mainly includes user registration and login, user personal information management and other functions.

(2) Commodity management module: mainly includes functions such as commodity information browsing, commodity information display, commodity search, and commodity purchase.

(3) Purchase order module: mainly includes the functions of adding purchase order, viewing my purchase order and deleting purchase order.

(4) Order module: mainly includes functions such as generating orders, my orders, viewing order details, and online payment.

(5) Mall center module: mainly includes mall store display, store product display, etc.

(6) Mall information module: mainly displaying mall information.

Background requirements:

(1) User management: mainly includes user list, user level management and other functions.

(2) Product management: mainly includes functions such as product list, product category management, product addition, and product information management.

(3) Mall information management: mainly including the release of mall information and other functions.

(4) Category list management: mainly includes commodity category management.

(5) Order management: review the user's purchase order information.

The user use case diagram is shown below.

 

Figure 1 User use case diagram

The administrator use case diagram is shown below.

 

Figure 2 Administrator use case diagram

The description of the product addition use case is shown in the table below.

Table 1 Product Add Use Case Description

use case name

add new item

participant

administrator

Use case overview

This use case is used by administrators to add new products

Preconditions

The administrator must log in to the system before adding new products

postcondition

Add a new item to the system

basic event flow

participant action

system response

  1. The administrator selects "New Product" on the background main interface.

4. The administrator fills in the new product information and clicks the "Add" button.

2. The system opens the interface for adding new products.

3. The system checks that the product information entered by the administrator is correct and valid.

5. The system adds the product to the database.

6. The system prompts "Operation succeeded".

7. The system jumps to the commodity management interface.

other event stream

1. If the system verifies that the product name entered by the administrator is empty, it will prompt "*Please fill in the product name!".

2. The system verifies that the price entered by the administrator is not in digital format, and prompts "*The price must be in digital format!"

Item deletion use case descriptions are shown in the table below.

Table 2 Product deletion use case description

use case name

delete item

participant

administrator

Use case overview

This use case is used for administrators to delete products

Preconditions

Administrators must log in to the system before deleting items

postcondition

Delete an item from the system

basic event flow

participant action

system response

1. The administrator selects "Commodity Management" on the background main interface.

4. The administrator selects a product and clicks the "Delete" button.

6. The administrator clicks the "OK" button.

2. The system obtains the product information list from the database

3. The system opens the commodity list interface.

5. The system prompts "Are you sure you want to delete?".

7. The system deletes the commodity from the database.

8. The system prompts "Delete successfully".

9. The system jumps to the commodity management interface.

other event stream

none

The user editing use cases are described in the table below.

Table 3 User Edit Use Case Description

use case name

modify user

participant

administrator

Use case overview

本用例用于管理员进行修改用户信息操作

前置条件

管理员已经登录系统

后置条件

系统中更新一条用户记录

基本事件流

参与者动作

系统响应

1、管理员在后台主界面选择“用户管理”。

4、管理员在用户列表中选择一个用户,点击“编辑”按钮。

6、管理员填写用户信息,点击“保存修改”按钮。

2、系统从数据库中获取用户信息。

3、系统打开用户列表界面。

5、系统打开修改用户信息界面。

7、系统将更改后的添加到数据库中。

8、系统提示“操作成功”。

9、系统跳转到用户管理界面。

其他事件流

商品购买用例描述如下表所示。

表4商品购买用例描述

用例名称

商品购买

参与者

用户

用例概述

本用例用于用户进行对商品购买操作

前置条件

用户已经登录系统

后置条件

系统中增加一条用户购买记录

基本事件流

参与者动作

系统响应

1、用户在前台首页选择任意一个商品分类。

4、管理员在用户列表中选择一个商品。

7、用户填写购买订单,点击“购买”按钮。

2、系统从数据库中获取商品列表信息。

3、系统打开商品列表界面。

5、系统从数据库中获取商品信息。

6、系统打开商品信息及购买界面。

8、系统检查用户输入的信息是正确有效的。

9、系统将购买记录添加到数据库中。

其他事件流

1、系统验证用户输入的字段为空,则提示“*购买数量不能为空!”。

  • 非功能性需求分析 

随着用户量的增加,系统可能会需要同时服务上千、上万个页面,服务器需要同时响应大量用户的操作,这就要求系统需要有良好的可扩展性,否则系统会出现延迟,卡顿甚至服务器崩溃的问题。高扩展性可以使软件保持旺盛的生命力,同时也能够使系统更好的适应用户增加、提高性能需求、增加应用功能等改变。

系统中保存了大量用户和管理员的个人信息,因此,保证系统服务器和数据安全是在开发过程中需要考虑的重要问题。安全性包括服务器安全、操作系统安全、数据库安全、程序代码安全以及用户个人信息和支付安全等,系统可以通过采用防火墙技术、加密技术、认证技术等来增强其安全性,只有一个健壮安全的系统才能具有长久的生命力。

  • 业务流程分析

游戏周边商城的前台中,用户模块和商品模块进行数据交互,实现购买的功能。前台的功能主要包括用户模块、公告消息模块、商城资讯模块、购买模块和个人订单模块。

游戏周边商城的后台中,管理员对用户在前台提交申请产生的数据进行处理,以满足用户的需求。前台系统和后台系统有数据交互,整个系统各个部分相互独立又密不可分。后台的功能主要包括用户管理、商城管理、商城资讯管理、分类管理、商品信息管理、订单管理。

  • 系统设计

(一)功能结构设计

本系统的设计是基于Java技术+Mysql数据库+Tomcat服务器的方式设计,以Myeclipse10为开发工具,并运用Photoshop CS6技术美化网页,辅之以CSS技术。本系统使用的角色主要有系统管理员和普通用户,系统分为前台和后台,前台主要用于商城展示和商品的购买,后台用于商城、资讯、订单、商品信息的管理,首先以普通用户通过账号注册后登录系统前台,可以进行各种信息浏览和搜索,用户可以将需要的商品进行下单购买,用户可以查询订单是否已经被管理员确认,订单生成后表示用户购买成功,用户同时可以修改个人的信息资料,查看订单信息;以管理员的身份登录系统后台可以进行商品维护、订单管理等。

系统功能结构图如下所示。

 

图4-1系统功能结构图

(二)功能设计

1.用户登录模块:确保用户注册信息的真实度是提高系统效率和盈利的重要因素。真实的用户才能带来价值,注册是保证真实用户使用系统主要业务的第一步,通过对用户注册信息的审核,可防止机器注册。使用现如今较为流行的管理员进行账号激活的验证方式,对用户注册信息进行过滤,未激活用户信息将不能使用系统主要功能。

如下图所示为用户登录流程图。

 

                                                   图4-2用户登录流程图

2.商城资讯浏览模块:没有登录的用户和登录的用户都可以在系统前台进行商城资讯浏览,用户可以查看商城资讯的详细信息,用户还可以通过商城资讯名称的关键字进行搜索。

如下图所示为商城资讯浏览流程图。

 

                                                   图4-3商城资讯浏览流程图

3.订单管理模块:用户购买商品后,填写收货地址、收货人、电话等信息,生成订单信息,管理员可以审核订单,删除、修改订单,对订单信息进行相应的物流信息。 

如下图所示为订单管理流程图。

 

                                                       图4-4订单管理流程图

4.商城资讯管理模块

系统管理员可以对商城资讯信息进行增、删、改、查的操作。

5.用户管理模块

系统管理员可以对用户信息进行增、删、改、查的操作。

6.订单模块

用户对个人添加至购买订单里面的商品进行增删改查等操作。

(三)数据库设计

3.1概念设计

本系统的E-R图表现了系统中各个实体之间的联系,经过分析,系统的实体有商城活动、优惠券领取、订单中心、充值中心、物流信息等。

订单信息的实体图如下图所示。

 

图4-6订单信息实体图

用户信息实体图如下图所示。

 

图4-7用户信息实体图

商品信息的实体图如下图所示。

 

图4-8商品信息实体图

订单E-R图如下图所示。

              

 

                                                      图4-9订单E-R图

3.2逻辑设计

Allusers表是系统用户的信息表,存储系统用户真实姓名、性别、年龄、电话、地址、备注、编号、姓名、用户密码以及其相对应的密码等相关信息。

Dingdan表是订单信息表,存储用户的订单的相关信息,其中包括订单号、金额、订单内容、用户名、姓名、邮件地址、邮编、手机、添加时间、是否审核等相关信息。

yonghuzhuce表是用户注册信息表,存储用户的注册信息,其中包括编号、用户名、密码、姓名、性别、出生年月、QQ、邮箱、电话、身份证、头像、地址、备至、折扣等相关信息。

shangpinxinxi表是商品信息表,存储商品内容的信息,其中包括标题、类别、价格、库存、图片、描述、添加时间等相关信息。

3.3表设计

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

名称

类型

长度

不是null

主键

注释

goods_id

mediumint

8

产品id

title

varchar

125

标题

img

text

0

封面图

description

varchar

255

描述

price_ago

double

8

原价:[1]

price

double

8

卖价:[1]

customize_field

text

0

自定义字段

sales

int

10

销量

inventory

int

11

商品库存

type

varchar

64

商品分类:

hits

int

10

点击量

content

longtext

0

正文

create_time

timestamp

0

创建时间:

update_time

timestamp

0

更新时间:

img_1

text

0

主图1:

img_2

text

0

主图2:

img_3

text

0

主图3:

img_4

text

0

主图4:

img_5

text

0

主图5:

source_table

varchar

255

来源表:

source_field

varchar

255

来源字段:

source_id

int

10

来源ID:

user_id

int

11

添加人

名称

类型

长度

不是null

主键

注释

commodity_management_id

int

11

商品管理ID

remarks

varchar

64

备注

recommend

int

11

智能推荐

cart_title

varchar

125

标题

cart_img

text

0

封面图

cart_description

varchar

255

描述

cart_price_ago

double

8

原价

cart_price

double

8

卖价

cart_inventory

int

11

商品库存

cart_type

varchar

64

商品分类:

cart_content

longtext

0

正文

cart_img_1

text

0

主图1:

cart_img_2

text

0

主图2:

cart_img_3

text

0

主图3:

cart_img_4

text

0

主图4:

cart_img_5

text

0

主图5:

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

名称

类型

长度

不是null

主键

注释

type_id

int

11

商品分类ID:

father_id

smallint

5

上级分类ID

name

varchar

255

商品名称:

desc

varchar

255

描述:

icon

varchar

255

图标:

source_table

varchar

255

来源表:

source_field

varchar

255

来源字段:

create_time

timestamp

0

创建时间:

update_time

timestamp

0

更新时间:

名称

类型

长度

不是null

主键

注释

address_id

int

11

收货地址:

name

varchar

32

姓名:

phone

varchar

13

手机:

postcode

varchar

8

邮编:

address

varchar

255

地址:

user_id

mediumint

8

用户ID

create_time

timestamp

0

创建时间:

update_time

timestamp

0

更新时间:

default

tinyint

1

默认判断

名称

类型

长度

不是null

主键

注释

order_id

int

11

订单ID:

order_number

varchar

64

订单号:

goods_id

mediumint

8

商品id

title

varchar

32

商品标题:

img

varchar

255

商品图片:

price

double

10

价格:

price_ago

double

10

原价:

num

int

8

数量:

price_count

double

8

总价:

norms

varchar

255

规格:

type

varchar

64

商品分类:

contact_name

varchar

32

联系人姓名:

contact_email

varchar

125

联系人邮箱:

contact_phone

varchar

11

联系人手机:

contact_address

varchar

255

收件地址:

postal_code

varchar

9

邮政编码:

user_id

int

10

买家ID:

merchant_id

mediumint

8

商家ID:

create_time

timestamp

0

创建时间:

update_time

timestamp

0

更新时间:

description

varchar

255

描述

state

varchar

16

订单状态

  • 系统实现
  • 用户登录的实现

用户注册完成后,点击“登陆”进入到登陆页面,输入用户名和密码,点击“登陆”按钮,对用户名和密码进行验证,根据传入的用户名和密码在数据库中是否能查询到一条用户信息,若不能返回用户信息则登陆失败,页面提示用户名或密码错误。

登陆拦截管理器,在config文件夹下的WebAppConfig.java文件,代码如下:

@Configuration

@Slf4j

public class WebAppConfig implements WebMvcConfigurer {

    @Override

    public void addInterceptors(InterceptorRegistry registry) {

        //登录拦截的管理器

        InterceptorRegistration registration = registry.addInterceptor(loginInterceptor());

        //拦截的地址

        registration.addPathPatterns("/**");

        //方行的地址

//registration.excludePathPatterns("/**");

        //根据需要拦截,一般设置所有地址拦截,放行公共连接

    }

    @Bean

    public LoginInterceptor loginInterceptor(){

        return new LoginInterceptor();

    }

}

登录界面如下图所示。

 

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

  • 系统前台主要功能实现 
  1. 首页的实现

用户界面要尽量简洁大方,使用户能够方便找到需要的功能入口,浏览、购买商品,且要易于修改和维护,同时还要保证用户合法和系统安全。

首页界面如下图所示。

 

图5-2首页界面

  1. 用户注册的实现

用户进入系统首页后,点击“注册”链接进入到注册页面,按照页面提示输入用户名、密码和商品号,页面进行表单验证,验证输入的用户名和商品号是否合法,表单验证通过后,点击“立即注册”按钮,利用 Ajax 技术,对用户名和商品号实现页面无刷新验证,检测数据库中是否已经存在该用户名,若数据库中不存在,则注册成功,注册成功后,自动跳转到登录页面。

用户注册界面如下所示。

 

图5-3用户注册界面

  1. 商城展示的实现

商城展示页面,如下图所示。

 

图5-4商城展示页面

商城展示的关键代码如下。

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

}

  1. 商城资讯的实现

系统首页提供了商城资讯信息,用户点击浏览,系统传递到后台。首先创建一个实体类 PageBean,该实体类的属性包括页码 pageCode、每页记录数 pageSize、总记录数 totalRecord 和一个 List 集合 beanList,用循环将资讯分页展示。

商城资讯界面如下图所示。

 

图5-5商城资讯界面

商城资讯的关键代码如下。

 @RequestMapping(value = {"/count_group", "/count"})

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

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

        return success(count.getResultList());

}

  1. 商品购买实现

用户在浏览商品时,对于心仪的想要购买的商品,可以将该商品添加到购买订单中。点击“添加购买订单”按钮,页面将该商品的数据传递到后台,首先查询数据库购买订单表中是否已经存在该商品,若存在直接将商品数量加一,若不存在则创建一个新的购买订单对象,添加购买订单成功,数据库中的购买订单表添加一条信息。用户还可以点击“我的购买订单”查看添加到购买订单的商品,系统通过读取 session获取到用户 ID,将用户 ID 传递到后台,在购买订单表中查询该用户的所有购买订单信息,返回数据到我的购买订单页面。

商品购买界面如下图所示。

 

图5-6商品购买界面

支付界面如下图所示。

 

图5-7支付界面

商品购买关键代码:

 @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. 用户管理的实现

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

 

5-8用户管理界面

  1. 商城资讯管理的实现

管理员可以获取系统中所有商城资讯的列表并对其进行编辑。管理员在添加商城资讯时,需要输入商城资讯标题、文章分类、标签等。添加商城资讯完成,数据库商城资讯表添加一条信息。

商城资讯管理界面如下图所示。

 

图5-9商城资讯管理界面

商城资讯管理关键代码:

  @RequestMapping(value = {"/avg_group", "/avg"})

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

        Query count = service.avg(service.readQuery(request), service.readConfig(request));

        return success(count.getResultList());

}

  1. 订单管理的实现

管理员在后台管理界面点击到所有订单界面列表,可以搜索当前所有订单信息,调用搜索全部订单的请求,向数据库的订单表搜索当前所有订单并将订单信息以对象的形式层层返回到订单列表界面,显示出当前所有订单信息。同时可以删除过期订单,确认已有订单,进行发货处理。

商品管理界面如下图所示。

 

图5-10商品管理界面

订单列表管理界面如下图所示。

 

图5-11订单列表管理界面

订单列表管理的关键代码如下。

@RequestMapping("/get_obj")

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

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

        List resultList = select.getResultList();

        if (resultList.size() > 0) {

            JSONObject jsonObject = new JSONObject();

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

            return success(jsonObject);

        } else {

            return success(null);

        }

}

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

        StringBuffer sql = new StringBuffer("select ");

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

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

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

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

        }

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

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

        }

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

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

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

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

        }

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

        return runEntitySql(sql.toString());

    }

  • 系统测试
  • 系统可靠性测试

以进入系统首页的访问速度为例展示系统的性能测试;系统的主要用户群体是购物理念较为先进的消费者,系统要在3秒钟内响应;需要完成页面的菜单栏、商城活动、游戏资讯、优惠券领取、订单中心以及各功能模块入口等元素的显示。

  • 系统功能性测试

功能性测试是指执行指定的工作流程,通过对一个系统的所有特性和功能都进行测试确保符合需求和规范。

系统功能性测试表如下表所示。

11系统功能性测试表

编号

测试功能

测试内容

测试结果

1

用户登录

1.验证用户名与密码的正确性。

2.验证密码是否可见。

通过

2

首页展示

1.首页数据是否成功加载。

2.验证搜索功能的准确性。

3.验证是否可以异步加载。

4.验证导航栏按钮。

通过

3

个人信息修改

1.验证登录名是否可以正常更改。

2.验证联系方式是否可以更改。

3.验证收货地址可以正常修改。

4.验证密码是否可以修改。

通过

4

购买管理

1.购买订单清单是否可以生成。

2.验证消费信息是否准确。

通过

7

商品管理

1.验证类目新增是否可以成功。

2.验证类目删除是否可以成功。

通过

8

商城管理

1.商城信息是否与上传一致。

2.是否能完成活动修改。

3.验证活动商品信息修改。

通过

9

订单处理

1.能否正常上传单号完成发货。

2.验证数据准确性。

通过

10

用户管理

1.验证用户录入功能。

2.验证用户违规清理功能。

通过

  • 系统合格性测试

集成测试后,所有的模块已经全部连接完毕,形成了一个完整的系统。合格性测试是在集成测试完毕后,进一步对系统进行综合性的检测。经过合格性测试,可以检查出系统是否符合系统的设计,能够完成需求的所有功能。本系统经过最后的测试,所有模块功能都能按预定要求工作。

  • 测试结果

在实际测试中,经过一系列系统性的测试,使我们能够及时发现一些系统在设计中出现的疏忽和漏洞。经过严密的测试,不仅发现了模块内部的错误,也查找到模块连接后产生的错误。经过测试,对系统产生错误的地方进行优化、修改和完善,使得系统能够实现最初设计的基本功能。

  • 总结与展望

本文针对游戏周边商城的特点和用户需求,利用 Java相关技术、Springboot框架和MVVM 模式等技术,通过详细的需求分析、页面设计和功能设计,最终实现了一个基于 Java 的游戏周边商城。

系统利用JQuery 技术和 CSS 技术进行了系统页面设计,实现了包括用户模块、商城模块、商品模块、购买订单模块和前台系统以及包括用户管理模块、商品管理模块、订单管理模块的后台系统。另外,系统还进行了数据安全设计和商品信息推荐模块设计,并添加了用户的访问控制,建立了一个完整、健壮、安全稳定的游戏周边商城。

由于时间限制和本人能力条件有限,该系统还存在一些不足,今后也会出现许多新的开发技术,未来还可以对系统做出如下改进:

(1)优化系统页面,使页面更加美观且方便操作;

(2)优化商品搜索功能,提供多条件选择查询搜索;

(3)优化商品推荐功能,提高商品推荐的精准度;

(4)优化在线支付功能,提供更多支付接口,使用户付款更加方便;

(5)进一步提高系统的安全性,使系统更加健壮;

(6)优化数据和代码,提升软件效率,方便系统维护和扩展。

参考文献

  1. 杨文豪. 基于微服务的网上商城系统的设计与实现[D].北京邮电大学,2021.
  2. [2]程红琳. 网上商城品目扩容效果几何[N]. 中国政府采购报,2021-05-18(005).
  3. 魏钢毅. 从“一品目一采购”到供应商承诺入驻[N]. 中国政府采购报,2021-05-11(005).
  4. [4]王娟.基于Android系统的手机网上商城设计与实现[J].电子技术与软件工程,2021(03):43-44.
  5. 裴来芝,宁云智,刘东海.基于ASP.NET的网上商城中用户注册功能模块设计与实现[J].电脑编程技巧与维护,2020(10):44-46.
  6. [6]袁江琛.Ajax+jQuery在网上商城购物车模块中的设计与实现[J].电脑编程技巧与维护,2020(10):34-35+68.

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

[8]黄舒珣. 基于文本挖掘的迪卡侬网上商城顾客满意度影响因素研究[D].广西民族大学,2020.

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

[10]李贝贝. 考虑策略型消费者的网上商城动态定价研究[D].大连大学,2019.

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

[12]袁嘉. 零售商多渠道供应链的定价决策与渠道选择[D].重庆交通大学,2019.

[13]徐光耀. 基于Dubbo分布式架构网上商城的研究与实现[D].沈阳师范大学,2019.

[14]刘芳羽.新华书店“网上商城”上线运营[J].时尚北京,2018(06):158-159.

                                              致谢

时光飞逝,转眼间我在学校的这些年生活即将结束,回顾这几年的学习生活,收获良多,既有幸福也有难过,学校生活的结束对于我来说也是一个新的开始。论文即将完成,在此,我心中有许多想要感谢的人。首先感谢我的导师,不仅在学习研究方面加以指导,也在生活和为人处世上给予帮助。还要感谢授课老师,你们严谨的学术精神和积极向上的工作态度都在激励我的成长和进步。感谢多年来一直生活在一起的室友,谢谢你们多年来的陪伴和照顾。最后,要感谢各位论文评审老师,感谢您们在百忙之中抽空评阅本论文并给出宝贵的意见和建议。

点赞+收藏+关注 → 私信领取本源代码、数据库
 

Guess you like

Origin blog.csdn.net/weixin_61498557/article/details/131102442