Automobile sales | Design and implementation of an auto parts sales platform based on SpringBoo

Author Homepage: Programming Compass

About the author: High-quality creator in the Java field, CSDN blog expert, CSDN content partner, invited author of Nuggets, Alibaba Cloud blog expert, 51CTO invited author, many years of architect design experience, resident lecturer of Tencent classroom

Main content: Java project, Python project, front-end project, artificial intelligence and big data, resume template, learning materials, interview question bank, technical mutual assistance

Favorites, likes, don't get lost, it's good to follow the author

Get the source code at the end of the article 

Item number: BS-PT-085

1. Environmental introduction

Locale: Java: jdk1.8

Database: Mysql: mysql5.7

Application server: Tomcat: tomcat8.5.31

Development tools: IDEA or eclipse

Front-end development technology: Vue+ElementUI+Nodejs

Background development technology: Springboot+MybatisPlus

2. Project introduction

2.1 Introduction

In recent years, with the continuous popularization and in-depth development of the Internet, and at the same time benefiting from the national policy support for "Internet +", for a time, the domestic "Internet +" wave has been strongly promoted, and its upsurge can be said to have swept all walks of life . When everything is being restructured under the influence of the Internet, Internet e-commerce has become another market with very broad development prospects after the traditional market. Domestic enterprises in various industries are thinking about how to take advantage of the "wind" of the Internet to fly into the sky, so as to get a "piece of the pie" of Internet e-commerce.

This system is based on the SpringBoot framework and adopts B/S mode for design. The front-end page uses Vue.js, the development software uses IDEA as a programming tool, the jdk basic operating environment adopts version 1.8.0, and Maven3.6.3 is used as a dependency management tool and project construction The tool uses MySQL5.7 as the database for data storage, and the database management software uses Navicat.

Features of the auto parts sales platform: Allow users to browse products and view product details without logging in.

Users can query the products they want to buy through the three-level linkage classification of products. When the user clicks on a product, the system will automatically record the product information that the user browses, and use the user's browsing information to recommend products to the user. You can also comment on the product (support sensitive word filtering), purchase the product that has been added to the shopping cart, and you can view the history and manage your own order and address in the personal center.

2.2 Functional requirements

The auto parts sales platform is divided into front desk and back office. The front desk consists of: user module, commodity module, shopping cart module, and order module. User management includes: user login and registration, management of user personal information, and shopping cart operations. Personal center module: Users can manage their own delivery addresses in the personal center module, view their browsing records of products, their favorite products and manage previous comments, and users can manage their own orders. Commodity management includes: classification information of commodities, display and introduction of commodities, keyword search for commodities, and user comments on commodities. Order management module: order details, user cancellation of orders and confirmation of receipt. Shopping cart module: users can add items to the shopping cart and carry out item payment settlement. Background management includes: user management, product management, carousel map management, and comment management. User management: You can query and view user details for all registered users. Commodity management: You can put, modify and delete commodities, and you can also query all the commodities on the shelves. Invested products are displayed on the home page, and the carousel can be modified, added, and deleted. Comment management: background personnel can detect the content of each user's comments and can delete and query comments. The functional block diagram of the system is shown in Figure 1.

 

Figure 1 System function module diagram

Foreground users mainly include tourists and ordinary registered users. Visitors can use the basic functions of the website. For example, tourists can log in, register, search for products, and view product information without logging in. Ordinary registered users can enter their personal center to modify their personal information and address, and can search , Check the products, collect the products you like, you can add the products you want to buy to the shopping cart, you can directly enter the order settlement interface from the product details interface or the shopping cart, and you can perform Alipay payment and other functions. The user function use case diagram is shown in Figure 2.

 

Figure 2 User function use case diagram

The administrator logs in through the built-in account of the system, so that the administrator can manage the platform conveniently and quickly, and only the administrator user can access the background management system. It is divided into 4 management types: user management, product management, order management, and carousel map management. The administrator can query, modify, add, and delete the information of all users in the platform. The product management function is to be able to query, modify, add, and delete all products, as well as add, delete, modify and check product categories and popular products. Order management can query, modify, add and delete all commodities. Carousel map management: administrators can manage the home page carousel map. The use case diagram of the administrator function that can be modified is shown in Figure 3.

 

Figure 3 Administrator use case diagram

2.3 Database tables

(1) user: user table. Used to store basic user information, such as user ID and user status information. As shown in Table 4-1:

Table 4-1 User table structure

field name

type

describe

u_id

int

user ID

username

varchar(255)

username

password

varcgar(55)

password

nickname

varchar(255)

Nick name

phone

varbinary(13)

Phone number

photo

varbinary(255)

avatar

email

varchar(25)

E-mail

u_status

enum('0','1')

user status

(2) address: It is used to store the user's delivery address information. A user can have multiple delivery addresses, and each address has corresponding detailed information. The user's default address can be set as shown in Table 4-2:

Table 4-2 File warehouse table structure

field name

type

describe

addressid

int

Auto-increment, primary key, address ID

userid

int

Belonging user ID

userName

varcghar(24)

Consignee name

userPhone

varchar(11)

Consignee's mobile phone number

areaIdPath

varchar(255)

Zone ID path

areaId

int

Last Level Region ID

userAddress

varchar(255)

Address

isDefault

int

Whether the default address 0: No 1: Yes

dataFlag

int

Valid Status 1: Valid-1: Invalid

createTime

varchar    (55)

creation time

(3) bigplus_type: first-level classification table of commodities. The user stores the primary classification information of the product. As shown in Table 4-3:

Table 4-3 Commodity Classification Table Structure

field name

type

describe

bigpluses

int

Auto-increment, primary key, primary category ID

bigplus_name

varchar

Classification name

(4) big_type: Secondary classification table of commodities. The user stores the secondary classification information of the product and the id of the corresponding primary classification. As shown in Table 4-4:

Table 4-4 Commodity secondary classification table structure

field name

type

describe

big

int

Auto-increment, primary key, secondary classification ID

big_name

varchar

Secondary classification name

bigpluses

int

The primary category id corresponding to this category

(5) small_type: Three-level classification table of commodities. The user stores the secondary classification information of the product and the id of the corresponding primary classification. As shown in Table 4-5:

Table 4-5 Commodity three-level classification table structure

field name

type

describe

smallid

int

Auto-increment, primary key, three-level classification ID

small_name

varchar

Three-level classification name

big

int

The secondary category id corresponding to this category

(6) goods: commodity list. For product information, the product information contains the basic information of the product and the category id corresponding to the product so as to quickly query the information of the product and the corresponding comments under the product. As shown in Table 4-6:

Table 4-6 Product table structure

field name

type

describe

g_id

int

Product Number

goods_name

varchar(55)

product name

sid

int

Merchant ID

smallid

int

Commodity subcategory number

g_description

varchar(255)

Product Description

g_stock

int

Commodity stocks

g_price

double

commodity price

g_photo

varchar(255)

product picture

launch_time

varchar(55)

Added time

g_status

Int

commodity status

g_isnew

int

0, not new, 1. new

big

int

Secondary classification id

bigpluses

int

Primary category id

Comment_num

int

number of comments

Goods_sale_num

int

cumulative sales

(7) shopping_cart: shopping cart table. The basic information used to store the shopping cart of the front-end user includes the corresponding user number, product number, product, and so on. As shown in Table 4-7:

Table 4-7 Shopping cart table structure

field name

type

describe

cart_id

int

cart number

u_id

int

user ID

sid

int

Merchant ID

g_id

int

Product Number

amount

int

Number of Products

(8) favorites: user favorite table. It is used to store product information collected by front-end users. As shown in Table 4-8:

Table 4-8 Structure of user favorite table

field name

type

describe

Collect_id

int

Favorite item number

u_id

int

user ID

g_id

int

Product Number

Collect_time

Varchar

collection time

(9) history: user browsing history table. When the user clicks on the product in the login state to view the detailed information of the product, it will be automatically triggered to store the product information browsed by the front-end user. As shown in Table 4-9:

Table 4-9 User browsing history table structure

field name

type

describe

h_id

int

浏览历史编号

u_id

int

用户编号

g_id

int

商品编号

Goods_name

Varchar

商品名字

g_price

decimal

商品价格

G_photo

varchar

商品图片

(10)recommend:推荐表。当用户在登录状态点击商品查看商品的详细信息时,系统会自动给用户推荐个人经常浏览的商品。如表4-10所示:

表4-10 推荐表结构

字段名

类型

描述

re_id

int

推荐编号

u_id

int

用户编号

g_id

int

商品编号

smallid

int

商品小分类

(11)order_item:订单商品表。该表存储着商品和订单的关系,包括订单表一对多商品对应的商品信息。如表4-11所示:

表4-11 订单商品表结构

字段名

类型

描述

order_itemid

int

订单商品主键

o_id

int

订单主键

g_id

int

商品编号

g_name

varchar(55)

商品名称

item_price

double

商品单价

g_count

int

商品数量

(12)csorder:订单表。该表存储了一个用户该条订单对应的商品的详细信息。如表4-12所示:

表4-12 订单表结构

字段名

类型

描述

o_id

int

订单主键

orderId

varchar(55)

订单编号

u_id

int

用户编号

u_phone

varchar(11)

用户电话

order_time

varchar(23)

订单生成时间

o_total

double

总价

u_address

varchar(255)

用户地址

o_status

enum('0','1')

状态

(13)evaluate:评价表。该表存储了每个用户对哪一条商品的评论信息。如表4-13所示:

表4-13 评价表结构

字段名

类型

描述

Id

int

评价编号

orderid

Varchar(25)

订单编号

G_id

int

商品编号

U_id

int

用户编号

Create_time

Varchar(25)

创建时间

Agree

int

产品相似

Service

Int

服务评价

content

varchar

评价内容

Images

Varchar(25)

评价图片

Isshow

Int

是否显示

oId

Int

订单id

(14)banner:轮播图表。该表存储着前台轮播图展示的图片信息。如表4-14所示:

表4-14 轮播图表结构

字段名

类型

描述

Chart_id

int

轮播图主键

title

varchar(55)

轮播图标题

imageUrl

varchar(55)

图片地址

linkUrl

varchar(55)

图片链接

gmtCreate

varchar(55)

轮播图添加时间

(15)admin:管理员表。该表存储着管理员信息。如表4-15所示:

Table 4-15 Administrator table structure

field name

type

describe

a_id

int

primary key

username

varchar(55)

Admin username

password

varchar(55)

administrator password

photo

varchar(55)

Admin avatar

Three, system display

user registration

 User login

 personal center

car browsing

 Category display

Product Reviews

 

 shopping cart

My Order

 

 Backstage management

User Management

 commodity management

 comment management

  

Fourth, the core code display

package com.qst.controller.admin;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qst.dao.university.AdminMapper;
import com.qst.pojo.ResultInfo;
import com.qst.pojo.university.Admin;
import com.qst.service.admin.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    AdminService adminService;
    @Autowired
    AdminMapper adminMapper;
    @RequestMapping("/login")
    public ResultInfo login(String username,String password){
        Admin admin = null;
        try {
            admin = adminService.login(username, password);
        } catch (Exception e) {
            e.printStackTrace();
        }
        //管理员登录
        if (admin!=null){
            return new ResultInfo(true,admin,"登录成功");
        }else {
            return new ResultInfo(false,null,"用户名或者密码错误");
        }
    }
    //查询所有的管理员列表,通过条件分页查询
    @RequestMapping("/AdminList")
    public ResultInfo AdminList(@RequestParam(name = "currentPage" ,defaultValue = "1") int pageNum
            , @RequestParam(name = "pageSize" ,defaultValue = "5") int pageSize,String username,String isDelete){
        PageHelper.startPage(pageNum,pageSize);
        List<Admin> admins=adminService.AdminList(username,isDelete);
        PageInfo pageInfo=new PageInfo(admins);
        return new ResultInfo(true,pageInfo,null);
    }
    //修改管理员状态
    @RequestMapping("/DeleteAdmin")
    public ResultInfo DeleteAdmin(Admin admin){
        boolean b;
        b=adminService.DeleteAdmin(admin);
        if (b){
            return new ResultInfo(true,null,"修改成功");
        }else {
            return new ResultInfo(false,null,"修改失败");
        }
    }
    //添加管理员用户
    @RequestMapping("/addAdmin")
    public ResultInfo addAdmin(Admin admin){
        boolean b=adminService.addAdmin(admin);
        if (b){
            return new ResultInfo(true,null,null);
        }else {
            return new ResultInfo(false,null,"用户名重复");
        }

    }
    //查询管理员信息
    @RequestMapping("/GetInfo")
    public ResultInfo GetInfo(Integer aId){
        Admin admin = adminMapper.selectByPrimaryKey(aId);

        return new ResultInfo(true,admin,null);
    }
    //修改密码
    @RequestMapping("/UpdataInfo")
    public ResultInfo UpdataInfo(Admin admin,String new_password){
        Admin num=adminService.UpdataInfo(admin,new_password);
        if (num!=null){
            return new ResultInfo(true,num,null);
        }else {
            return new ResultInfo(false,null,"新密码不能和旧密码一致!");
        }

    }
}

package com.qst.controller.home;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.qst.pojo.ResultInfo;
import com.qst.pojo.university.BigplusType;
import com.qst.pojo.university.Goods;
import com.qst.pojo.vo.Goods_List;
import com.qst.service.home.HomeGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/home/goods")
public class HomeGoodsController {
    @Autowired
    HomeGoodsService homeGoodsService;

    /**
     * 查询新商品的专区
     * @return
     */
    @RequestMapping("/NewGoods")
    public ResultInfo NewGoods(){
        try {
            List<Goods> list = homeGoodsService.NewGoods();
            return new ResultInfo(true,list,"查询成功");
        } catch (Exception e) {
            e.printStackTrace();
            return new ResultInfo(false,null,"查询失败");
        }
    }
    //通过大分类查询所有的商品
    @RequestMapping("/GoodsList")
    public ResultInfo GoodsList(){
        try {
            List<Goods_List> list=homeGoodsService.GoodsList();

            return new ResultInfo(true,list,"查询成功");
        } catch (Exception e) {
            e.printStackTrace();
            return new ResultInfo(false,null,"查询失败");
        }
    }

    /**
     * 通过分类id查询所有的商品进行分页
     * @param class_info
     * @param goods_type
     * @param pageNum
     * @param pageSize
     * @return
     */

    @RequestMapping("/GoodsById")
    public ResultInfo GoodsById(int class_info, int goods_type,@RequestParam(name = "pageNum" ,defaultValue = "1")  int pageNum
            , @RequestParam(name = "pageSize" ,defaultValue = "5") int pageSize,String keywords){

        try {

            List<Goods> list= homeGoodsService.GoodsById(class_info,goods_type,keywords);

//            System.out.println(list+""+class_info+" "+goods_type);
//            System.out.println(list);
            PageInfo pageInfo = getPageInfo(pageNum, pageSize, list);
//            return new ResultInfo(true,null,"查询成功");
            return new ResultInfo(true,pageInfo,"查询成功");
        } catch (Exception e) {
            e.printStackTrace();
            return new ResultInfo(false,null,"查询失败");
        }

    }

    /**
     * pagehelper手动分页
     * @param currentPage 当前页
     * @param pageSize
     * @param list
     * @param <T>
     * @return
     */
    public static <T> PageInfo<T> getPageInfo(int currentPage, int pageSize, List<T> list) {
        int total = list.size();
        if (total > pageSize) {
            int toIndex = pageSize * currentPage;
            if (toIndex > total) {
                toIndex = total;
            }
            list = list.subList(pageSize * (currentPage - 1), toIndex);
        }
        Page<T> page = new Page<>(currentPage, pageSize);
        page.addAll(list);
        page.setPages((total + pageSize - 1) / pageSize);
        page.setTotal(total);
        PageInfo<T> pageInfo = new PageInfo<>(page);
        return pageInfo;
    }

    /**
     * 通过大分类id查询,该大分类下对应的小分类
     * @param bigp
     * @return
     */
    @RequestMapping("/SelectTypeById")
    public ResultInfo SelectTypeById(int bigp){

        try {
            BigplusType bigplusType=homeGoodsService.SelectTypeById(bigp);
            return new ResultInfo(true,bigplusType,"成功");
        } catch (Exception e) {
            e.printStackTrace();
            return new ResultInfo(false,null,"失败");
        }
    }

    /**
     * 通过商品的id查询该商品的详细信息
     * @param goods_id
     * @return
     */

    @RequestMapping("/homeGetGoodsInfoById")
    public ResultInfo homeGetGoodsInfoById(int goods_id){
        try {
            Goods goods = homeGoodsService.homeGetGoodsInfoById(goods_id);
            return new ResultInfo(true,goods,"查询商品详细信息成功");
        } catch (Exception e) {
            e.printStackTrace();
            return new ResultInfo(false,null,"查询商品详细信息失败!");
        }

    }
    //商品推荐
    @RequestMapping("/GoodsSaleList")
    public ResultInfo GoodsSaleList(Integer gId){
       List<Goods> list= homeGoodsService.GoodsSaleList(gId);
        return new ResultInfo(true,list,null);
    }
}

5. Display of related works

Practical projects based on Java development, Python development, PHP development, C# development and other related language development

Front-end practical projects developed based on Nodejs, Vue and other front-end technologies

Related works based on WeChat applet and Android APP application development

Development and application of embedded IoT based on 51 single-chip microcomputer

AI intelligent application based on various algorithms

Various data management and recommendation systems based on big data

 

 

Guess you like

Origin blog.csdn.net/whirlwind526/article/details/131673239