基于javaweb+mysql的springboot汽车租赁系统管理系统(java+springboot+vue+elementui+layui+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot汽车租赁系统管理系统(java+springboot+vue+elementui+layui+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+Layui+HTML+CSS+JS
使用说明
项目运行: 1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,控制台提示运行成功后再去运行前端项目; 5. 管理员用户名密码:admin/admin 普通用户名密码:user/123456
try {
if (userService.getUserByName(username).size() == 0) {
jsonMsg.setCode("205");
jsonMsg.setData(0);
} else if (userService.getUserByName(username).size() != 1) {
jsonMsg.setCode("207");
jsonMsg.setData(-2);
else{
int id;
if(!userService.getUserByName(username).get(0).getPassword().equals(password))
jsonMsg.setCode("206");
jsonMsg.setData(-3);
CarOutService outOrderService = new CarOutService();
/**
* Code = "200" 成功存入
* Code = "202" 输入存在问题
* Code = "203" 系统错误
* @param sender_id
* @param carName
* @param stringPrice
* @return
*/
@RequestMapping(value = "/userAddCar", method = RequestMethod.GET)
int status=0;
JsonMsg jsonMsg=new JsonMsg();
UserBean ub=new UserBean();
ub.setUserName(username);
ub.setPassword(password);
ub.setEmail(email);
ub.setDescription(description);
ub.setPic(pic);
try {
ub.setMoney(Integer.parseInt(money));
} catch (Exception e) {
ub.setMoney(Integer.MIN_VALUE);
try {
jsonMsg.setData(1);
} else {
jsonMsg.setCode("202");
jsonMsg.setData(0);
} catch (SQLException e) {
jsonMsg.setCode("404");
jsonMsg.setData(-1);
e.printStackTrace();
return jsonMsg;
/**
* 发送邮件
* Code=200 Data=1发送成功
* @return
*/
@RequestMapping(value = "/userRegister", method = RequestMethod.GET)
@ResponseBody
public JsonMsg addUser(String username, String password, String email) {
JsonMsg jsonMsg = new JsonMsg();
try {
int result =
userService.addUser(username, password, email, null, null, 0);
if (result == 0) {
jsonMsg.setData(0);
jsonMsg.setCode("202");
* @return
*/
@RequestMapping(value = "/userLocate", method = RequestMethod.GET)
@ResponseBody
public JsonMsg getUserByID(int id)
JsonMsg jsonMsg=new JsonMsg();
try {
//admin-->曹威杰:我觉得这里的代码写的有点奇怪。我改了一下
/* List<UserBean> users= userService.getUserById(id);
if(users.size()==0)
/**
* Code:200 Data=userBean 用户信息正确
* Code:205 Data=0 用户不存在
* Code:206 Data=-3 用户密码错误
* Code:207 Data=-2 用户账户被重复
* Code:404 Data=-1 catch异常
* @param username
* @param password
* @return
*/
@RequestMapping(value = "/userLogin", method = RequestMethod.GET)
@ResponseBody
jsonMsg.setCode("2031");
jsonMsg.setData(-1);
} else {
jsonMsg.setCode("2032");
jsonMsg.setData(-1);
} catch (SQLException e) {
jsonMsg.setCode("2033");
jsonMsg.setData(-1);
e.printStackTrace();
return jsonMsg;
用户管理控制层:
@Controller
try {
List<UserBean> users= userService.getUserByName(username);
if(users.size()==0)
jsonMsg.setData(0);
jsonMsg.setCode("202");
else if(users.size()==1){
jsonMsg.setData(users.get(0));
jsonMsg.setCode("200");
else{
throw new SQLException("用户名被重复,sql出现问题");
} catch (SQLException e) {
jsonMsg.setCode("404");
* Code:404 Data=-1 catch异常
* @param username
* @param password
* @return
*/
@RequestMapping(value = "/adminLogin", method = RequestMethod.GET)
@ResponseBody
public JsonMsg adminLogin(String username, String password) {
JsonMsg jsonMsg = new JsonMsg();
try {
if (adminService.getAdminByName(username).size() == 0) {
jsonMsg.setCode("205");
jsonMsg.setData(0);
* @param pic
* @return
*/
@RequestMapping(value = "/adminUpdate", method = RequestMethod.GET)
@ResponseBody
public JsonMsg updateAdmin(int id,String username,String password,String email,String description,String pic)
int status=0;
JsonMsg jsonMsg=new JsonMsg();
AdminBean ub=new AdminBean();
ub.setUsername(username);
jsonMsg.setData(-1);
e.printStackTrace();
return jsonMsg;
/**
* Code200,Data List<UserBean>
* Code404.Data -1 取出失败
* @return
*/
@RequestMapping(value = "/userTraversal", method = RequestMethod.GET)
@ResponseBody
public JsonMsg getUsers() {
JsonMsg jsonMsg = new JsonMsg();
try {
return jsonMsg;
用户管理控制层:
@Controller
@RequestMapping(value = "/user")
public class UserManageController {
UserService userService = new UserService();
SendMailService sendMailService = new SendMailService();
/**
* Code:200 Data=userBean 用户信息正确
* Code:205 Data=0 用户不存在
try {
ub.setMoney(Integer.parseInt(money));
} catch (Exception e) {
ub.setMoney(Integer.MIN_VALUE);
try {
status = userService.updateUserById(id, ub);
jsonMsg.setData(status);
if (status >= 1) {
jsonMsg.setCode("200");
} else {
jsonMsg.setCode("202");
} catch (SQLException e) {
@RequestMapping(value = "/sendEmail", method = RequestMethod.GET)
@ResponseBody
public JsonMsg sendEmail(String email, String username) {
JsonMsg jsonMsg = new JsonMsg();
try {
if (sendMailService.sendmail(email, username)) {
jsonMsg.setCode("200");
jsonMsg.setData(1);
} else {
jsonMsg.setCode("205");
jsonMsg.setData(0);
} catch (Exception e) {
*/
@RequestMapping(value = "/userRegister", method = RequestMethod.GET)
@ResponseBody
public JsonMsg addUser(String username, String password, String email) {
JsonMsg jsonMsg = new JsonMsg();
try {
int result =
userService.addUser(username, password, email, null, null, 0);
if (result == 0) {
jsonMsg.setData(0);
jsonMsg.setCode("202");
// public JsonMsg login(String id) {
// JsonMsg jsonMsg = new JsonMsg();
// try {
// jsonMsg.setCode("200");
// jsonMsg.setData(adminService.getAdminById(id));
// } catch (Exception e) {
// jsonMsg.setCode("404");
// e.printStackTrace();
// }
// return jsonMsg;
// }
// /**
// * 这个是用来注册管理员