当前位置:   article > 正文

免费分享一套SpringBoot+Vue酒店客房预定(预约)管理系统【论文+源码+SQL脚本】,帅呆了~~

免费分享一套SpringBoot+Vue酒店客房预定(预约)管理系统【论文+源码+SQL脚本】,帅呆了~~

​大家好,我是java1234_小锋老师,看到一个不错的SpringBoot+Vue酒店客房预定(预约)管理系统,分享下哈。 ​

项目视频演示

【免费】SpringBoot+Vue酒店客房预定(预约)管理系统 Java毕业设计_哔哩哔哩_bilibili

项目介绍

在数字化转型的浪潮中,酒店业正积极采用先进的信息技术来优化客户体验和运营效率。本研究旨在开发一款基于Spring Boot后端框架和Vue.js前端框架的酒店客房预订管理系统,以满足现代酒店对高效、便捷、安全的预订管理需求。

系统采用Spring Boot作为后端技术栈的核心,负责处理业务逻辑、数据存储与安全控制,利用其内置的Spring Security进行权限管理和用户认证。数据库采用关系型数据库MySQL,以确保数据的一致性和事务性。此外,使用Redis作为缓存层,提高数据读取速度,减少数据库压力。

前端界面采用Vue.js构建,提供直观、响应式的用户界面,包括客房查询、预订、取消、支付等功能。通过Axios与后端API进行交互,实现动态数据展示和实时更新。系统还集成了地图服务API,为用户提供酒店位置信息及周边设施详情,增强用户体验。

安全性方面,系统采用JWT(JSON Web Token)进行身份验证,确保通信过程中的数据安全。

本系统的实施不仅提升了酒店的预订管理效率,也极大地改善了顾客的在线预订体验。通过性能测试和用户反馈,证明了该系统在响应时间、易用性和安全性方面的优越性,为酒店业提供了有力的技术支撑,推动了行业的数字化进程。

系统展示

部分代码

  1. package com.rabbiter.hotel.controller.user;
  2. import cn.hutool.crypto.SecureUtil;
  3. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  4. import com.rabbiter.hotel.common.CommonResult;
  5. import com.rabbiter.hotel.common.StatusCode;
  6. import com.rabbiter.hotel.domain.User;
  7. import com.rabbiter.hotel.dto.LoginDTO;
  8. import com.rabbiter.hotel.dto.PasswordDTO;
  9. import com.rabbiter.hotel.dto.RegisterDTO;
  10. import com.rabbiter.hotel.dto.ReturnUserDTO;
  11. import com.rabbiter.hotel.service.UserService;
  12. import com.rabbiter.hotel.util.WebUtils;
  13. import org.springframework.beans.BeanUtils;
  14. import org.springframework.web.bind.annotation.*;
  15. import javax.annotation.Resource;
  16. @RestController
  17. @RequestMapping("/user")
  18. public class UserController {
  19. @Resource
  20. private UserService userService;
  21. @PostMapping(value = "/register")
  22. public CommonResult<String> register(@RequestBody RegisterDTO registerDTO) {
  23. // 邮箱唯一验证
  24. long count = userService.count(new QueryWrapper<User>().eq("email", registerDTO.getEmail()));
  25. if(count > 0) {
  26. // 邮箱重复
  27. CommonResult<String> commonResult = new CommonResult<>();
  28. commonResult.setData("邮箱已存在");
  29. commonResult.setCode(StatusCode.COMMON_FAIL.getCode());
  30. commonResult.setMessage(StatusCode.COMMON_FAIL.getMessage());
  31. return commonResult;
  32. }
  33. CommonResult<String> commonResult = new CommonResult<>();
  34. User user = new User();
  35. BeanUtils.copyProperties(registerDTO, user);
  36. user.setPassword(SecureUtil.md5(registerDTO.getPassword()));
  37. // System.out.println(user);
  38. userService.save(user);
  39. commonResult.setData("注册成功");
  40. commonResult.setCode(StatusCode.COMMON_SUCCESS.getCode());
  41. commonResult.setMessage(StatusCode.COMMON_SUCCESS.getMessage());
  42. return commonResult;
  43. }
  44. @PostMapping(value = "/login")
  45. public CommonResult<String> login(@RequestBody LoginDTO loginDTO) {
  46. CommonResult<String> commonResult = new CommonResult<>();
  47. QueryWrapper queryWrapper = new QueryWrapper();
  48. queryWrapper.eq("email", loginDTO.getEmail());
  49. String md5Password = SecureUtil.md5(loginDTO.getPassword());
  50. queryWrapper.eq("password", md5Password);
  51. User user = userService.getBaseMapper().selectOne(queryWrapper);
  52. if (null != user) {
  53. WebUtils.getSession().setAttribute("loginUser", user);
  54. // System.out.println(WebUtils.getSession().getId());
  55. commonResult.setCode(StatusCode.COMMON_SUCCESS.getCode());
  56. commonResult.setMessage(StatusCode.COMMON_SUCCESS.getMessage());
  57. commonResult.setData("登录成功");
  58. } else {
  59. commonResult.setCode(StatusCode.COMMON_FAIL.getCode());
  60. commonResult.setMessage(StatusCode.COMMON_FAIL.getMessage());
  61. commonResult.setData("账号密码错误,请重试");
  62. }
  63. System.out.println(commonResult);
  64. return commonResult;
  65. }
  66. @GetMapping("/logout")
  67. public CommonResult<String> logout(){
  68. CommonResult<String> commonResult = new CommonResult<>();
  69. WebUtils.getSession().removeAttribute("loginUser");
  70. commonResult.setCode(StatusCode.COMMON_SUCCESS.getCode());
  71. commonResult.setMessage(StatusCode.COMMON_SUCCESS.getMessage());
  72. commonResult.setData("登出成功!");
  73. return commonResult;
  74. }
  75. @GetMapping("/userDetail")
  76. public CommonResult<ReturnUserDTO> userDetail() {
  77. CommonResult<ReturnUserDTO> commonResult = new CommonResult();
  78. ReturnUserDTO returnUser = new ReturnUserDTO();
  79. // User user1 = new User();
  80. // user1.setId(6);
  81. // // user1.setCreateTime(new Date());
  82. // // user1.setEmail("1066261401@qq.com");
  83. // // user1.setUserName("水墨清尘");
  84. // // user1.setPassword("e10adc3949ba59abbe56e057f20f883e");
  85. // // user1.setSex(0);
  86. // // user1.setPhone("19861407837");
  87. // WebUtils.getSession().setAttribute("loginUser", user1);
  88. User user2 = (User) WebUtils.getSession().getAttribute("loginUser");
  89. // System.out.println(WebUtils.getSession().getId());
  90. User user = userService.getById(user2.getId());
  91. // System.out.println(user);
  92. BeanUtils.copyProperties(user, returnUser);
  93. commonResult.setCode(StatusCode.COMMON_SUCCESS.getCode());
  94. commonResult.setMessage(StatusCode.COMMON_SUCCESS.getMessage());
  95. commonResult.setData(returnUser);
  96. return commonResult;
  97. }
  98. @PostMapping("/updatePassword")
  99. public CommonResult<String> updatePassword(@RequestBody PasswordDTO passwordDTO) {
  100. CommonResult<String> commonResult = new CommonResult<>();
  101. QueryWrapper queryWrapper = new QueryWrapper();
  102. System.out.println(passwordDTO);
  103. // User user1 = new User();
  104. // user1.setId(10);
  105. // // user1.setCreateTime(new Date());
  106. // // user1.setEmail("1066261401@qq.com");
  107. // // user1.setUserName("水墨清尘");
  108. // // user1.setPassword("e10adc3949ba59abbe56e057f20f883e");
  109. // // user1.setSex(0);
  110. // // user1.setPhone("19861407837");
  111. // WebUtils.getSession().setAttribute("loginUser", user1);
  112. User user2 = (User) WebUtils.getSession().getAttribute("loginUser");
  113. User user = userService.getById(user2.getId());
  114. String md5OldPassword = SecureUtil.md5(passwordDTO.getOldPassword());
  115. if (!user.getPassword().equals(md5OldPassword)) {
  116. commonResult.setCode(StatusCode.COMMON_FAIL.getCode());
  117. commonResult.setMessage(StatusCode.COMMON_FAIL.getMessage());
  118. commonResult.setData("密码错误");
  119. return commonResult;
  120. }
  121. String md5NewPassword = SecureUtil.md5(passwordDTO.getNewPassword());
  122. user.setPassword(md5NewPassword);
  123. userService.updateById(user);
  124. commonResult.setCode(StatusCode.COMMON_SUCCESS.getCode());
  125. commonResult.setMessage(StatusCode.COMMON_SUCCESS.getMessage());
  126. commonResult.setData("修改密码成功");
  127. return commonResult;
  128. }
  129. }
  1. <template>
  2. <div>
  3. <el-container class="wrapper">
  4. <el-main class="section text-center">
  5. <div class="login-bg"></div>
  6. <el-card class="box-card login-card">
  7. <div class="text item">
  8. <p class="login-title">
  9. <i
  10. class="iconfont icon-r-yes"
  11. style="font-size: 32px"
  12. ></i>
  13. 酒店客房预订系统
  14. </p>
  15. <el-form
  16. :model="login"
  17. status-icon
  18. ref="login"
  19. label-width="80px"
  20. >
  21. <el-form-item label="账户邮箱" prop="email">
  22. <el-input
  23. type="text"
  24. v-model="login.email"
  25. autocomplete="off"
  26. ></el-input>
  27. </el-form-item>
  28. <el-form-item label="密码" prop="pass">
  29. <el-input
  30. type="password"
  31. v-model="login.password"
  32. autocomplete="off"
  33. ></el-input>
  34. </el-form-item>
  35. </el-form>
  36. </div>
  37. </el-card>
  38. <el-button
  39. circle
  40. :type="btnType"
  41. @click="loginBtn"
  42. class="loginbtn"
  43. :disabled="disabled"
  44. >
  45. <i :class="iconstyle" style="font-size: 54px"></i>
  46. </el-button>
  47. <div class="register">
  48. <p>
  49. <router-link to="/register" style="color: black"
  50. >注册账号</router-link
  51. >
  52. </p>
  53. </div>
  54. <a href="http://www.java1234.com/a/bysj/javaweb/" target='_blank'><font color=red>Java1234收藏整理</font></a>
  55. </el-main>
  56. </el-container>
  57. <el-footer class="footer text-center">
  58. <copyright></copyright>
  59. </el-footer>
  60. </div>
  61. </template>
  62. <script>
  63. import copyright from "@/components/copyright.vue";
  64. import store from "./../store";
  65. export default {
  66. data() {
  67. return {
  68. login: {
  69. email: "",
  70. password: "",
  71. },
  72. iconstyle: "iconfont icon-r-right",
  73. disabled: false,
  74. btnType: "primary",
  75. isRealLogin: true,
  76. };
  77. },
  78. components: {
  79. copyright,
  80. },
  81. methods: {
  82. loginBtn() {
  83. if (
  84. this.login.email.trim() == "" ||
  85. this.login.password.trim() == ""
  86. ) {
  87. this.$message({
  88. message: "账号或密码不能为空",
  89. type: "error",
  90. });
  91. return;
  92. }
  93. this.iconstyle = "el-icon-loading";
  94. this.disabled = true;
  95. this.axios
  96. .post("http://localhost:9151/user/login", {
  97. email: this.login.email,
  98. password: this.login.password,
  99. })
  100. .then((res) => {
  101. if (res.data.code == 200) {
  102. this.iconstyle = "el-icon-check";
  103. this.btnType = "success";
  104. this.$message({
  105. message: "登录成功,正在跳转",
  106. type: "success",
  107. });
  108. setTimeout(() => {
  109. this.disabled = false;
  110. this.$store.commit("setFind");
  111. this.$router.push("/findroom");
  112. }, 2000);
  113. } else {
  114. this.iconstyle = "el-icon-close";
  115. this.btnType = "danger";
  116. this.$message({
  117. message: "登录失败,账号或密码错误",
  118. type: "error",
  119. });
  120. setTimeout(() => {
  121. this.disabled = false;
  122. this.iconstyle = "iconfont icon-r-right";
  123. this.btnType = "primary";
  124. }, 2000);
  125. }
  126. })
  127. .catch((e) => {
  128. this.iconstyle = "el-icon-close";
  129. this.btnType = "danger";
  130. setTimeout(() => {
  131. this.disabled = false;
  132. this.iconstyle = "iconfont icon-r-right";
  133. this.btnType = "primary";
  134. }, 2000);
  135. if (e.response == undefined || e.response.data == undefined) {
  136. this.$message({
  137. showClose: true,
  138. message: e,
  139. type: "error",
  140. duration: 0,
  141. });
  142. } else {
  143. this.$message({
  144. showClose: true,
  145. message: e.response.data,
  146. type: "error",
  147. duration: 0,
  148. });
  149. }
  150. });
  151. },
  152. nologinBtn() {
  153. this.$store.commit("setFind");
  154. this.$router.push("/findroom");
  155. },
  156. },
  157. };
  158. </script>
  159. <style scoped="scoped">
  160. .login-bg {
  161. background: rgb(65, 105, 225);
  162. height: 30vh;
  163. background-size: 100%;
  164. border: 0px solid transparent;
  165. border-bottom-left-radius: 10px;
  166. border-bottom-right-radius: 10px;
  167. }
  168. .text {
  169. font-size: 14px;
  170. }
  171. .item {
  172. /* padding: 18px 0; */
  173. }
  174. .login-card {
  175. margin: -7rem 1rem 1rem 1rem;
  176. }
  177. .login-title {
  178. font-size: 2rem;
  179. font-weight: lighter;
  180. margin-top: 1rem;
  181. }
  182. .wrapper {
  183. min-height: 90vh;
  184. }
  185. .el-main {
  186. max-height: 90vh;
  187. }
  188. #app {
  189. overflow: hidden;
  190. }
  191. .loginbtn {
  192. width: 7rem;
  193. height: 7rem;
  194. font-size: 1.5rem;
  195. margin-top: 2rem;
  196. }
  197. .register {
  198. margin-top: 5vh;
  199. }
  200. .register a,
  201. .register div {
  202. color: #409eff;
  203. }
  204. .register p {
  205. margin: 0.5rem;
  206. }
  207. </style>

源码下载

下载地址:
链接:https://pan.baidu.com/s/1AKqVPmoYeF-qllmsDWetWg 
提取码:1234

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/830779
推荐阅读
相关标签
  

闽ICP备14008679号