基于javaweb+mysql的springboot汽车商城管理系统(java+springboot+vue+maven+mysql)
运行环境
Java≥8、MySQL≥5.7、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SpringBoot汽车商城管理系统(java+springboot+vue+maven+mysql)
项目介绍
本项目基于spring boot以及Vue开发,为前后端分离的项目。针对汽车销售提供客户信息、车辆信息、订单信息、销售人员管理、财务报表等功能,提供经理和销售两种角色进行管理。
经理角色主要功能为: 首页、销售管理(新订单、销售订单、订单详情)、客户管理(添加客户、客户信息)、库存管理(添加库存、车辆库存)、财务报表(员工报表、销量报表、个人月报表)、员工管理(添加员工、员工信息)
销售角色主要功能为: 首页、销售管理(新订单、销售订单、订单详情)、客户管理(添加客户、客户信息)、库存管理(车辆库存)、个人月报表、我的信息
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 5.7版本; 5.是否Maven项目:是;
技术栈
SpringBoot+VUE+Mysql
后端项目:
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行后端项目,后端项目运行成功后,需要再运行前端项目
前端项目:
- 安装好node环境 2. 在front目录下运行 npm install 安装所需要的包 3. 在front目录下运行 npm run dev 4. 运行成功后,在浏览器中访问localhost:9527,登录账号即可
public ServerResponse logout(HttpSession session) {
session.removeAttribute(Const.CURRENT_USER);
return ServerResponse.createBySuccess();
}
@RequestMapping(value = "info", method = RequestMethod.POST)
public ServerResponse<Employee> info(HttpSession session) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
if (employee == null) {
return ServerResponse.createByErrorMessage("用户未登录,无法获取当前用户信息");
}
return ServerResponse.createBySuccess(employee);
}
@RequestMapping(value = "updateMessage", method = RequestMethod.POST)
public ServerResponse updateMessage(Employee employee) {
return employeeService.updateEmployee(employee);
}
@RequestMapping(value = "validPassword", method = RequestMethod.POST)
public ServerResponse validPassword(HttpSession session, String validPass) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
return employeeService.validPassword(employee.getId(), validPass);
}
@RequestMapping(value = "updatePassword", method = RequestMethod.POST)
public ServerResponse updatePassword(HttpSession session, String oldPass, String newPass) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
return employeeService.updatePassword(employee.getId(), oldPass, newPass);
}
}
/**
*/
@RestController
@RequestMapping("chart")
@Slf4j
@RestController
@RequestMapping("user")
public class UserController {
@Autowired
private IUserService userService;
@Autowired
private IEmployeeService employeeService;
@RequestMapping(value = "login", method = RequestMethod.POST)
public ServerResponse login( String employeeId, String password, HttpSession session) {
ServerResponse response = userService.login(Integer.valueOf(employeeId), password);
if (response.isSuccess()) {
session.setAttribute(Const.CURRENT_USER, response.getData());
Map<String, String> map = new HashMap <>(1);
map.put("token", session.getId());
response = ServerResponse.createBySuccess(map);
}
log.info("userId:{}, password:{}, data:{}", employeeId, password, response.getData());
return response;
}
@RequestMapping(value = "logout", method = RequestMethod.GET)
public ServerResponse logout(HttpSession session) {
session.removeAttribute(Const.CURRENT_USER);
return ServerResponse.createBySuccess();
}
@RequestMapping(value = "info", method = RequestMethod.POST)
public ServerResponse<Employee> info(HttpSession session) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
if (employee == null) {
return ServerResponse.createByErrorMessage("用户未登录,无法获取当前用户信息");
}
return ServerResponse.createBySuccess(employee);
}
@RequestMapping(value = "updateMessage", method = RequestMethod.POST)
public ServerResponse updateMessage(Employee employee) {
return employeeService.updateEmployee(employee);
}
@RequestMapping(value = "validPassword", method = RequestMethod.POST)
public ServerResponse validPassword(HttpSession session, String validPass) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
return employeeService.validPassword(employee.getId(), validPass);
}
@RequestMapping(value = "updatePassword", method = RequestMethod.POST)
public ServerResponse updatePassword(HttpSession session, String oldPass, String newPass) {
/**
*/
@Slf4j
@RestController
@RequestMapping("user")
public class UserController {
@Autowired
private IUserService userService;
@Autowired
private IEmployeeService employeeService;
@RequestMapping(value = "login", method = RequestMethod.POST)
public ServerResponse login( String employeeId, String password, HttpSession session) {
ServerResponse response = userService.login(Integer.valueOf(employeeId), password);
if (response.isSuccess()) {
session.setAttribute(Const.CURRENT_USER, response.getData());
Map<String, String> map = new HashMap <>(1);
map.put("token", session.getId());
response = ServerResponse.createBySuccess(map);
}
log.info("userId:{}, password:{}, data:{}", employeeId, password, response.getData());
return response;
}
@RequestMapping(value = "logout", method = RequestMethod.GET)
public ServerResponse logout(HttpSession session) {
session.removeAttribute(Const.CURRENT_USER);
return ServerResponse.createBySuccess();
}
@RequestMapping(value = "info", method = RequestMethod.POST)
public ServerResponse<Employee> info(HttpSession session) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
public ServerResponse addSeries(Integer brandId, String seriesName) {
return storeService.addSeries(brandId, seriesName);
}
@RequestMapping(value = "delSeries", method = RequestMethod.GET)
public ServerResponse delSeries(Integer seriesId) {
return storeService.delSeries(seriesId);
}
@RequestMapping(value = "addStore", method = RequestMethod.POST)
public ServerResponse addStore(Car car) {
return storeService.addStore(car);
}
@RequestMapping(value = "getList", method = RequestMethod.GET)
public ServerResponse getList(StoreQuery storeQuery) {
return storeService.getList(storeQuery);
}
@RequestMapping(value = "update", method = RequestMethod.POST)
public ServerResponse update(Car car) {
return storeService.updateStore(car);
}
}
/**
* 获取brand和series信息
*/
@RestController
@RequestMapping("init")
public class InitController {
@Autowired
private IInitService initService;
@RequestMapping(value = "seriesOpt", method = RequestMethod.GET)
public ServerResponse seriesOpt() {
return initService.seriesOpt();
}
* @return
*/
@RequestMapping(value = "getIndexSales", method = RequestMethod.GET)
public ServerResponse getIndexSales(Integer id) {
return chartService.getIndexSales(id);
}
@RequestMapping(value = "getEmpSalesChart", method = RequestMethod.GET)
public ServerResponse getEmpSalesChart(Integer id, String date) {
return chartService.getEmpSalesChart(id, date);
}
}
/**
*/
@RestController
@RequestMapping("order")
public class OrderController {
@Autowired
private IOrderService orderService;
@RequestMapping(value = "addOrder", method = RequestMethod.POST)
public ServerResponse addOrder(@RequestBody OrderVo orderVo) {
return orderService.addOrder(orderVo);
}
@RequestMapping(value = "getList", method = RequestMethod.GET)
public ServerResponse getList(OrderQuery orderQuery) {
return orderService.getList(orderQuery);
}
/**
* 获取经理主页 昨日销量报表 数据
* @return
*/
@RequestMapping(value = "getIndexChart", method = RequestMethod.GET)
public ServerResponse getIndexChart() {
return chartService.getIndexChart();
}
/**
* 获取经理主页 昨日销量
* @return
*/
@RequestMapping(value = "getSaleNum", method = RequestMethod.GET)
public ServerResponse getSaleNum() {
return chartService.getSaleNum();
}
/**
* 获取 销售报表 数据
* @param start
* @param end
* @return
*/
@RequestMapping(value = "getSalesChart", method = RequestMethod.GET)
public ServerResponse getSalesChart(String start, String end) {
return chartService.getSalesChart(start, end);
}
/**
* 获取员工主页 本月销售额 数据
* @param id
* @return
*/
@RequestMapping(value = "getIndexSales", method = RequestMethod.GET)
public ServerResponse getIndexSales(Integer id) {
return chartService.getIndexSales(id);
}
@RequestMapping(value = "getEmpSalesChart", method = RequestMethod.GET)
public ServerResponse getEmpSalesChart(Integer id, String date) {
return chartService.getEmpSalesChart(id, date);
}
}
session.removeAttribute(Const.CURRENT_USER);
return ServerResponse.createBySuccess();
}
@RequestMapping(value = "info", method = RequestMethod.POST)
public ServerResponse<Employee> info(HttpSession session) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
if (employee == null) {
return ServerResponse.createByErrorMessage("用户未登录,无法获取当前用户信息");
}
return ServerResponse.createBySuccess(employee);
}
@RequestMapping(value = "updateMessage", method = RequestMethod.POST)
public ServerResponse updateMessage(Employee employee) {
return employeeService.updateEmployee(employee);
}
@RequestMapping(value = "validPassword", method = RequestMethod.POST)
public ServerResponse validPassword(HttpSession session, String validPass) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
return employeeService.validPassword(employee.getId(), validPass);
}
@RequestMapping(value = "updatePassword", method = RequestMethod.POST)
public ServerResponse updatePassword(HttpSession session, String oldPass, String newPass) {
Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);
return employeeService.updatePassword(employee.getId(), oldPass, newPass);
}
}
}
@RequestMapping(value = "addStore", method = RequestMethod.POST)
public ServerResponse addStore(Car car) {
return storeService.addStore(car);
}
@RequestMapping(value = "getList", method = RequestMethod.GET)
public ServerResponse getList(StoreQuery storeQuery) {
return storeService.getList(storeQuery);
}
@RequestMapping(value = "update", method = RequestMethod.POST)
public ServerResponse update(Car car) {
return storeService.updateStore(car);
}
}
/**
* 获取brand和series信息
*/
@RestController
@RequestMapping("init")
public class InitController {
@Autowired
private IInitService initService;
@RequestMapping(value = "seriesOpt", method = RequestMethod.GET)
public ServerResponse seriesOpt() {
return initService.seriesOpt();
}
@RequestMapping(value = "brandOpt", method = RequestMethod.GET)
public ServerResponse brandOpt() {
/**
* 获取brand和series信息
*/
@RestController
@RequestMapping("init")
public class InitController {
@Autowired
private IInitService initService;
@RequestMapping(value = "seriesOpt", method = RequestMethod.GET)
public ServerResponse seriesOpt() {
return initService.seriesOpt();
}
@RequestMapping(value = "brandOpt", method = RequestMethod.GET)
public ServerResponse brandOpt() {
return initService.brandOpt();
}
@RequestMapping(value = "storeOpt", method = RequestMethod.GET)
public ServerResponse storeOpt(Integer seriesId) {
return initService.storeOpt(seriesId);
}
@RequestMapping(value = "getCustomer", method = RequestMethod.GET)
public ServerResponse getCustomer(String idCard) {
return initService.getCustomer(idCard);
}
}
/**
*/
@Slf4j
@RestController
@RequestMapping("customer")
public class CustomerController {
@Autowired
private ICustomerService customerService;
@RequestMapping(value = "addCustomer", method = RequestMethod.GET)
public ServerResponse addCustomer(Customer customer) {
return customerService.addCustomer(customer);
}
@RequestMapping(value = "getList", method = RequestMethod.GET)
public ServerResponse getList(CustomerQuery customerQuery) {
return customerService.getList(customerQuery);
}
@RequestMapping(value = "update", method = RequestMethod.POST)
public ServerResponse update(Customer customer) {
return customerService.updateCustomer(customer);
}
}
/**
*/
@RestController
@RequestMapping("employee")
public class EmployeeController {
@Autowired
private IEmployeeService employeeService;
* 获取经理主页 昨日销量报表 数据
* @return
*/
@RequestMapping(value = "getIndexChart", method = RequestMethod.GET)
public ServerResponse getIndexChart() {
return chartService.getIndexChart();
}
/**
* 获取经理主页 昨日销量
* @return
*/
@RequestMapping(value = "getSaleNum", method = RequestMethod.GET)
public ServerResponse getSaleNum() {
return chartService.getSaleNum();
}
/**
* 获取 销售报表 数据
* @param start
* @param end
* @return
*/
@RequestMapping(value = "getSalesChart", method = RequestMethod.GET)
public ServerResponse getSalesChart(String start, String end) {
return chartService.getSalesChart(start, end);
}
/**
* 获取员工主页 本月销售额 数据
* @param id
* @return
*/
@RequestMapping(value = "getIndexSales", method = RequestMethod.GET)
public ServerResponse getIndexSales(Integer id) {
return chartService.getIndexSales(id);
}
@RequestMapping(value = "getEmpSalesChart", method = RequestMethod.GET)
public ServerResponse getEmpSalesChart(Integer id, String date) {
return chartService.getEmpSalesChart(id, date);
}
}
}
}
/**
*/
@Slf4j
@RestController
@RequestMapping("store")
public class StoreController {
@Autowired
private IStoreService storeService;
@RequestMapping(value = "addBrand", method = RequestMethod.GET)
public ServerResponse addBrand(String brand) {
return storeService.addBrand(brand);
}
@RequestMapping(value = "delBrand", method = RequestMethod.GET)
public ServerResponse delBrand(Integer brandId) {
return storeService.delBrand(brandId);
}
@RequestMapping(value = "addSeries", method = RequestMethod.GET)
public ServerResponse addSeries(Integer brandId, String seriesName) {
return storeService.addSeries(brandId, seriesName);
}
@RequestMapping(value = "delSeries", method = RequestMethod.GET)
public ServerResponse delSeries(Integer seriesId) {
return storeService.delSeries(seriesId);
}
@RequestMapping(value = "addStore", method = RequestMethod.POST)
public ServerResponse addStore(Car car) {
return storeService.addStore(car);
* @return
*/
@RequestMapping(value = "getSalesChart", method = RequestMethod.GET)
public ServerResponse getSalesChart(String start, String end) {
return chartService.getSalesChart(start, end);
}
/**
* 获取员工主页 本月销售额 数据
* @param id
* @return
*/
@RequestMapping(value = "getIndexSales", method = RequestMethod.GET)
public ServerResponse getIndexSales(Integer id) {
return chartService.getIndexSales(id);
}
@RequestMapping(value = "getEmpSalesChart", method = RequestMethod.GET)
public ServerResponse getEmpSalesChart(Integer id, String date) {
return chartService.getEmpSalesChart(id, date);
}
}
/**
*/
@RestController
@RequestMapping("order")
public class OrderController {
/**
*/
@RestController
@RequestMapping("order")
public class OrderController {
@Autowired
private IOrderService orderService;
@RequestMapping(value = "addOrder", method = RequestMethod.POST)
public ServerResponse addOrder(@RequestBody OrderVo orderVo) {
return orderService.addOrder(orderVo);
}
@RequestMapping(value = "getList", method = RequestMethod.GET)
public ServerResponse getList(OrderQuery orderQuery) {
return orderService.getList(orderQuery);
}
@RequestMapping(value = "update", method = RequestMethod.POST)
public ServerResponse update(Long orderId, String status) {
return orderService.update(orderId, status);
}
@RequestMapping(value = "updateDetail", method = RequestMethod.POST)
public ServerResponse updateDetail(OrderDetails orderDetails) {
return orderService.updateDetail(orderDetails);
}
@RequestMapping(value = "deleteDetail", method = RequestMethod.POST)
public ServerResponse deleteDetail(String id) {
return orderService.deleteDetail(id);
}
@RequestMapping(value = "getIndexChart", method = RequestMethod.GET)
public ServerResponse getIndexChart() {
return chartService.getIndexChart();
}
/**
* 获取经理主页 昨日销量
* @return
*/
@RequestMapping(value = "getSaleNum", method = RequestMethod.GET)
public ServerResponse getSaleNum() {
return chartService.getSaleNum();
}
/**
* 获取 销售报表 数据
* @param start
* @param end
* @return
*/
@RequestMapping(value = "getSalesChart", method = RequestMethod.GET)
public ServerResponse getSalesChart(String start, String end) {
return chartService.getSalesChart(start, end);
}
/**
* 获取员工主页 本月销售额 数据
* @param id
* @return
*/
@RequestMapping(value = "getIndexSales", method = RequestMethod.GET)
public ServerResponse getIndexSales(Integer id) {
return chartService.getIndexSales(id);
}
@RequestMapping(value = "getEmpSalesChart", method = RequestMethod.GET)
public ServerResponse getEmpSalesChart(Integer id, String date) {
return chartService.getEmpSalesChart(id, date);
}
}
@RequestMapping(value = "seriesOpt", method = RequestMethod.GET)
public ServerResponse seriesOpt() {
return initService.seriesOpt();
}
@RequestMapping(value = "brandOpt", method = RequestMethod.GET)
public ServerResponse brandOpt() {
return initService.brandOpt();
}
@RequestMapping(value = "storeOpt", method = RequestMethod.GET)
public ServerResponse storeOpt(Integer seriesId) {
return initService.storeOpt(seriesId);
}
@RequestMapping(value = "getCustomer", method = RequestMethod.GET)
public ServerResponse getCustomer(String idCard) {
return initService.getCustomer(idCard);
}
}
/**
*/
@Slf4j
@RestController
@RequestMapping("customer")
public class CustomerController {
@Autowired
private ICustomerService customerService;
@RequestMapping(value = "addCustomer", method = RequestMethod.GET)
public ServerResponse addCustomer(Customer customer) {
return customerService.addCustomer(customer);
}
@RequestMapping(value = "getList", method = RequestMethod.GET)
public ServerResponse getList(CustomerQuery customerQuery) {
return customerService.getList(customerQuery);
}
}
@RequestMapping(value = "delBrand", method = RequestMethod.GET)
public ServerResponse delBrand(Integer brandId) {
return storeService.delBrand(brandId);
}
@RequestMapping(value = "addSeries", method = RequestMethod.GET)
public ServerResponse addSeries(Integer brandId, String seriesName) {
return storeService.addSeries(brandId, seriesName);
}
@RequestMapping(value = "delSeries", method = RequestMethod.GET)
public ServerResponse delSeries(Integer seriesId) {
return storeService.delSeries(seriesId);
}
@RequestMapping(value = "addStore", method = RequestMethod.POST)
public ServerResponse addStore(Car car) {
return storeService.addStore(car);
}
@RequestMapping(value = "getList", method = RequestMethod.GET)
public ServerResponse getList(StoreQuery storeQuery) {
return storeService.getList(storeQuery);
}
@RequestMapping(value = "update", method = RequestMethod.POST)
public ServerResponse update(Car car) {
return storeService.updateStore(car);
}
}
/**
* 获取brand和series信息
*/
@RestController
@RequestMapping("init")
public class InitController {