基于javaweb和mysql的springboot在线拍卖系统(java+springboot+mybaits+vue+elementui+mysql)
私信源码获取及调试交流
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot在线拍卖系统(java+springboot+mybaits+vue+elementui+mysql)
项目介绍
基于SpringBoot+vue的在线拍卖系统
本系统分为前后台,包含管理员、用户两种角色,前台为普通用户登录,后台为管理员登录。
普通用户:首页、拍卖商品、竞拍公告、留言反馈、个人中心等。
管理员:用户管理、商品类型管理、拍卖商品管理、历史竞拍管理、竞拍订单管理、留言板管理、系统管理。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:Vue + elementui
使用说明
项目运行:
-
使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
-
使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
-
将项目中application.yml配置文件中的数据库配置改为自己的配置;
-
运行项目,在浏览器中输入地址:
前台地址:
http://localhost:8080/springbootp0eo6/front/index.html
用户:001 密码:001
后台地址:
http://localhost:8080/springbootp0eo6/admin/dist/index.html#/login
管理员 abo 密码 abo
用户:001 密码:001
注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。
文档介绍:
留言介绍界面:
竞拍公告界面:
公告信息展示页面:
后台管理页面展示:
商品后台管理页面:
历史竞拍后台管理页面:
用户管理后台管理页面:
商品类型后台管理:
List<Good> userGoods = goodService.getGoodStatusByUserId(userId);
List<Good> goods = goodService.getAllGoods(0, 4);
model.addAttribute("user", user);
model.addAttribute("userGoods", userGoods);
model.addAttribute("goods", goods);
return "goods/userGood";
@RequestMapping(value = "/goods/userGoodEdit", method = RequestMethod.GET)
public String getUserGoodEdit(ModelMap model,
@RequestParam(value = "goodId", required = false) Integer goodId,
HttpSession session) {
User user = (User) session.getAttribute("user");
@RequestMapping(value = "/goods/publishGood/uploadImage", method = RequestMethod.POST)
public String uploadImage(
HttpSession session,
@RequestParam(value = "goodId", required = false) Integer goodId,
@RequestParam(value = "mainFile", required = false) MultipartFile mainFile,
@RequestParam(value = "file", required = false) MultipartFile[] file)
throws IOException {
User user = (User) session.getAttribute("user");
FileCheck fileCheck = new FileCheck();
RandomString randomString = new RandomString();
String filePath = "/statics/image/goods/" + user.getId() + "/" + goodId;
String pathRoot = fileCheck.checkGoodFolderExist(filePath);
String name;
public String adminLogout(@RequestParam(required = false, defaultValue = "false" )String adminLogout, HttpSession session){
if (adminLogout.equals("true")){
session.removeAttribute("admin");
// adminLogout = "false";
return "redirect:/";
@RequestMapping(value = "/adminPage", method = RequestMethod.GET)
public String getAdminPage(ModelMap model,
HttpSession session){
User admin = (User) session.getAttribute("admin");
if (admin == null){
// 获得文件后缀名称
String imageName = contentType.substring(contentType
.indexOf("/") + 1);
name = fileName + "." + imageName;
System.out.println("name:" + name);
mf.transferTo(new File(pathRoot + name));
Image image = new Image();
image.setGoodId(goodId);
image.setName(name);
image.setUrl(filePath + "/" + name);
imageService.insertImage(image);
} else {
System.out.println("文件为空!");
private final ImageService imageService;
private final CollectService collectService;
private static String message = "";
@Autowired
public GoodController(GoodService goodService, TypeService typeService,
ReviewService reviewService, UserService userService,
ImageService imageService, CollectService collectService) {
this.goodService = goodService;
this.typeService = typeService;
this.reviewService = reviewService;
this.userService = userService;
reply.setToUserId(toUserId);
reply.setText(replyText);
if (reviewService.insertReply(reply) == 1) {
message = "回复成功!";
return "redirect:/goods/goodInfo?goodId=" + goodId;
} else {
message = "回复失败!";
return "redirect:/goods/goodInfo?goodId=" + goodId;
} else {
Review review = new Review();
review.setGoodId(goodId);
review.setFromUser(fromUser);
private final GoodService goodService;
private final TypeService typeService;
private final OrderService orderService;
@Autowired
public AdminController(UserService userService, GoodService goodService, TypeService typeService, OrderService orderService) {
this.userService = userService;
this.goodService = goodService;
this.typeService = typeService;
this.orderService = orderService;
@RequestMapping(value = "/adminLogin", method = RequestMethod.GET)
public String getAdminLogin(){
private final TypeService typeService;
private final OrderService orderService;
@Autowired
public AdminController(UserService userService, GoodService goodService, TypeService typeService, OrderService orderService) {
this.userService = userService;
this.goodService = goodService;
this.typeService = typeService;
this.orderService = orderService;
@RequestMapping(value = "/adminLogin", method = RequestMethod.GET)
public String getAdminLogin(){
return "admin/adminLogin";
RandomString randomString = new RandomString();
String filePath = "/statics/image/goods/" + user.getId() + "/" + goodId;
String pathRoot = fileCheck.checkGoodFolderExist(filePath);
String name;
if (!mainFile.isEmpty()) {
String fileName = goodId + randomString.getRandomString(10);
String contentType = mainFile.getContentType();
String imageName = contentType
.substring(contentType.indexOf("/") + 1);
name = fileName + "." + imageName;
mainFile.transferTo(new File(pathRoot + name));
String photoUrl = filePath + "/" + name;
goodService.updateGoodPhotoUrl(photoUrl, goodId);
image.setUrl(filePath + "/" + name);
imageService.insertImage(image);
} else {
System.out.println("文件为空!");
return "redirect:/goods/goodInfo?goodId=" + goodId;
@RequestMapping(value = "/goods/userGoods", method = RequestMethod.GET)
public String getUserGoods(ModelMap model,
@RequestParam(value = "userId", required = false) Integer userId) {
User user = userService.getUserById(userId);
List<Good> userGoods = goodService.getGoodStatusByUserId(userId);
List<Good> goods = goodService.getAllGoods(0, 4);
model.addAttribute("user", user);
public ResponseEntity deleteSellerOrderById(@PathVariable Integer orderId,
@PathVariable Integer goodId) {
Boolean su***ess;
su***ess = goodService.updateGoodStatusId(1, goodId) > 0;
if (su***ess) {
su***ess = orderService.deleteOrderById(orderId) > 0;
return ResponseEntity.ok(su***ess);
@RequestMapping(value = "/user/order/update/status/{orderId}&{statusId}", method = RequestMethod.GET)
public ResponseEntity updateOrderStatus(@PathVariable Integer orderId,
@PathVariable Integer statusId) {
Boolean su***ess = orderService.updateStatus(statusId, orderId) > 0;
message = "用户不存在!";
model.addAttribute("message", message);
return "admin/adminLogin";
@RequestMapping(value = "/adminLogout", method = RequestMethod.GET)
public String adminLogout(@RequestParam(required = false, defaultValue = "false" )String adminLogout, HttpSession session){
if (adminLogout.equals("true")){
session.removeAttribute("admin");
// adminLogout = "false";
return "redirect:/";
@RequestMapping(value = "/adminPage", method = RequestMethod.GET)
public String getAdminPage(ModelMap model,
name = fileName + "." + imageName;
System.out.println("name:" + name);
mf.transferTo(new File(pathRoot + name));
Image image = new Image();
image.setGoodId(goodId);
image.setName(name);
image.setUrl(filePath + "/" + name);
imageService.insertImage(image);
} else {
System.out.println("文件为空!");
return "redirect:/goods/goodInfo?goodId=" + goodId;
@RequestMapping(value = "/goods/userGoods", method = RequestMethod.GET)
public String getUserGoods(ModelMap model,
return ResponseEntity.ok(su***ess);
@RequestMapping(value = "/user/sellerOrder/delete/{orderId}&{goodId}", method = RequestMethod.GET)
public ResponseEntity deleteSellerOrderById(@PathVariable Integer orderId,
@PathVariable Integer goodId) {
Boolean su***ess;
su***ess = goodService.updateGoodStatusId(1, goodId) > 0;
if (su***ess) {
su***ess = orderService.deleteOrderById(orderId) > 0;
return ResponseEntity.ok(su***ess);
@RequestMapping(value = "/user/order/update/status/{orderId}&{statusId}", method = RequestMethod.GET)
public ResponseEntity updateOrderStatus(@PathVariable Integer orderId,
@PathVariable Integer statusId) {
Boolean su***ess = orderService.updateStatus(statusId, orderId) > 0;
List<FirstType> firstTypes = typeService.getAllFirstType();
List<Good> goods = goodService.getAllGoods(0, 5);
model.addAttribute("goods", goods);
model.addAttribute("good", good);
model.addAttribute("firstTypes", firstTypes);
return "goods/publishGood";
@RequestMapping(value = "/goods/publishGood", method = RequestMethod.POST)
public String getGoodId(ModelMap model, HttpSession session,
@Valid Good good) {
List<FirstType> firstTypes = typeService.getAllFirstType();
User user = (User) session.getAttribute("user");
List<Good> goods = goodService.getAllGoods(0, 5);
good.setUserId(user.getId());
message = "用户不存在!";
model.addAttribute("message", message);
return "admin/adminLogin";
@RequestMapping(value = "/adminLogout", method = RequestMethod.GET)
public String adminLogout(@RequestParam(required = false, defaultValue = "false" )String adminLogout, HttpSession session){
if (adminLogout.equals("true")){
session.removeAttribute("admin");
// adminLogout = "false";
return "redirect:/";
@RequestMapping(value = "/adminPage", method = RequestMethod.GET)
public String getAdminPage(ModelMap model,
HttpSession session){
sessionUser.getId(), orderId);
model.addAttribute("orderInfo", orderInfo);
model.addAttribute("orders", orders);
System.out.println("sellerInfo.size:" + orders.size());
return "user/sellerInfo";
@RequestMapping(value = "/user/order/delete/{orderId}", method = RequestMethod.GET)
public ResponseEntity deleteOrderById(@PathVariable Integer orderId) {
Boolean su***ess;
su***ess = orderService.deleteOrderById(orderId) > 0;
return ResponseEntity.ok(su***ess);
@RequestMapping(value = "/user/sellerOrder/delete/{orderId}&{goodId}", method = RequestMethod.GET)
public ResponseEntity deleteSellerOrderById(@PathVariable Integer orderId,