——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SSM汽车租车管理系统(java+ssm+html+bootstrap+layui+mysql)
项目介绍
本项目包含管理员、普通用户两种角色; 管理员主要功能包括: 后台首页、停车位信息管理、车辆求租信息审核、车辆出租信息审核、管理员广播等;
普通用户主要功能包括: 个人信息管理、租入订单(租入的车、租入的车位)、租出订单、发布车辆出租信息、我要租车、我要租车位、留言、来自管理员的公告等内容;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:否;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp+jquery+bootstrap+layui
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中util/DBUtil.java配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ssm_qiche_rentsys/ 登录
——————————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 45
| package com.cwj.taiqiangle.controller;
@Controller @RequestMapping(value="/msg") public class MessageController { MessageService messageService=new MessageService();
@RequestMapping(value = "/msgAdd", method = RequestMethod.GET) @ResponseBody public JsonMsg msgAdd(String msg) { JsonMsg jsonMsg=new JsonMsg(); try { jsonMsg.setCode("200"); jsonMsg.setData(messageService.addMsg(msg)); } catch (SQLException e) { jsonMsg.setData(-1); jsonMsg.setCode("404"); e.printStackTrace(); } return jsonMsg; }
@RequestMapping(value = "/msgDelete", method = RequestMethod.GET)
|
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
| * Code=200 Data>=1 修改成功 Data=修改的信息数量 * 参数都可以为null,但是id为null无法更新 * null的参数不做更新 * * @param id * @param username * @param password * @param email * @param description * @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); ub.setPassword(password); ub.setEmail(email); ub.setDescription(description); ub.setPic(pic); try { status = adminService.updateUserById(id, ub); jsonMsg.setData(status); if (status >= 1) { jsonMsg.setCode("200"); } else { jsonMsg.setCode("202"); } } catch (SQLException e) { jsonMsg.setCode("404"); jsonMsg.setData(-1); e.printStackTrace(); } return jsonMsg; }
|
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 51 52 53 54
| * Code=202,Data=0,删除失败 * Code=404,Data=-1页面丢失 * * @param id * @return */ @RequestMapping(value = "/userDelete", method = RequestMethod.GET) @ResponseBody public JsonMsg removeUserById(int id) { JsonMsg jsonMsg=new JsonMsg(); try {
int i = userService.removeUserById(id); if (i == 1) { jsonMsg.setCode("200"); jsonMsg.setData(1); } else { jsonMsg.setCode("202"); jsonMsg.setData(0); } } catch (SQLException e) { jsonMsg.setCode("404"); jsonMsg.setData(-1); e.printStackTrace(); } return jsonMsg; }
@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) { jsonMsg.setCode("404");
|
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 51 52 53
| return jsonMsg; }
@RequestMapping(value = "/userLocate", method = RequestMethod.GET) @ResponseBody public JsonMsg getUserByID(int id) { JsonMsg jsonMsg=new JsonMsg(); try {
UserBean user = userService.getUserById(id); if(user!=null){ jsonMsg.setCode("200"); jsonMsg.setData(user); } else { jsonMsg.setCode("202"); jsonMsg.setData(0); }
} catch (SQLException e) { jsonMsg.setCode("404"); jsonMsg.setData(-1); e.printStackTrace(); } return jsonMsg; }
|
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 51 52 53
| jsonMsg.setData(-1); e.printStackTrace(); } return jsonMsg; }
@RequestMapping(value = "/passedOrder", method = RequestMethod.GET) @ResponseBody public JsonMsg getpassedOrder() { JsonMsg jsonMsg=new JsonMsg(); List<CarInBean> orders= null; List<CarInBean> myOrders=new ArrayList<CarInBean>(); try { orders = orderService.getAllOrder(); for(CarInBean car:orders) { if(car.getStatus()==1) { myOrders.add(car); } } jsonMsg.setData(myOrders); jsonMsg.setCode("200"); } catch (SQLException e) { jsonMsg.setCode("404"); jsonMsg.setData(-1); e.printStackTrace(); } return jsonMsg; }
@RequestMapping(value = "/orderTraversal", method = RequestMethod.GET) @ResponseBody public JsonMsg orderTraversal() { JsonMsg jsonMsg=new JsonMsg(); List<CarInBean> orders= null; try { orders = orderService.getAllOrder(); jsonMsg.setData(orders);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=411122532008200ra
https://javayms.pages.dev?id=411122532008200ra