——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven在线汽车租赁系统(前台+后台)(java+jsp+ssm+layui+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 public String toMenuManager () { return "system/menu/menuManager" ; } @RequestMapping("toMenuRight") public String toMenuRight () { return "system/menu/MenuRight" ; } @RequestMapping("toMenuLeft") public String toMenuLeft () { return "system/menu/MenuLeft" ; } @RequestMapping("toRoleManager") public String toRoleManager () { return "system/role/roleManager" ; } @RequestMapping("toUserManager") public String toUserManager () { return "system/user/userManager" ; }
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 public ResultObj updateRent (RentVo rentVo) { try { this .rentService.updateRent(rentVo); return ResultObj.UPDATE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.UPDATE_ERROR; } } } package com.alfred.sys.controller;@RestController @RequestMapping("user") public class UserController { @Autowired private UserService userService; @RequestMapping("loadAllUser") public DataGridView loadAllUser (UserVo userVo) { return this .userService.queryAllUser(userVo); }
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 */ @RequestMapping("loadOpernameYearGradeStatJson") @ResponseBody public Map<String,Object> loadOpernameYearGradeStatJson (String year) { List<BaseEntity> entities = this .statService.loadOpernameYearGradeStatList(year); Map<String,Object> map = new HashMap<String, Object>(); List<String> names = new ArrayList<String>(); List<Double> values = new ArrayList<Double>(); for (BaseEntity baseEntity : entities) { names.add(baseEntity.getName()); values.add(baseEntity.getValue()); } map.put("name" ,names); map.put("value" ,values); return map; } @RequestMapping("toCompanyYearGradeStat") public String toCompanyYearGradeStat () { return "stat/companyYearGradeStat" ; } @RequestMapping("loadCompanyYearGradeStatJson") @ResponseBody public List<Double> loadCompanyYearGradeStatJson (String year) { List<Double> entities = this .statService.loadCompanyYearGradeStatList(year); for (int i = 0 ; i < entities.size(); i++) { if (null ==entities.get(i)){ entities.set(i,0.0 ); } } return entities; }
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 model.addAttribute("tbuser" ,httpSession.getAttribute("tbuser" )); System.out.println("当前:" +identity+"用户正在租" +carnumber+"号车" ); rentcarnumber = tbUserService.carRent(carnumber,identity); System.out.println("租赁成功!租赁单为:" +rentcarnumber); return "user/index" ; } } package com.alfred.sys.controller;@RestController @RequestMapping("menu") public class MenuController { @Autowired private MenuService menuService; @RequestMapping("loadIndexLeftMenuJson") public List<TreeNode> loadIndexLeftMenuJson (MenuVo menuVo) { User user = (User) WebUtils.getHttpSession().getAttribute("user" ); List<Menu> list = null ; menuVo.setAvailable(SysConstant.AVAILABLE_TRUE); if (user.getType() == SysConstant.USER_TYPE_SUPER) { list = menuService.queryAllMenuForList(menuVo);
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 */ @RequestMapping("updateNews") public ResultObj updateNews (NewsVo newsVo) { try { this .newsService.updateNews(newsVo); return ResultObj.UPDATE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.UPDATE_ERROR; } } @RequestMapping("loadNewsById") public News loadNewsById (Integer id) { return this .newsService.queryNewsById(id); } } package com.alfred.bus.controller;@RestController @RequestMapping("customer") public class CustomerController { @Autowired private CustomerService customerService; @RequestMapping("loadAllCustomer")
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 @RequestMapping("addCar") public ResultObj addCar (CarVo carVo) { try { carVo.setCreatetime(new Date()); if (!carVo.getCarimg().equals(SysConstant.DEFAULT_CAR_IMG)) { String filePath = AppFileUtils.updateFileName(carVo.getCarimg(), SysConstant.FILE_UPLOAD_TEMP); carVo.setCarimg(filePath); } this .carService.addCar(carVo); return ResultObj.ADD_SUCCESS; } catch (Exception e) { e.printStackTrace(); return ResultObj.ADD_ERROR; } } @RequestMapping("updateCar") public ResultObj updateCar (CarVo carVo) { try { String carimg = carVo.getCarimg(); if (carimg.endsWith(SysConstant.FILE_UPLOAD_TEMP)) { String filePath = AppFileUtils.updateFileName(carVo.getCarimg(), SysConstant.FILE_UPLOAD_TEMP); carVo.setCarimg(filePath); Car car = this .carService.queryCarByCarNumber(carVo.getCarnumber()); AppFileUtils.removeFileByPath(car.getCarimg()); } this .carService.updateCar(carVo);
——————————PayStart——————————
项目链接: https://javayms.github.io?id=321122572008200to https://javayms.pages.dev?id=321122572008200to