——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明





基于javaweb的SpringBoot网上电商项目(前后端分离+java+vue+springboot+ssm+mysql+maven+redis)
一、项目简述
本系统功能包括: 一款基于Springboot+Vue的电商项目,前后端分离项目,前台后台都有,前台商品展示购买,购物车分类,订 单查询等等,后台商品管理,订单管理,信息维护,用户管理等等。
二、项目运行
环境配置: Jdk1.8 + Mysql + HBuilderX (Webstorm也 行)+ Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts都支 持)。
项目技术: Springboot + Maven + Mybatis + Vue + Redis, B/S 模式+ Maven等等,附带支付宝沙箱环境以及支付环节代码。
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
@CrossOrigin @RestController public class OverViewController { final OrderService orderService; final ProductService productService; final ReturnGoodsService returnGoodsService; public OverViewController(OrderService orderService,ProductService productService,ReturnGoodsService returnGoodsService) { this.orderService = orderService; this.productService = productService; this.returnGoodsService = returnGoodsService; }
@RequestMapping(value = "/view/dataInfo") private CommonResult dataInfo() { Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> productMap = productService.productOverview(); Map<String, Object> orderMap = orderService.orderOverview(); Map<String, Object> returnGoodsMap = returnGoodsService.returnGoodsOverview(); if(productMap!=null){ resultMap.putAll(productMap); } if(orderMap!=null){ resultMap.putAll(orderMap); } if(returnGoodsMap!=null){ resultMap.putAll(returnGoodsMap); } if(resultMap.size()!=0){ return CommonResult.success("查询成功",resultMap); }else{ return CommonResult.error("查询失败"); } }
@RequestMapping(value = "/view/orderChartDATE") private CommonResult orderChartDATE(String startTime,String endTime) { Map<String, Object> data = new HashMap<>(); List<Map<String, Object>> lineData = orderService.selectChartDATE(startTime,endTime); List<Map<String, Object>> ringData = orderService.selectProductTypeChart(startTime, endTime);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| @RequestMapping(value = "/vip/addVip") private CommonResult addVip(Vip vip) { Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.YEAR, 1); vip.setOverdueTime(cal.getTime()); if(vipService.insertData(vip)){ return CommonResult.success("vip信息插入成功",vip); }else{ return CommonResult.error("vip信息插入失败"); } }
@RequestMapping(value = "/vip/updateVip") private CommonResult updateVip(Vip vip) { if(vipService.updateById(vip)){ return CommonResult.success("vip信息更新成功",vip); }else{ return CommonResult.error("vip信息更新失败"); } }
@RequestMapping(value = "/vip/deleteVip") private CommonResult deleteVip(Integer vipId) { if(vipService.deleteById(vipId)){ return CommonResult.success("删除成功",vipId); }else{ return CommonResult.error("删除失败"); } } } package com.qiu.controller;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| } }
@RequestMapping(value = "/role/add") private CommonResult add(Role role) { if(role!=null){ if(roleService.insertData(role)){ return CommonResult.success("添加成功",role); }else{ return CommonResult.error("添加失败"); } } return CommonResult.error("用户数据不存在"); }
@RequestMapping(value = "/role/update") private CommonResult update(Role role) { System.out.println(role); if(roleService.updateById(role)){ return CommonResult.success("更新成功",role); }else{ return CommonResult.error("更新失败"); } }
@RequestMapping(value = "/role/delete") private CommonResult delete(Integer roleId) { if(roleService.deleteById(roleId)){ return CommonResult.success("删除成功",roleId); }else{ return CommonResult.error("删除失败"); } } } package com.qiu.controller;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| Boolean isExist = productService.existsProductBrand(productBrand); if(isExist!=null){ return CommonResult.success("查询成功",isExist); }else{ return CommonResult.error("查询失败"); } } @RequestMapping(value = "/product/findAll") private CommonResult findAll() { List<Product> products = productService.selectAll(); if(products!=null){ return CommonResult.success("全部商品信息查询成功",products); }else{ return CommonResult.error("全部商品信息查询失败"); } } @RequestMapping(value = "/product/findAllSale") private CommonResult findAllSale() { List<Product> products = productService.selectAllSale(); if(products!=null){ return CommonResult.success("全部商品信息查询成功",products); }else{ return CommonResult.error("全部商品信息查询失败"); } } @RequestMapping(value = "/product/findAllLikeName") private CommonResult findAllLikeName(String keyWord) { List<Product> products = productService.selectAllLikeName(keyWord); if(products!=null){ return CommonResult.success("全部商品信息查询成功",products); }else{ return CommonResult.error("全部商品信息查询失败"); } } @RequestMapping(value = "/product/findAllLikeType") private CommonResult findAllLikeType(String keyWord) { List<Product> products = productService.selectAllLikeType(keyWord); if(products!=null){ return CommonResult.success("全部商品信息查询成功",products); }else{ return CommonResult.error("全部商品信息查询失败"); } } @RequestMapping(value = "/product/findAllLikeBrand") private CommonResult findAllLikeBrand(String keyWord) { List<Product> products = productService.selectAllLikeBrand(keyWord); if(products!=null){ return CommonResult.success("全部商品信息查询成功",products); }else{ return CommonResult.error("全部商品信息查询失败");
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
@RestController @CrossOrigin public class ProductController { final ProductTypeService productTypeService; final ProductBrandService productBrandService; final ProductService productService; public ProductController(ProductService productService, ProductTypeService productTypeService,ProductBrandService productBrandService) { this.productTypeService = productTypeService; this.productBrandService = productBrandService; this.productService = productService; }
@RequestMapping(value = "/product/findById") private CommonResult findById(Integer productId) { Product product = productService.selectById(productId); if(product!=null){ return CommonResult.success("商品查询成功",product); }else{ return CommonResult.error("商品查询失败"); } } @RequestMapping(value = "/product/findByKey") private CommonResult findByKey(String productNo) { Product product = productService.selectByKey(productNo); if(product!=null){ return CommonResult.success("商品查询成功",product); }else{ return CommonResult.error("商品查询失败"); } } @RequestMapping(value = "/product/findIdByKey") private CommonResult findIdByKey(String productNo) { Integer productId = productService.selectIdByKey(productNo); if(productId!=null){ return CommonResult.success("商品id查询成功",productId); }else{ return CommonResult.error("商品id查询失败"); } }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=221222062008200wu
https://javayms.pages.dev?id=221222062008200wu