——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM酒店房屋预定系统(java+ssm+jsp+mysql)
一、项目简述
功能包括: 前台:系统首页,酒店介绍,系统公告,客房信息,客房类型,用 户预等等。 用户:注册登陆修改我的信息客房预订等等。 管理员修改登录密码,添加客房,会员信息管理等等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + css + JavaScript + JQuery + Ajax + layui等等。
——————————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 * @return res */ @PostMapping("/deleteUserHouse") @ResponseBody public String deleteUserHouse (String houseId) { int n = service.deleteUserHouse(Integer.parseInt(houseId)); if (n > 0 ) { return "OK" ; } return "FAIL" ; } @PostMapping("/updateHouse") @ResponseBody public String updateHouse (House house) { int n = service.updateHouse(house); if (n > 0 ) { return "OK" ; } return "FAIL" ; } } @Controller @RequestMapping("/user") public class LoginController { @Autowired private IUserService mapper;
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 @RestController @RequestMapping("/admin") public class AdminController { @Autowired private IAdminService service; @PostMapping("/adminAccess") public String adminAccess (String userName, String userPassword, HttpServletRequest req) { Admin admin = new Admin(0 , userName, userPassword); Admin adminAccess = service.adminAccess(admin); req.getSession().setAttribute("Admin" , adminAccess); if (adminAccess != null ) { return "OK" ; } return "FAIL" ; } @GetMapping("/allUser")
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 */ @PostMapping("/deleteOrder") @ResponseBody public String deleteOrder (int orderId) { int n = service.deleteOrder(orderId); if (n > 0 ) { return "OK" ; } return "FAIL" ; } } @Controller @RequestMapping("/user") public class UserController { @Autowired private IUserService service; @Autowired private IHouseService dao; @GetMapping("/home.html") public String toUserSystemPage () { return "/user/home.jsp" ; }
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 @RequestMapping("/briefImage") @ResponseBody public Map<String, Object> briefImage (@RequestParam("brief") MultipartFile briefFile) { Map<String, Object> map = new HashMap<>(16 ); try { String suffixName = Objects.requireNonNull(briefFile.getOriginalFilename()) .substring(briefFile.getOriginalFilename().lastIndexOf("." )); String filename = UUID.randomUUID().toString().replace("-" , "" ) + suffixName; File filePath = new File(dirPath); if (!filePath.exists()) { boolean mkdirs = filePath.mkdirs(); } simplePath = "/hrs/" + filename; map.put("image" , simplePath); briefFile.transferTo(new File(dirPath + filename)); map.put("code" , 0 ); map.put("msg" , "上传成功" ); } catch (Exception e) { map.put("code" , 1 ); map.put("msg" , "上传失败" ); e.printStackTrace(); } return map; } @RequestMapping("/detailsImage") @ResponseBody public Map<String, Object> detailsImage (@RequestParam("detailsImage") List<MultipartFile> file, HttpServletRequest req) { Map<String, Object> map = new HashMap<>(16 ); if (!file.isEmpty()) { for (MultipartFile f : file) { try { String filename = UUID.randomUUID() + Objects.requireNonNull(f.getOriginalFilename()) .substring(f.getOriginalFilename().lastIndexOf("." ));
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 return true ; } List<String> filterUserList = Arrays.asList("/index.html" , "/user/login" , "/user/register" , "/detail.html" , "/fuzzy" , "/priceAsc" , "/priceDesc" , "/admin/" , "/admin/index.html" , "/admin/adminAccess" ); for (String url : filterUserList) { if (requestUrl.contains(url)) { return true ; } } response.sendRedirect("/" ); return false ; } } @Controller public class HouseDetailController { @Autowired private IHouseService service;
——————————PayStart——————————
项目链接: https://javayms.github.io?id=591422322105200lj https://javayms.pages.dev?id=591422322105200lj