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





基于javaweb的SSM+Maven汽车出租租赁系统(java+jsp+ssm+maven+mysql)
一、项目简述
功能包括: 车辆管理,出租管理,汽车入库,汽车出租,汽车归还, 客户管理,出租单管理,统计分析等等功能,功能多多一 起来看看吧。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ 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 45 46 47 48 49 50 51 52 53 54
| }
@RequestMapping("addRole") public ResultObj addRole(RoleVo roleVo){ try{ this.roleService.addRole(roleVo); return ResultObj.ADD_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.ADD_ERROR; } }
@RequestMapping("updateRole") public ResultObj updateRole(RoleVo roleVo){ try { this.roleService.updateRole(roleVo); return ResultObj.UPDATE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.UPDATE_ERROR; } }
@RequestMapping("deleteRole") public ResultObj deleteRole(RoleVo roleVo){ try { this.roleService.deleteRole(roleVo.getRoleid()); return ResultObj.DELETE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.DELETE_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
| return this.customerService.queryAllCustomer(customerVo); }
@RequestMapping("addCustomer") public ResultObj addCustomer(CustomerVo customerVo){ try{ customerVo.setCreatetime(new Date()); this.customerService.addCustomer(customerVo); return ResultObj.ADD_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.ADD_ERROR; } }
@RequestMapping("updateCustomer") public ResultObj updateCustomer(CustomerVo customerVo){ try{ this.customerService.updateCustomer(customerVo); return ResultObj.UPDATE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.UPDATE_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
| if (null==entities.get(i)){ entities.set(i,0.0); } } return entities; }
@RequestMapping("exportCustomer") public ResponseEntity<Object> exportCustomer(CustomerVo customerVo, HttpServletResponse response){ List<Customer> customers = customerService.queryAllCustomerForList(customerVo); String fileName="客户数据.xls"; String sheetName="客户数据";
ByteArrayOutputStream bos = ExportCustomerUtils.exportCustomer(customers,sheetName);
try { fileName= URLEncoder.encode(fileName,"UTF-8"); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("attachment",fileName); return new ResponseEntity<Object>(bos.toByteArray(),headers, HttpStatus.CREATED); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; }
|
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
|
@Controller @RequestMapping("bus") public class BusController {
@RequestMapping("toCustomerManager") public String toCustomerManager(){ return "business/customer/customerManager"; }
@RequestMapping("toCarManager") public String toCarManager(){ return "business/car/carManager"; }
@RequestMapping("toRentCarManager") public String toRentCarManager(){ return "business/rent/rentCarManager"; }
@RequestMapping("toRentManager")
|
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
| @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; } }
} package com.yeqifu.bus.controller;
@RestController @RequestMapping("check") public class CheckController {
@Autowired private IRentService rentService;
@Autowired private ICheckService checkService;
@RequestMapping("checkRentExist") public Rent checkRentExist(String rentid){ Rent rent = rentService.queryRentByRentId(rentid); return rent; }
|
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
| e.printStackTrace(); } }
public static ResponseEntity<Object> downloadFile(HttpServletResponse response, String path, String oldName) { File file=new File(AppFileUtils.PATH,path); if(file.exists()) { try { try { oldName=URLEncoder.encode(oldName,"UTF-8"); } catch (Exception e) { e.printStackTrace(); } byte[] bytes=FileUtils.readFileToByteArray(file); HttpHeaders header=new HttpHeaders(); header.setContentType(MediaType.APPLICATION_OCTET_STREAM); header.setContentDispositionFormData("attachment",oldName); ResponseEntity<Object> entity = new ResponseEntity<Object>(bytes,header,HttpStatus.CREATED); return entity; } catch (Exception e) { e.printStackTrace(); } return null; }else { PrintWriter out; try { out = response.getWriter(); out.write("文件不存在"); out.flush(); out.close(); } catch (IOException e) { e.printStackTrace();
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=081422322105200jq
https://javayms.pages.dev?id=081422322105200jq