Computer graduation project campus second-hand trading platform Vue+SpringBoot+MySQL

Author's homepage : Designer Xiao Zheng
Author's brief introduction : A Java full-stack software engineer from Ningbo, Zhejiang, responsible for the development and management of the company's OA projects, focusing on front-end and back-end software development, system customization, and remote technical guidance. CSDN Academy, Blue Bridge Cloud Course certified instructor, high-quality creator in the full stack field.

Insert image description here

project content
project name Campus second-hand trading platform (S 009) \color{red}{Campus second-hand trading platform (S009)}Campus second-hand trading platform ( S 009 )
project type paid items
Source code acquisition Source code self-service acquisition
Deployment version Can be run locally without source code
Exchange Q&A post You can communicate and discuss this project in the post bar
Project screen recording You can view a dynamic demo of this project
Value-added services [ documentation, deployment, explanation\color{red}{documentation, deployment, explanation}Documentation, Deployment, Explanation ] "Service Standards for Paid Projects"


1. Abstract

With the development of national productivity, more and more goods are produced, exceeding people's actual consumption, so a large number of idle goods are produced. Some of these idle goods are abandoned, and some are used by others through second-hand platforms. In order to prevent unnecessary waste, this second-hand trading system for campuses was developed to help users resell idle second-hand goods efficiently.

The campus second-hand trading system has been coded and implemented using Idea development tools. The front-end uses Vue.js, the View UI component library is used to beautify the interface, and the back-end uses the SpringBoot framework. In terms of operating systems, development languages, servers, databases, and connection technologies, the Window operating system, Java language, Tomcat server, MySql database, and MyBatis technology are used to complete system construction. The system is based on B/S architecture, adopts front-end and back-end separation architecture, and is divided into web front-end and management back-end, allowing users to publish and purchase second-hand products on the system, leave messages, and get the latest product consultation.

  • Frontend : Vue 2.7.10

  • Backend : Spring Boot 3.1.10

  • Database : MySQL 8.0.31


2. Function module

The functional requirements of the campus second-hand trading platform mainly include six modules: data center module, second-hand product archive module, product reservation module, product reservation module, product message board module, and product information module. It is a web management backend based on browser operation. Each module is described in detail below:

2.1 Data Center Module

The data center module includes the basic system configuration of the campus second-hand trading platform, such as the management of logged-in users, the management of the second-hand platform organizational structure, the management of user menu permissions, the management of system logs, and the management of public file cloud disks.

Among them, the logged-in user management module is operated and maintained by the second-hand platform administrator. The administrator can add, delete, modify, and query logged-in users.

The second-hand organizational structure refers to the organizational structure of the second-hand platform management operating company. This module is suitable for managing the department levels of these organizational structures and the departmental affiliations of employees.

The user menu permission management module is used to manage the specific menu permissions of users with different permissions.

System log management is used to maintain records of users logging into the system to facilitate locating and tracking user operations.

The public cloud disk management module is used to uniformly maintain images in the campus second-hand trading platform, such as photos of second-hand goods, insurance policies, three-party agreements, etc.

Insert image description here

2.2 Second-hand product file management module

The second-hand product archive module maintains the second-hand product data published in the campus second-hand trading platform. Administrators can add, delete, modify, and query the second-hand product data.

2.3 Product reservation management module

Product reservation refers to the buyer having preliminary intention and applying for offline viewing. Registered users can initiate an appointment application in the second-hand product file module. After receiving the appointment application, the seller will proactively contact the buyer for follow-up appointment matters.

Insert image description here

2.4 Product reservation management module

Product reservation refers to the buyer's decision to purchase the selected product. Buyers can select their favorite second-hand products for reservation in the second-hand product file, enter the ideal price and optional remarks, and the seller can receive the transaction order. The seller has the right to agree or reject the buyer's reservation request. If agreed, a commodity transaction order will be generated to confirm the transaction.

Insert image description here

2.5 Product message board management module

In the process of buying and selling second-hand goods, there will inevitably be some inquiries and disputes, so the campus second-hand trading platform has specially designed a product message board module to resolve disputes between buyers and sellers, and buyers and second-hand platforms. Either party can leave a message on the message board or
reply to a message that has been left.

Insert image description here

2.6 Product information management module

The product information management module is used on the campus second-hand trading platform to publish some product news, as well as anti-fraud tweets and other system registered users can read these news information.

Insert image description here


3. Entity design

3.1 User table

The core of the data center module is the user. The user's information includes mobile phone number, address, email, ID card, gender and other data.

Insert image description here

Insert image description here

3.2 Second-hand product list

The second-hand product archive module manages the data of second-hand products in the system. The data of second-hand products includes product ID, product brand, third-party inspection, product photos, price, seller name, seller mobile phone, and remarks.

Insert image description here

Insert image description here

3.3 Product reservation form

The product reservation module is used for buyers to make offline reservations for products. The product reservation module should include product ID, product brand, product photo, seller name, seller mobile phone, reservation time, reservation location, and remarks.

Insert image description here

Insert image description here

3.4 Product reservation form

The product reservation module mainly records and stores students' order information, such as product ID, product brand, product photos, seller's name, seller's mobile phone, order time, agreed price, and remarks.

Insert image description here

Insert image description here

3.5 Message form

The product message board is used to resolve disputes between buyers and sellers, buyers and second-hand platforms, including message content, message person, message time, whether to reply, reply person, reply time, reply content, and remarks. Any party can post a message in the message board Leave a message, or reply to a message that has been left.

Insert image description here

Insert image description here

3.6 Information table

The product information management module is used for second-hand platforms to publish some product news and anti-fraud tweets. Registered users of the system can read these news information, including publisher ID, publisher, published content, pictures, attachments, publishing time, and sorting value. ,Post status.

Insert image description here

Insert image description here

4. Interface display

4.1 System display

This system is used by campus second-hand trading website staff and registered buyers. First, the staff of the campus second-hand trading website can configure the data center module, publish and delete second-hand product information, and query student reservation and booking information.

For registered buyers, you can check the second-hand product files released by the administrator and make reservations and reservations according to your needs.
Insert image description here

The second-hand product archive module maintains the second-hand product data published on the campus second-hand trading website. Administrators can add, delete, modify, and query the second-hand product data.
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here

4.2 Supporting document display

Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here


5. Core code

5.1 User web login

@RequestMapping(value = "/loginOnWeb", method = RequestMethod.GET)
@ApiOperation(value = "网站前台登陆")
public Result<String> loginOnWeb(@RequestParam String userName, @RequestParam String password){
    
    
    QueryWrapper<User> qw = new QueryWrapper<>();
    qw.eq("username",userName);
    List<User> userList = iUserService.list(qw);
    if(userList.size() < 1) {
    
    
        return ResultUtil.error("用户不存在");
    }
    User user = userList.get(0);
    if(!new BCryptPasswordEncoder().matches(password, user.getPassword())){
    
    
        return ResultUtil.error("密码不正确");
    }
    String accessToken = securityUtil.getToken(user.getUsername(), true);
    UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(new SecurityUserDetails(user), null, null);
    SecurityContextHolder.getContext().setAuthentication(authentication);
    return new ResultUtil<String>().setData(accessToken);
}

5.2 User web page registration

@RequestMapping(value = "/reOnWeb", method = RequestMethod.GET)
@ApiOperation(value = "网站前台注册")
public Result<String> reOnWeb(@RequestParam String userName,@RequestParam String mobile,@RequestParam String password){
    
    
    QueryWrapper<User> qw = new QueryWrapper<>();
    qw.eq("username",userName);
    qw.and(wrapper -> wrapper.eq("username", userName).or().eq("mobile",mobile));
    Long userCount = iUserService.count(qw);
    if(userCount > 0) {
    
    
        return ResultUtil.error("用户已存在");
    }
    User u = new User();
    u.setUsername(userName);
    u.setNickname(userName);
    u.setMobile(mobile);
    u.setEmail(u.getMobile() + "@qq.com");
    String encryptPass = new BCryptPasswordEncoder().encode(password);
    u.setPassword(encryptPass).setType(0);
    iUserService.saveOrUpdate(u);
    QueryWrapper<Role> roleQw = new QueryWrapper<>();
    roleQw.eq("default_role",true);
    List<Role> roleList = iRoleService.list(roleQw);
    if(roleList.size() > 0){
    
    
        for(Role role : roleList) {
    
    
            iUserRoleService.saveOrUpdate(new UserRole().setUserId(u.getId()).setRoleId(role.getId()));
        }
    }
    String accessToken = securityUtil.getToken(u.getUsername(), true);
    UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(new SecurityUserDetails(u), null, null);
    SecurityContextHolder.getContext().setAuthentication(authentication);
    return new ResultUtil<String>().setData(accessToken);
}

5.3 Add new product reservation

@RequestMapping(value = "/addOrder", method = RequestMethod.GET)
@ApiOperation(value = "新增单条二手商品预定单")
public Result<Object> addOrder(@RequestParam String carId){
    
    
    UsedCar usedCar = iUsedCarService.getById(carId);
    if(usedCar == null) {
    
    
        return ResultUtil.error("二手商品不存在");
    }
    User currUser = securityUtil.getCurrUser();
    QueryWrapper<CarOrder> qw = new QueryWrapper<>();
    qw.eq("car_id",carId);
    qw.eq("buy_id",currUser.getId());
    if(iCarOrderService.count(qw) > 0L) {
    
    
        return ResultUtil.error("您已预定,无需重复预定");
    }
    CarOrder carOrder = new CarOrder();
    carOrder.setCarId(carId);
    carOrder.setBrand(usedCar.getBrand());
    carOrder.setSellerMoney(usedCar.getMoney());
    carOrder.setImageUrl(usedCar.getImageUrl());
    carOrder.setSellerId(usedCar.getSellId());
    carOrder.setSellerName(usedCar.getSellName());
    carOrder.setSellerMobile(usedCar.getSellMobile());
    carOrder.setBuyId(currUser.getId());
    carOrder.setBuyName(currUser.getNickname());
    carOrder.setOrderTime(DateUtil.now());
    carOrder.setContractFlag(false);
    carOrder.setContractTime("");
    iCarOrderService.saveOrUpdate(carOrder);
    return ResultUtil.success();
}

5.4 Product review

@RequestMapping(value = "/doAudit", method = RequestMethod.POST)
@ApiOperation(value = "审核")
public Result<Object> doAudit(@RequestParam String id){
    
    
    CarOrder carOrder = iCarOrderService.getById(id);
    if(carOrder == null) {
    
    
        return ResultUtil.error("订单不存在");
    }
    carOrder.setAuditFlag(true);
    iCarOrderService.saveOrUpdate(carOrder);
    return ResultUtil.success();
}

5.5 Query messages

@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "查询留言")
public Result<IPage<MessageBoard>> getByPage(@ModelAttribute MessageBoard board,@ModelAttribute PageVo page){
    
    
    QueryWrapper<MessageBoard> qw = new QueryWrapper<>();
    if(!ZwzNullUtils.isNull(board.getDate())) {
    
    
        qw.eq("date",board.getDate());
    }
    if(ZwzNullUtils.isNull(board.getReplyId())) {
    
    
        qw.eq("reply_id","");
    } else {
    
    
        qw.eq("reply_id",board.getReplyId());
    }
    return new ResultUtil<IPage<MessageBoard>>().setData(iMessageBoardService.page(PageUtil.initMpPage(page),qw));
}

6. Disclaimer

  • This project is for personal study only. For commercial authorization, please contact the blogger, otherwise you will be responsible for the consequences.
  • The blogger owns all content ownership and independent intellectual property rights of the application system after the software is built, and has the final right of interpretation.
  • If you have any questions, please leave a message in the warehouse Issue. We will reply as soon as possible after seeing it. Relevant opinions will be considered as appropriate, but there is no promise or guarantee that they will be adopted.

Users who download the code of this system or use this system must agree to the following content, otherwise please do not download!

  1. You use/develop this software voluntarily, understand the risks of using this software, and agree to bear the risks of using this software.
  2. Any information content of the website built using this software and any resulting copyright disputes, legal disputes and consequences have nothing to do with the blogger, and the blogger does not bear any responsibility for this.
  3. Under no circumstances will the blogger be liable for any loss that is difficult to reasonably predict (including but not limited to loss of commercial profits, business interruption, and loss of business information) resulting from the use or inability to use this software.
  4. You must understand the risks of using this software. The blogger does not promise to provide one-on-one technical support or use guarantee, nor does it assume any responsibility for unforeseen problems caused by this software.

Insert image description here

Guess you like

Origin blog.csdn.net/qq_41464123/article/details/132647673