(with source code) springboot+ online bookstore management system computer complete set 03780

Based on springboot online bookstore management system

  Summary

The online bookstore management system uses B/S structure, java development language, Mysql database and other technologies. The system is mainly divided into two parts: administrators and users. The main functions of administrator management include: homepage, site management (carousel chart) user management (administrators, registered users) content management (good book recommendations, recommended categories) and more management ( Book classification, book information, book purchase, procurement and warehousing, product after-sales), etc. User personal backend management mainly includes: home page, book purchase, product after-sales and other functions, which basically realizes the entire information management process of the online bookstore management system. Based on the general online bookstore management system, this system adds the function of pushing the latest information on the homepage to facilitate users to browse quickly. It is an efficient, dynamic, interactive and friendly online bookstore management system.

Keywords: Online bookstore management system; java technology; Mysql database; B/S structure 

Online bookstore management system based on spring boot

Abstract

The online bookstore management system adopts B/S structure, java development language, MySQL database and other technologies. The system is mainly divided into two parts: administrator and user. The main functions of administrator management include: home page, site management (carousel map), user management (administrator, registered user), content management (good book recommendation, recommended classification), more management (book classification, book information, book purchase, purchase warehousing, commodity after-sales), etc. The user's personal background management mainly includes: home page, book purchase, commodity after-sales and other functions, basically realizing the process of information management of the entire online bookstore management system. Based on the general online bookstore management system, this system adds the function of home page pushing the latest information to facilitate users' quick browsing. It is an efficient, dynamic and interactive online bookstore management system.

Key words: online bookstore management system; Java technology; MySQL database; B/S structure

Key words: bookstore website; Java technology; MySQL database; B/S structure  

Table of contents

1 Introduction

1.1 Research background

1.2 Research status

1.3 Research significance

1.4 Research purpose

2 System development environment

2.1 System development platform

2.2 Platform development related technologies

2.2.1 B/S architecture

2.2.2 Introduction to Java technology

2.2.3 Introduction to mysql database

2.2.4 Introduction to spring boot framework

3 Demand Analysis

3.1 System goals

3.2 System functions

3.3 System process and logic

4 System outline design

4.1 Overview

4.2 System structure

4.3. Database design

4.3.1 Database entities

4.3.2 Database design table

5 System detailed design

5.1 System function modules

5.2 Administrator function module

6 system test

6.1 Purpose of system testing

6.2 Testing Strategy

6.3 Test characteristics and analysis

6.4 Functional testing

6.5 Test results

in conclusion

thank you

references

1Introduction _

1.1 Research background

In the past, information management related to online bookstore management systems was done manually by staff. This method is not only timely but also inconvenient when searching and changing. With the advancement of science, the maturity of technology, and the rapid development of computer informatization, computers have now entered various fields of the development of human society and play a very important role. This system makes full use of the convenience of the Internet and greatly improves work efficiency. It will also have good results when extended to the service level. With the Internet, the management of all aspects of the online bookstore management system is more scientific and systematic, more standardized and Easy.

1.2 Research status

In China, the online bookstore management system is a well-known large-scale website in the country. The company provides a full range of book services to more than 10 million users. Its after-sales service is also very guaranteed, allowing users to enjoy various pictures with peace of mind and comfort. However, due to Its single and uncompetitive price and the rise and popularity of various other online bookstore management systems have caused it to lose some customers.

The online bookstore management system is a domestic strategy mainly dedicated to book information. First of all, the online bookstore management system provides users with one-stop book information. In addition, the online bookstore management system will provide users with the most representative local book information and products, improving the user's viewing quality and preventing users from blindly looking for books.

The China Online Bookstore Management System adheres to the "people-oriented" principle to classify the content of the website. At the same time, the website comprehensively organizes professional book information that is loved by the majority of travel enthusiasts. It is currently an influential online bookstore management system in China.

Nowadays, the Internet has penetrated deeply into people's lives, and smart phones and laptops have become the main tools for people to obtain information. Therefore, it has become a general trend to use the Internet to manage online bookstore management systems. Therefore, it is necessary to develop an online bookstore management system. of.

1.3 Research significance

In the past, when people went to various places to buy books, they often did not know how to choose the book plan that best suited them due to the limitations of information, and often spent a lot of time and energy. Nowadays, the 21st century is an information-based world. The rapid development of the Internet industry has driven all aspects of life. The importance of standardization and efficiency of information management has become increasingly prominent.

The online bookstore management system uses reasonable management of information to dynamically, efficiently and securely realize various needs of customers, changing the traditional way of buying books, allowing users to purchase books that best suit their interests and hobbies online without leaving home. plan.

1.4 Research purpose

Today, various online bookstore management systems have emerged one after another in order to enable the public to quickly obtain a large amount of information and save energy and financial resources. In this system, functions such as viewing detailed content of books and online purchasing are realized. The system has homepage, personal center, site management (carousel), user management (administrators, registered users), content management (good book recommendations, recommended categories) and more management (book classification, book information, book purchase, purchase and storage) , commodity after-sales) and other functions. First of all, in this system, users can view and have a comprehensive understanding through the book information function of this website, and can order books online without any worries, or plan their own book ordering plans through the user module. Secondly, after the user registers and logs into this website, the user can enter the personal backend to manage personal center, message board management, my collection management, order management and other functions. Finally, on the home page, a push function is added, allowing users to directly and quickly access the richest content, improving user experience and increasing sales. 

This website basically realizes the entire information management process of the online bookstore management system, and provides the public with a safe, dynamic and efficient online bookstore management system .

2 system development environment

In order to enable this system to be designed and implemented in a better and more complete manner, I conducted a detailed analysis of the new system in terms of functionality. Through detailed analysis, the front-end part is developed based on the MVVM model, using the B/S mode, and the back-end part is developed based on the Java springboot 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 springboot as the development framework, and integrate MyBatis, Redis and other related technologies.

2.1 System development platform

In this online bookstore management system, Java technology can bring great convenience to users. Its main feature is that it allows users to learn quickly and conveniently. On the other hand, the amount of information stored is also very large. This function is mainly used for Query and program in database. Moreover, the data application of this function is relatively flexible. Through our current development, we can know that very powerful functions can be achieved by using only a small part of the code.

2.2 Platform development related technologies

  2.2.1 B/S architecture 

The B/S structure also has many features. For example, signal requests can be made in many browsers. And it can appropriately reduce the user's workload. By installing or configuring a small amount of running software on the client, the user's workload can be gradually reduced. The operation of these functions is mainly controlled by the server. As the technology of the software continues Mature, the most important feature is that it cooperates with the browser, which brings great convenience to software development. It can not only reduce development costs, but also continuously strengthen the software functions of the system. The layers are independent of each other and the presentation layer is the B/S The structure completes the main characteristics of interconnection.

  2.2.2 Introduction to Java technology 

The Java language is good at developing Internet applications and enterprise-level applications. It is now quite mature and is one of the most commonly used programming languages. The Java language is very object-oriented and can be designed in line with human thinking patterns. Encapsulation is to hide the properties and methods of objects as much as possible, so that the outside world does not know how to implement them, and the outside world can access them through the interface. Inheritance means that each class has a parent class, and all subclasses have the methods of the parent class and can be inherited, but only final-modified classes cannot be inherited. Through inheritance, the code can be reused and the software can be improved. Development efficiency is also a prerequisite for polymorphism.

Java, like C language, C# language, etc., is also a program development language, and its characteristic is object-oriented. As a language for program development and design, it has many features, the main features of which are object-oriented, platform-oriented, and the ability to run in a distributed manner. Java language projects are not only highly secure and stable, but can also run concurrently.

In order to improve the speed and efficiency of development, it is necessary to reuse code and simplify the complexity of the program. To achieve the above requirements, the Java language is implemented through encapsulation, inheritance and polymorphism, which can achieve the encapsulation of information to a large extent. , improve code reuse rate, reduce redundancy, and improve efficiency. One of the most valuable things about Java is its garbage collection mechanism, which has better alleviated the problem of memory leaks that existed in a large number of programs in the past. The so-called memory leak means that the program applies for a piece of storage space from the operating system, such as defining a variable, but for some reason, this variable has not been used, but it still occupies the system's memory space. Maybe one or two such variables are not suitable for the system. The program and operating system will not have a big impact, but imagine that if more such variables are defined, the system's memory space will be reduced step by step, resulting in reduced machine performance or even downtime. However, there is a garbage collection mechanism in Java. This mechanism greatly avoids the occurrence of memory leaks. In the Java virtual machine, the garbage collection mechanism will perform garbage collection on objects that have not been referenced by variables for a long time. To put it simply, Destroy this object to avoid memory leaks.

  2.2.3 Introduction to mysql database 

MySQL is a Relational Database Management System, which literally means relational database management system. MySQL has its unique characteristics. These characteristics make it one of the most popular RDBMS at present. MySQL wants to compare with other databases such as ORACLE and DB2. etc. It is a database that is small in size and fast in speed. The key point is that it is in line with the real music environment of this graduation project, has low ownership costs, and develops source code. This is also the main reason for choosing it.

This system uses the MySQL database, and establishes multiple database tables to store music and music website related data. The system mainly uses statements such as query (select), modification (update), deletion (delete) and increase (insert) to realize system functions.

2.2.4  Introduction to spring boot framework

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

Therefore, combined with the needs of the online bookstore management system and the implementation of functional modules, it is most appropriate to use springboot technology, and springboot has better scalability. For the online bookstore management system, the system functions can be continuously expanded in the later use process. Make the system more complete and more convenient to meet user needs.

3Requirements analysis

The so-called requirements analysis means that requirements personnel obtain information through communication with customers, and then display this information to users and developers in the form of requirements specifications.

3.1 System goals

This system is designed as an online bookstore management system website. This website allows users to view personal center, message board management, my collection management, order management, etc. online in front of the computer without going out. You can enjoy book information on the pictures on the website without going to the site in person.

Users will see the push content of various modules on the homepage, and can obtain information in the most direct way. After registering and logging in, they can make reservations and purchases for their favorite books, and in the background they can manage their own personal center, message board management, My collection management, order management, etc. The administrator can directly manage and process user orders and other information in the background. The module design of this website is highly independent, has a good user experience, and is very convenient for later maintenance, modification and management.

3.2 System functions

The functionality of this system is divided into user and administrator modules:

User function module The user module includes: personal center, message board management, my collection management, order management, commodity after-sales and other modules.

Administrator function modules include: homepage, site management (carousel) user management (administrators, registered users) content management (good book recommendations, recommended categories) more management (book classification, book information, book purchase, purchase and storage) , product after-sales) and other modules.

3.3 System process and logic

System business flow chart, as shown in the figure:

 

Figure 3-1 Login flow chart

 

Figure 3-2 Add information flow chart

 

Figure 3-3 Registration information flow chart

4 System outline design

4.1 Overview

The online bookstore management system is based on the Web service model and is a model structure suitable for the Internet environment. As long as users can connect to the Internet, they can use this system without being restricted by time or location. The working principle diagram of the online bookstore management system is shown in Figure 4-1:

 

Figure 4-1 System working principle diagram

4.2 System structure

This system architecture website system, the specific functions of this system are as follows:

 

Figure 4- 2 System function structure diagram

The administrator function structure diagram is shown in Figure 4-3:

 

Figure 4-3 Administrator function structure diagram

The user background function structure diagram is shown in Figure 4-4:

 

Figure 4-4 User background function structure diagram

4.3 . Database design

4.3.1 Database entities

The administrator information structure diagram is shown in Figure 4-5:

 

 Figure 4-5 Structural diagram of administrator information entity

The attribute diagram of the administrator function entity is shown in Figure 4-6:

 

                                                      Figure 4-6 Administrator function entity property diagram

User profile entity attribute diagram, as shown in Figure 4-7:

 

                                                        Figure 4-7 User profile entity attribute diagram

4.3.2 Database Design Table

This system requires a backend database. The details of each table in the database are introduced below.

after_sales_of_goods

Field Name

type

length

not null

primary key

Field description

after_sales_of_goods_id

int

11

yes

primary key

Product after-sales ID

order_number

varchar

64

no

order number

book_number

varchar

64

no

Book number

book_name

varchar

64

no

book title

author

varchar

64

no

author

user

int

11

no

user

after_sales_type

varchar

64

no

Aftermarket type

after_sales_content

text

0

no

After-sales content

related_pictures

varchar

255

no

related pictures

examine_state

varchar

16

yes

Approval Status

examine_reply

varchar

16

no

moderation reply

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

book_classification

Field Name

type

length

not null

primary key

Field description

book_classification_id

int

11

yes

primary key

Book category ID

book_category

varchar

64

no

Book category

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

book_information

Field Name

type

length

not null

primary key

Field description

book_information_id

int

11

yes

primary key

Book information ID

book_number

varchar

64

no

Book number

book_name

varchar

64

no

book title

book_category

varchar

64

no

Book category

cover

varchar

255

no

cover

author

varchar

64

no

author

press

varchar

64

no

the publisher

stock

int

11

no

in stock

price

int

11

no

price

content_validity

text

0

no

brief introduction

book_introduction

longtext

0

no

Book introduction

hits

int

11

yes

hits

praise_len

int

11

yes

Likes

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

book_purchase

Field Name

type

length

not null

primary key

Field description

book_purchase_id

int

11

yes

primary key

Book purchase ID

order_number

varchar

64

no

order number

book_number

varchar

64

no

Book number

book_name

varchar

64

no

book title

author

varchar

64

no

author

price

varchar

64

no

price

purchase_quantity

int

11

no

Purchase quantity

total_price

varchar

64

no

Total cost

user

int

11

no

user

consignee

varchar

64

no

Receiver

ship_to_address

varchar

64

no

Shipping address

contact_number

varchar

64

no

contact number

order_remarks

text

0

no

order notes

pay_state

varchar

16

yes

Payment status

pay_type

varchar

16

no

Payment type WeChat, Alipay, online banking

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

chart

Field Name

type

length

not null

primary key

Field description

chart_id

int

10

yes

primary key

Chat ID

user_id

int

11

yes

User ID

title

varchar

64

no

title

content

longtext

0

yes

content

nickname

varchar

32

yes

Nick name

avatar

varchar

255

no

avatar

create_time

timestamp

0

yes

creation time

update_time

timestamp

0

yes

Update time

reply_id

int

11

yes

Reply ID

purchase_receipt

Field Name

type

length

not null

primary key

Field description

purchase_receipt_id

int

11

yes

primary key

Purchase warehousing ID

book_number

varchar

64

no

Book number

book_name

varchar

64

no

book title

author

varchar

64

no

author

press

varchar

64

no

the publisher

purchase_price

varchar

64

no

Purchase price

purchase_quantity

int

11

no

Purchase quantity

supplier_name

varchar

64

no

Supplier name

contact_number

varchar

64

no

contact number

remarks

text

0

no

Remark

recommend

int

11

yes

Intelligent Recommendation

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

registered_user

Field Name

type

length

not null

primary key

Field description

registered_user_id

int

11

yes

primary key

Register user ID

user_no

varchar

64

yes

user ID

full_name

varchar

64

no

Name

gender

varchar

64

no

gender

examine_state

varchar

16

yes

Approval Status

recommend

int

11

yes

Intelligent Recommendation

user_id

int

11

yes

User ID

create_time

datetime

0

yes

creation time

update_time

timestamp

0

yes

Update time

5 System detailed design

5.1 System function modules

Design of online bookstore management system. On the homepage of the online bookstore management system, you can view the homepage, book information, forum information, news information, message feedback, mine, jump to the backend, shopping cart and other contents, as shown in Figure 5-1.

 

Figure 5-1 Website home page interface diagram

The homepage code is as follows:

  @RequestMapping("/get_obj")

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

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

        List resultList = select.getResultList();

        if (resultList.size() > 0) {

            JSONObject jsonObject = new JSONObject();

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

            return success(jsonObject);

        } else {

            return success(null);

        }

}

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

        StringBuffer sql = new StringBuffer("select ");

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

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

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

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

        }

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

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

        }

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

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

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

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

        }

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

        return runEntitySql(sql.toString());

    }

图书信息,在图书信息页面可以查看名称、价格、库存、书籍编号、书籍类型、图片、简述、作者、出版社、详情等详细信息,根据需要进行添加到购物车、立即购买、评价或收藏,如图5-2所示。

 

图5-2图书信息界面图

用户注册,在用户注册页面可以填写用户名、密码、姓名、身份证、手机等信息进行注册,如图5-3所示。在个人中心页面可以填写用户名、密码、姓名、性别、图片、身份证、手机等信息进行更新操作,还可以根据需要我的发布,我的订单,我的地址,我的收藏进行相应操作;如图5-4所示。

 

图5-3用户注册界面图

注册代码如下:

/**

     * 注册

     * @param user

     * @return

     */

    @PostMapping("register")

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

        // 查询用户

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

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

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

        if (list.size()>0){

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

        }

        user.setUserId(null);

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

        service.save(user);

        return success(1);

}

/**

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

     */

    @Id

    @GeneratedValue(strategy = GenerationType.IDENTITY)

    @Column(name = "user_id")

    private Integer userId;

    /**

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

     */

    @Basic

    @Column(name = "state")

    private Integer state;

    /**

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

     */

    @Basic

    @Column(name = "user_group")

    private String userGroup;

    /**

     * 上次登录时间:

     */

    @Basic

    @Column(name = "login_time")

    private Timestamp loginTime;

    /**

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

     */

    @Basic

    @Column(name = "phone")

    private String phone;

    /**

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

     */

    @Basic

    @Column(name = "phone_state")

    private Integer phoneState;

    /**

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

     */

    @Basic

    @Column(name = "username")

    private String username;

    /**

     * 昵称:[0,16]

     */

    @Basic

    @Column(name = "nickname")

    private String nickname;

    /**

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

     */

    @Basic

    @Column(name = "password")

    private String password;

    /**

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

     */

    @Basic

    @Column(name = "email")

    private String email;

    /**

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

     */

    @Basic

    @Column(name = "email_state")

    private Integer emailState;

    /**

     * 头像地址:[0,255]

     */

    @Basic

    @Column(name = "avatar")

    private String avatar;

    /**

     * 创建时间:

     */

    @Basic

    @Column(name = "create_time")

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

    private Timestamp createTime;

    @Basic

    @Transient

    private String code;

}

 

图5-4个人中心界面图

我的收藏,在我的收藏页面可以查看收藏书籍名称、等详细信息,根据需要进行购买或删除,如图5-5所示。

         

 

图5-5我的收藏界面图

用户登录进入网站后台可以查看个人中心、首页、图书购买、商品售后等内容,在我的收藏管理等信息进行查看或删除等操作,如图5-6所示。

 

图5-6用户后台功能界面图

图书购买管理,在图书购买页面可以对订单编号、图书编号、图书名称、商品图片、购买数量、作者、总价格、支付类型、状态、地址等信息进行查看、确认收货等操作,还可以根据需要对已支付订单、商品售后、已完成订单、未支付订单、已取消订单进行相应操作;如图5-7所示。

 

图5-7订单管理界面图

5.2管理员功能模块

管理员登录,管理员通过输入账号,密码,权限等信息即可进行系统登录,如图5-8所示。

 

图5-8管理员登录界面图

登录代码如下:

/**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

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

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

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

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

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

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

        List resultList = null;

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

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

            map.put("username", username);

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

        }

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

            map.put("email", email);

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

        }

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

            map.put("phone", phone);

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

        }else{

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

        }

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

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

        }

        //判断是否有这个用户

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

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

        }

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

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

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

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

        if (groupList.size()<1){

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

        }

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

        //查询用户审核状态

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

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

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

            if (res==null){

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

            }

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

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

            }

        }

        //查询用户状态

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

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

        }

        String md5password = service.encryption(password);

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

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

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

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

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

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

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

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

        }

}

管理员登录进入网上书店管理系统设计可以查看首页、站点管理(轮播图)用户管理(管理员、注册用户)内容管理(好书推荐、推荐分类)更多管理(图书分类、图书信息、图书购买、采购入库、商品售后)等内容进行操作,如图5-9所示。

 

图5-9管理员功能界面图

用户管理,在用户管理页面可以对用户名、密码、姓名、性别、头像、身份证、手机等信息进行删除,修改等操作,如图5-10所示。

 

图5-10用户管理界面图

图书分类管理,在图书分类管理页面可以对图书类型信息进行删除,修改等操作,如图5-11所示。

 

图5-11图书分类管理界面图

图书信息管理,在图书信息管理页面可以对图书编号、书籍名称、书籍类型、图片、简述、作者、出版社、详情、价格、单限、库存等信息进行查看、修改或删除等操作,如图5-12所示。

 

图5-12图书信息管理界面图

商品售后管理,在商品售后管理页面可以对用户名、售后类型、售后内容、相关图片、审核状态等信息进行查看或详情等操作,还可以根据需要对商品售后管理进行回复相应操作;如图5-13所示。

 

图5-13商品售后管理界面图

图书购买管理,在图书购买页面可以对订单编号、图书编号、图书名称、图书图片、购买数量、价格、用户名、支付类型、状态、地址等信息进行查看、详情、购买、采购入库、查看评论等操作,还可以根据需要对商品售后进行相应操作;如图5-14所示。

 

图5-14图书购买界面图

6 系统测试

6.1系统测试的目的 

程序设计不能保证没有错误,这是一个开发过程,在错误或错误的过程中都是难以避免的。虽然这是不可避免的,但我们不能使这些错误始终存在于系统中,错误可能会造成无法估量的后果,如系统崩溃,安全信息泄露,系统无法正常启动等,为了避免这些问题,我们需要测试程序,再测试过程中发现问题,并纠正它们,从而使系统更长时间稳定成熟。

本章的作用是发现这些问题,并对其进行修改,虽然耗时费力,但对于长期使用而言是非常重要和必要系统的开发。

软件在设计后必须进行测试,调试过程中使用的方法是软件测试方法。在开发新软件时,系统测试是检查软件是否合格的关键步骤,以及是否符合设计目标的参考。测试主要是查看软件中数据的准确性,正确的操作与否,以及操作的结果,还有哪些方面需要改进。

网上书店管理系统的实现,对于系统中功能模块的实现及操作都必须通过测试进行来评判系统是否可以准确的实现。在系统正式上传使用之前必须做的一步就是系统测试,对于测试发现的错误及时修改处理,保证系统准确无误的供给用户使用。

6.2测试策略

测试系统主要针对以下三个方面进行测试:

1、基于springboot的系统代码的单元测试,集成测试,系统测试和验收测试结果;

2、测试对象中列出的可测试或不可接受的特征和功能;

3、分析并记录测试要求:日期的书面文件不影响测试的设计、开发和执行。

6.3测试特性及分析

系统测试的特性如下:

(1)挑剔性:测试是为了找出系统的错误,在系统测试时我们要严格苛刻,十分挑剔。

(2)复杂性:测试是一个非常复杂的过程。

(3)不彻底性:虽然系统经过测试,但测试仍然会存在不够彻底的问题,测试不能保证系统后期运行完整无误,所以要在后期不断的检查、修改。

(4)经济性:通场这种测试称为“选择测试(Selective Testing)”。在测试时要遵守经济性的原则。

经过测试,产品的稳定性和成熟度可以大大提高,产品质量也可以得到保证。

6.4功能测试

系统测试方面,我们通常运用的是白盒测试以及黑盒测试这两种方法。白盒测试是指在了解系统内部工作流程的前提下,可以根据需求规范验证系统内部操作是否能够正常运行的测试;而黑盒测试指的是,倘若知道了这个系统的全部功能,可以进行测试检测系统中的每一个功能是否满足正常使用。

功能测试,主要是对系统的用户登录进行详细的测试,但是登录不可以是任何人都可以登录成功的,所以对登录进行详细测试。

用户登录测试:

模块名称

测试用例

预期结果

实际结果

是否通过

登录模块

用户名:admin   密码:123  

弹出错误提示,提示密码错误

弹出错误提示,提示密码错误

通过

登录模块

用户名:123   

密码:admin   

弹出错误提示,提示用户名错误

弹出错误提示,提示用户名错误

通过

登录模块

用户名:admin   

密码:admin   

管理员登录成功

管理员登录成功

通过

删除分类测试:

模块名称

测试用例

预期结果

实际结果

是否通过

删除分类模块

分类名:最新通知  

删除成功、页面自动跳转

删除成功、页面自动跳转

通过

修改密码测试:

模块名称

测试用例

预期结果

实际结果

是否通过

修改密码模块

原密码:666

新密码:123

确认密码:123  

弹出错误提示,提示原密码错误

弹出错误提示,提示原密码错误

通过

修改密码模块

原密码:admin   新密码:123

确认密码:333  

弹出错误提示,提示确认密码不一致

弹出错误提示,提示确认密码不一致

通过

修改密码模块

原密码:admin   新密码:123

确认密码:123  

密码修改成功

密码修改成功

通过

通过对功能的测试,网上书店管理系统的基本功能都是可行的,不管是系统里面的功能,还是界面的设计都是可值得推广宣传的。

6.5测试结果

经过对一系列测试结果的有效分析,本平台开发系统符合用户的要求和需求。所有的基本功能相对齐全,操作起来简单方便,测试系统性能良好,作为大众化系统使用是比较值得推广宣传的。

结论

此时项目已经完成,即使实施的时间不是很长,但是在这个过程中需要准备很长的一段时间去对系统设计开发所实际用到的技术进行学习和巩固。在学习的过程中,我逐渐认识到了我自身存在的一些不足。对于一些控制是必要的应用技能,能够理解,整个过程中仅仅是掌握了常用的性能和控制方法,我觉得还是相对来说挺容易的。从该系统中,系统的分析和设计的调查数据,已经经历了几个月,并且努力了几个月,该系统现在已经完成。很显然,该系统仍有很多不成熟的地方,在系统设计过程中有许多技术缺陷存在。在设计的过程中也涉及到了很多自己无法解决的问题,主要通过找专业的网站和论坛来解决这些问题,对于圆满完成我的毕业设计,他们也贡献了很大一部分力量。

系统的开发环境和配置都是可以自行安装的,系统使用采用springboot作为开发框架,使用比较成熟的Mysql数据库进行对系统前台及后台的数据交互,根据技术语言结合需求对数据库进行修改维护,可以使得系统运行更具有稳定性和安全性,从而完成实现系统的开发。

在设计网上书店管理系统的过程中还遇到了一个棘手的问题,那就是自己的英语水平还有待提高,很多关于网站技术开发的资料文献都是英文版的,关键词语以及技术性词汇不能很好的理解。只有在借助翻译软件的实时性翻译功能的辅助下才勉强看懂。显然英语水平的高低直接影响到系统的开发过程。

回顾毕业设计的整个过程,既付出了努力与汗水也收获了很多难以忘怀的美好经历。虽然在系统开发过程中经历了各种各样的困难,自己也在不断研究与探索,可是系统的实现仍有许多不足之处。但是经过系统编程工作的学习让我有了更多的信心,我相信在未来的路上,我会走的更好。

致 谢

毕业设计结束的同时也意味着四年的大学生活就要结束了。网上书店管理系统的完成以及如何在系统运行过程中实现的更好,这其中付出了很大的努力,这段时光将会终身难忘。

在毕业设计的这一段时间里,离不开导师的细心指导,还有同学们的热情帮助,有时候几个同学在一起讨论系统中的某个功能模块如何实现,如何实现的更好,或是问题没得到有效的解决,就会没有心思做其他的事情,让我们对学习充满了动力。

在毕业设计即将结束之时,首先要感谢我的指导老师,谢谢您在毕业设计和毕业论文中对我的指导。在您的细心指导下我才能快速的掌握系统的相关功能,在您的大力帮助下我才能将课本上的知识与自己的项目结合,真正的做到学以致用。感谢您经常牺牲自己的休息时间,利用其丰富的教学和项目经验对我进行指导。 课堂上,您教会我们如何学习、教会我们新的知识,在课下,您又像朋友一样亲切,教会了我很多道理,让我意识到先做人、后做事。感谢所有教过我的老师,为我倾注了大量的心血,正是你们的谆谆教诲、严谨教学才使我能顺利的完成学业,再此向你们表示深深的感谢。感谢大学里教过我的每一位老师,真心祝福您们。

在这里还得感谢我的战友们,也就是同学们对我的大力支持及帮助。正是因为有你们的不断帮助、鼓励,熬夜通宵,不停的调试、测试程序,给我带来了极大的动力,才能最终完成网站的运行。我们在一起交流、谈论的时光,都将是我们在通往未来道路上的宝贵财富。我要深深地感谢你们!

毕业在即,在今后的工作和生活中,我会铭记师长们的教诲、同学们的帮助,继续不懈努力和追求,来报答所有支持和帮助过我的人!

最后,我要向牺牲了休息时间来对本文进行审阅,评议和参与论文答辩的各位老师表示深深的感谢。在此,衷心的谢谢您们!


参考文献

[1]王屯屯.融合时序模型和W&D模型的在线商城商品推荐[J].信息技术与信息化,2021(08):78-80.

[2]刘庆. 威海:建价格监测机制  网上商城节支15%[N]. 政府采购信息报,2021-08-09(008).DOI:10.38293/n.cnki.nzfcg.2021.000771.

[3]沈家驹. 认知指示语的使用与消费者购买意愿的关系研究[D].四川外国语大学,2021.

[4]董莹. 吉林:为政采在线支付资金提速[N]. 政府采购信息报,2021-06-21(003).DOI:10.38293/n.cnki.nzfcg.2021.000511.

[5]Sriramulu Bojjagani,V. N. Sastry,Chien-Ming Chen,Saru Kumari,Muhammad Khurram Khan. Systematic survey of mobile payments, protocols, and security infrastructure[J]. Journal of Ambient Intelligence and Humanized Computing,2021(prepublish):

[6]印杏. 基于负面在线评论的国内外网购消费者行为差异性研究[D].浙江工商大学,2021.DOI:10.27462/d.cnki.ghzhc.2021.000274.

[7]宋苏娟,李赛凤,季振义,曾余洋,彭卫.在线评论有用性的影响因素探究——基于京东商城的实证研究[J].科技创业月刊,2021,34(02):72-79.

[8]牛希镭.基于JavaWeb的在线图书商城设计与实现[J].电子测试,2021(01):73-75.DOI:10.16520/j.cnki.1000-8519.2021.01.025.

[9]Jiao Ruohuang,Przepiorka Wojtek,Buskens Vincent. Reputation effects in peer-to-peer online markets: A meta-analysis[J]. Social Science Research,2021(prepublish):

[10]杨 丰嘉,黄 媛媛. 基于 Vue.js 的在线商城网站设计与实现[J]. 工程技术研究,2020,2(8):

[11]Cheng Hsing Kenneth,Fan Weiguo,Guo Peipei,Huang Hailiang,Qiu Liangfei. Can “Gold Medal” Online Sellers Earn Gold? The Impact of Reputation Badges on Sales[J]. Journal of Management Information Systems,2020,37(4):

[12]邹瑞,段华琼.基于前后端分离技术的在线商城的设计与实现[J].电脑知识与技术,2020,16(26):231-232+239.DOI:10.14004/j.cnki.ckt.2020.2844.

[13] Jia Xingxing. Research on competitive strategies and consumer preferences of enterprise-operated online malls and third-party online platforms [D]. Beijing University of Posts and Telecommunications, 2020. DOI: 10.26969/d.cnki.gbydu.2020.000544.

[14] Liu Liyuan. Design and implementation of micro mall based on HTML5 technology [J]. Computer Programming Skills and Maintenance, 2020(05):53-55.DOI:10.16184/j.cnki.comprg.2020.05.019.

[15] Su Jie. Analysis and Design of Online Mall Based on UML [J]. Computer Knowledge and Technology, 2020, 16(11): 276-277+286. DOI: 10.14004/j.cnki.ckt.2020.1467.

[16] Meng Xiangyun. Research on Interface Design of Online Shopping Guide APP Based on User Experience Optimization [D]. East China University of Science and Technology, 2019. DOI: 10.27148/d.cnki.ghagu.2019.000167.

[17] Wang Xuewen. Design and Implementation of Customer Service Question Answering System for Online Mall [D]. Harbin Institute of Technology, 2019. DOI: 10.27061/d.cnki.ghgdu.2019.001214.

[18] Zhu Chongjia. Design and Implementation of Online Shopping Mall Based on SSM Framework [D]. Beijing Jiaotong University, 2018.

[19] Zhou Juan. Research on Satisfaction Evaluation of B2C E-commerce Websites Based on Customer Needs [D]. Nanchang University, 2018.

[20] Zhou Xingyu. Design and Implementation of the Order Subsystem of Cross-border E-Commerce Online Mall [D]. Nanjing University, 2018.

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

Guess you like

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