基于javaweb+mysql的springboot汽车租赁管理系统(java+springboot+ssm+jsp+js+mysql)

基于javaweb+mysql的springboot汽车租赁管理系统(java+springboot+ssm+jsp+js+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb+mysql的SpringBoot汽车租赁管理系统(java+springboot+ssm+jsp+js+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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7/8.0等版本均可;

技术栈 后端:SpringBoot+SSM(Spring+SpringMVC+Mybatis)+JSP

使用说明 1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;


return ResultObj.UPDATE_ERROR;

/*

* 批量删除车辆

*/

@RequestMapping("deleteBatchCar")

public ResultObj deleteBatchCar(CarVo carVo) {

try {

this.carService.deleteBatchCar(carVo.getIds());

return ResultObj.DELETE_SUCCESS;

} catch (Exception e) {

e.printStackTrace();

return ResultObj.DELETE_ERROR;


return ResultObj.DELETE_SUCCESS;

} catch (Exception e) {

e.printStackTrace();

return ResultObj.DELETE_ERROR;

/**

* 更改出租单信息

*/

@RequestMapping("updateRent")

public ResultObj updateRent(RentVo rentVo) {

try {

//保存

this.rentService.updateRent(rentVo);


private RentService rentService;

@Autowired

private CustomerService customerService;

/**

* 检查身份证号码是否存在

*/

@RequestMapping("checkCustomerExist")

public ResultObj checkCustomerExist(RentVo rentVo) {

Customer customer = customerService.queryCustomerByIdentity(rentVo.getIdentity());

if (null!=customer) {

return ResultObj.STATUS_TRUE;

}else {

return ResultObj.STATUS_FALSE;

public class StatController {

@Autowired

private StatService statService;

@Autowired

private CustomerService customerService;

@Autowired

private RentService rentService;

/*

* 跳转到客户地区统计页面

*/

@RequestMapping("toCustomerAreaStat")

public String toCustomerAreaStat() {

return "stat/customerAreaStat";

public class RentController {

@Autowired

private RentService rentService;

@Autowired

private CustomerService customerService;

/**

* 检查身份证号码是否存在

*/

@RequestMapping("checkCustomerExist")

public ResultObj checkCustomerExist(RentVo rentVo) {

Customer customer = customerService.queryCustomerByIdentity(rentVo.getIdentity());

if (null!=customer) {


//根据身份证号查询客户信息

Customer customer = customerService.queryCustomerByIdentity(rent.getIdentity());

String filename  =customer.getCustname() +"的出租单.xls";

String sheetname  = customer.getCustname()+"的出租单";

ByteArrayOutputStream bos = ExportRentUtils.exportCustomer(rent,customer, sheetname);

try {

filename=URLEncoder.encode(filename,"UTF-8");

//创建封装响应头信息的对象

HttpHeaders header = new HttpHeaders();

//封装响应内容类型(APPLICATION_OCTET_STREAM 响应的内容不限定)

header.setContentType(MediaType.APPLICATION_OCTET_STREAM);

//设置下载的文件名称

header.setContentDispositionFormData("attachment", filename);

User user = (User)WebUtils.getHttpSession().getAttribute("user");

rentVo.setOpername(user.getRealname());

return rentVo;

/**

* 保存出租单信息

*/

@RequestMapping("saveRent")

public ResultObj saveRent(RentVo rentVo) {

try {

//设置创建时间

rentVo.setCreatetime(new Date());

public ResultObj updateCar(CarVo carVo) {

try {

String carimg =  carVo.getCarimg();

if (carimg.endsWith(SysConstast.FILE_UPLOAD_TEMP)) {

String filePath = AppFileUtils.updateFileName(carVo.getCarimg(),SysConstast.FILE_UPLOAD_TEMP);

carVo.setCarimg(filePath);

//把原来的删除

Car car = this.carService.queryCarByCarNumber(carVo.getCarnumber());

AppFileUtils.removeFileByPath(car.getCarimg());

this.carService.updateCar(carVo);

return ResultObj.UPDATE_SUCCESS;

} catch (Exception e) {

e.printStackTrace();


values.add(baseEntity.getValue());

map.put("name", names);

map.put("value", values);

return map;

/*

* 加载公司年度月份销售额

*/

@RequestMapping("loadCompanyYearGradeStat")

@ResponseBody

public List<Double> toLoadCompanyYearGradeStat(String year){

List<Double> entities = this.statService.loadCompanyYearGradeStatList(year);


/*

* 删除车辆

*/

@RequestMapping("deleteCar")

public ResultObj deleteCar(CarVo carVo) {

try {

this.carService.deleteCar(carVo.getCarnumber());

return ResultObj.DELETE_SUCCESS;

} catch (Exception e) {

e.printStackTrace();

return ResultObj.DELETE_ERROR;

/*

* 修改车辆

//保存

this.rentService.deleteRent(rentVo.getRentid());

return ResultObj.DELETE_SUCCESS;

} catch (Exception e) {

e.printStackTrace();

return ResultObj.DELETE_ERROR;

/**

* 更改出租单信息

*/

@RequestMapping("updateRent")

public ResultObj updateRent(RentVo rentVo) {
* 跳转到公司年度统计

*/

@RequestMapping("toCompanyYearGradeStat")

public String toLadcompanyYearGradeStat() {

return "stat/componyYearGradeStat";

/*

* 加载客户地区统计

*/

@RequestMapping("loadCustomerAreaStatJson")

@ResponseBody

public List<BaseEntity> loadCustomerAreaStatJson(){

return this.statService.loadCustomerAreaStatList();

/*

* 加载客户地区统计

return this.statService.loadCustomerAreaStatList();

/*

* 加载客户地区统计

*/

@RequestMapping("loadOpernameYearGradeStat")

@ResponseBody

public Map<String, Object> loadOpernameYearGradeStat(String year){

List<BaseEntity> entities = this.statService.loadOpernameYearGradeList(year);

Map<String, Object> map = new HashMap<>();

List<String> names = new ArrayList<>();

List<Double> values = new ArrayList<>();

for (BaseEntity baseEntity : entities) {


* 加载客户地区统计

*/

@RequestMapping("loadCustomerAreaStatJson")

@ResponseBody

public List<BaseEntity> loadCustomerAreaStatJson(){

return this.statService.loadCustomerAreaStatList();

/*

* 加载客户地区统计

*/

@RequestMapping("loadOpernameYearGradeStat")

@ResponseBody

public Map<String, Object> loadOpernameYearGradeStat(String year){

//设置下载的文件名称

header.setContentDispositionFormData("attachment", filename);

return new ResponseEntity<Object>(bos.toByteArray(),header,HttpStatus.CREATED);

} catch (UnsupportedEncodingException e) {

e.printStackTrace();

return null;

车辆管理控制层:

/**

* 车辆管理控制器

*/

@RestController

@RequestMapping("car")

public class CarController {
//如果不是默认图片就去掉后缀

if (!carVo.getCarimg().equals(SysConstast.DEFAULT_CAR_IMG)) {

String filePath = AppFileUtils.updateFileName(carVo.getCarimg(),SysConstast.FILE_UPLOAD_TEMP);

carVo.setCarimg(filePath);

this.carService.addCar(carVo);

return ResultObj.ADD_SUCCESS;

} catch (Exception e) {

e.printStackTrace();

return ResultObj.ADD_ERROR;

/*

* 删除车辆

*/

@RequestMapping("deleteCar")


public class RentController {

@Autowired

private RentService rentService;

@Autowired

private CustomerService customerService;

/**

* 检查身份证号码是否存在

*/

@RequestMapping("checkCustomerExist")

public ResultObj checkCustomerExist(RentVo rentVo) {

Customer customer = customerService.queryCustomerByIdentity(rentVo.getIdentity());

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值