👉文末查看项目功能视频演示+获取源码+sql脚本+视频导入教程视频
1 、功能描述
基于SSH的酒店管理系统拥有两种角色
管理员:房间管理、房型管理、客户管理、预定管理、入住管理(到店入住、预定入住、正在入住)、账单管理、会员管理、评论管理、员工管理、结账、换房等
用户:分类查看房屋、预定房屋、登录注册等
1.1 背景描述
酒店管理系统是一种专门设计用于帮助酒店管理日常运营的软件系统。该系统通常包括预订管理、客房分配、客户信息管理、账单结算、库存管理和员工排班等功能。通过酒店管理系统,员工可以轻松地处理客人的预订请求,检查客房可用性,并实时更新客房状态。此外,系统还能够跟踪客户信息和偏好,从而提供更个性化的服务。对于酒店财务管理方面,系统也能够有效地管理账单和支付流程,最大限度地减少错误和延误。库存管理功能有助于确保酒店的各种物品充足,并在需要时及时补充。最后,酒店管理系统还能协助管理员工排班和考勤,以确保酒店的各项工作都能有条不紊地进行。这些功能共同帮助酒店提高效率、优化客户体验,并实现良好的经营管理。
2、项目技术
后端框架:struts+spring+hibernate
前端技术:jsp、css、JavaScript、JQuery
2.1 SSH
SSH框架(Struts+Spring+Hibernate)是一种广泛应用的Java企业级开发框架组合,它将Struts、Spring和Hibernate三个优秀的框架有机地结合在一起,提供了一套完整的解决方案,可以帮助开发人员快速构建可扩展、可维护的Java应用程序。
2.2 mysql
MySQL是一款Relational Database Management System,直译过来的意思就是关系型数据库管理系统,MySQL有着它独特的特点,这些特点使他成为目前最流行的RDBMS之一,MySQL想比与其他数据库如ORACLE、DB2等,它属于一款体积小、速度快的数据库,重点是它符合本次毕业设计的真实租赁环境,拥有成本低,开发源码这些特点,这也是选择它的主要原因。
3、开发环境
- JAVA版本:JDK1.8
- IDE类型:IDEA、Eclipse都可运行
- tomcat版本:Tomcat 7-10版本均可
- 数据库类型:MySql(5.x和8.x版本都可)
- maven项目:否
- 硬件环境:Windows 或者 Mac OS
4、功能截图+视频演示+文档目录
4.1 登录注册
4.2 前端模块
4.3 用户模块
4.4管理员 模块
5 、核心代码实现
5.1 配置代码
database.database=mysql
database.url=jdbc:mysql://localhost:3306/hoteldb?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
database.username=root
database.password=root
5.2 其它核心代码
package com.jiudian.checkin.action;
import com.jiudian.checkin.service.CheckinManageService;
import com.jiudian.customer.entity.Customer;
import com.jiudian.room.entity.Room;
import com.jiudian.room.service.RoomManageService;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@Controller
@ParentPackage("my-default")
@Namespace("/")
@Scope("prototype")
public class CheckinManageAction extends ActionSupport {
@Autowired
private CheckinManageService checkinManageService;
@Autowired
private RoomManageService roomManageService;
private String roomid;
private String checkinid;
private String accesscardID;
private String[] customerAddress;
private String[] customerCard;
private String[] customerName;
private String[] customerPhone;
private String[] customerSex;
private String notes;
private String vipphone;
private String roomtypeid;
private String bookingid;
private int page;
private int limit;
/**
* 显示所有可入住的房间
* */
@Action(value = "/sys/checkin/checkin",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "index", location = "/checkin/select-room.jsp")})
public String index() {
return "index";
}
/**
* 显示所有入住记录
* */
@Action(value = "/sys/checkin/allcheckin",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "allcheckin", location = "/checkin/checkin.jsp")})
public String allcheckin() {
return "allcheckin";
}
/**
* 显示正在入住记录
* */
@Action(value = "/sys/checkin/checkining",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "checkining", location = "/checkin/checkining.jsp")})
public String checkining() {
return "checkining";
}
/**
* 跳转到办理入住页面
* */
@Action(value = "/sys/checkin/firstcheckin",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "firstcheckin", location = "/checkin/checkin-add.jsp")})
public String firstcheckin() {
Room room = roomManageService.get(roomid);
ServletActionContext.getContext().put("room", room);
return "firstcheckin";
}
/**
* 新增到店入住信息
* */
@Action(value = "/sys/checkin/addcheckin",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "addcheckin", location = "/sys/ok.jsp"),
@Result(name = "fullroom", location = "/checkin/fullroom.jsp")})
public String addcheckin() {
if(checkinManageService.ablecheckin(roomid)) {
//将customer组合成列表
List<Customer> customers = new ArrayList<>();
for (int i = 0; i < customerName.length; i++) {
Customer temp = new Customer();
temp.setCustomerName(customerName[i]);
temp.setCustomerSex(customerSex[i]);
temp.setCustomerPhone(customerPhone[i]);
temp.setCustomerCard(customerCard[i]);
temp.setCustomerAddress(customerAddress[i]);
customers.add(temp);
}
checkinManageService.addcheckin(roomid, accesscardID, notes, vipphone, customers);
return "addcheckin";
}
else {
return "fullroom";
}
}
/**
* 跳转到预定入住页面
* */
@Action(value = "/sys/checkin/bookingcheckin",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "bookingcheckin", location = "/checkin/bookingcheckin-add.jsp")})
public String bookingcheckin() {
ServletActionContext.getContext().put("vipphone", vipphone);
ServletActionContext.getContext().put("roomTypeId", roomtypeid);
ServletActionContext.getContext().put("bookingid", bookingid);
return "bookingcheckin";
}
/**
* 新增预定入住
* */
@Action(value = "/sys/checkin/addbookingcheckin",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "addbookingcheckin", location = "/sys/ok.jsp")})
public String addbookingcheckin() {
//将customer组合成列表
List<Customer> customers = new ArrayList<>();
for (int i = 0; i < customerName.length; i++) {
Customer temp = new Customer();
temp.setCustomerName(customerName[i]);
temp.setCustomerSex(customerSex[i]);
temp.setCustomerPhone(customerPhone[i]);
temp.setCustomerCard(customerCard[i]);
temp.setCustomerAddress(customerAddress[i]);
customers.add(temp);
}
checkinManageService.addcheckin(roomid, accesscardID, notes, vipphone, customers);
checkinManageService.delbooking(bookingid);
return "addbookingcheckin";
}
/**
* 分页返回入住json
*
*/
@Action(value = "/sys/checkin/checkinlist",
interceptorRefs = {@InterceptorRef("MyInterceptor")})
public void checkinlist() throws IOException {
String jsonstring = this.checkinManageService.checkinPagination(page, limit);
ServletActionContext.getResponse().setContentType("application/json;charset=utf-8");
ServletActionContext.getResponse().getWriter().write(jsonstring);
}
/**
* 分页返回正在入住json
*
*/
@Action(value = "/sys/checkin/checkininglist",
interceptorRefs = {@InterceptorRef("MyInterceptor")})
public void checkininglist() throws IOException {
String jsonstring = this.checkinManageService.checkiningPagination(page, limit);
ServletActionContext.getResponse().setContentType("application/json;charset=utf-8");
ServletActionContext.getResponse().getWriter().write(jsonstring);
}
/**
* 返回一个入住详情信息json
*
*/
@Action(value = "/sys/checkin/onecheckin",
interceptorRefs = {@InterceptorRef("MyInterceptor")})
public void onecheckin() throws IOException {
String jsonstring = this.checkinManageService.onecheckin(checkinid);
ServletActionContext.getResponse().setContentType("application/json;charset=utf-8");
ServletActionContext.getResponse().getWriter().write(jsonstring);
}
/**
* 跳转到一个入住详情信息页面
*
*/
@Action(value = "/sys/checkin/checkindetails",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "checkindetails", location = "/checkin/details.jsp")})
public String checkindetails() {
ServletActionContext.getContext().put("checkinid", checkinid);
return "checkindetails";
}
/**
* 跳转到换房页面
* */
@Action(value = "/sys/checkin/exchange",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "exchange", location = "/checkin/exchange.jsp")})
public String exchange() {
ServletActionContext.getContext().put("checkinid", checkinid);
return "exchange";
}
/**
* 提交换房信息
* */
@Action(value = "/sys/checkin/updateexchange",
interceptorRefs = {@InterceptorRef("MyInterceptor")},
results = {@Result(name = "updateexchange", location = "/sys/ok.jsp")})
public String updateexchange() {
checkinManageService.updateexchange(checkinid, roomid);
return "updateexchange";
}
public void setCheckinid(String checkinid) {
this.checkinid = checkinid;
}
public void setRoomid(String roomid) {
this.roomid = roomid;
}
public void setAccesscardID(String accesscardID) {
this.accesscardID = accesscardID;
}
public void setCustomerAddress(String[] customerAddress) {
this.customerAddress = customerAddress;
}
public void setCustomerCard(String[] customerCard) {
this.customerCard = customerCard;
}
public void setCustomerName(String[] customerName) {
this.customerName = customerName;
}
public void setCustomerPhone(String[] customerPhone) {
this.customerPhone = customerPhone;
}
public void setCustomerSex(String[] customerSex) {
this.customerSex = customerSex;
}
public void setNotes(String notes) {
this.notes = notes;
}
public void setVipphone(String vipphone) {
this.vipphone = vipphone;
}
public void setRoomtypeid(String roomtypeid) {
this.roomtypeid = roomtypeid;
}
public void setBookingid(String bookingid) {
this.bookingid = bookingid;
}
public void setPage(int page) {
this.page = page;
}
public void setLimit(int limit) {
this.limit = limit;
}
}
6 、功能视频演示
基于SSH的酒店管理系统