运行环境: 最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
IDE环境:idea
硬件环境: windows 10 2G内存以上(推荐4G,4G以上更好)
用了技术框架: CSS+JavaScript+jsp+mysql+SSM+spring boot
所用的数据库: Mysql数据库,任意版本均可,也可使用各种数据库工具,例如Navicat等。
tips: 需要链接数据库的jsp程序,用到的数据库保存在源码码头的数据库平台上,为了防止童鞋们不注意删除数据,会每24小时还原一次,有较低的概率在你们演示的时候,刚插入或者刚更新,数据库就被还原了,是正常现象,你们下载到本地后,用你们自己的数据库就可以了~^_^。
适用于: 由于本程序规模不大,可供课程设计,毕业设计学习演示之用。
系统角色:管理员和酒店前台人员
管理员功能:住宿管理,房间管理,系统管理,财务管理,房间预定,员工管理,入账管理,结算管理等
前台管理:住宿管理,房间管理,系统管理,财务管理,房间预定,入账管理,结算管理,房客管理等
系统实现截图:
主页:
<div>
<!--BEGIN BACK TO TOP-->
<a id="totop" href="#"><i class="fa fa-angle-up"></i></a>
<!-- 引用头部 -->
<div th:replace="common/top::topFragment"></div>
<!--END TOPBAR-->
<div id="wrapper">
<!-- 引用左菜单导航栏 -->
<div th:replace="common/leftToolBar::leftToolbar"></div>
<!--END CHAT FORM-->
<!--BEGIN PAGE WRAPPER-->
<div id="page-wrapper">
<!-- 引用工具条 -->
<div th:replace="common/toolBar::toolBar"></div>
<!--END TITLE & BREADCRUMB PAGE-->
<!--BEGIN CONTENT-->
<!--右侧区内容的编写 -->
<div class="page-content">
<!-- 功能操作内容 -->
<div class="img1">
<img src="/images/main/a.jpg" >
</div>
<div class="div1">
<a href="/main.html" style="color: white">欢迎来到旅游景点民宿管理系统</a>
</div>
</div>
<!--END CONTENT-->
</div>
<!-- 引用底部 -->
<div th:replace="common/bottom::bottom"></div>
<!--END FOOTER-->
<!--END PAGE WRAPPER-->
</div>
</div>
房间预定:
@RequestMapping("/getOrdersList")
public String getOrdersList(@ModelAttribute(name = "name",binding = false) String name,
@ModelAttribute(name = "idNumber",binding = false) String idNumber,
@ModelAttribute(name = "typeName",binding = false) String typeName,
@ModelAttribute(name = "roomId",binding = false) String roomId,
@ModelAttribute(name = "orderStatus",binding = false) String orderStatus,
@RequestParam("pageNum") Integer pageNum,
@RequestParam("orderState") String orderState,
Model model, HttpSession session){
Employee emp = null;
Map<String,Object> map = null;
List<Orders> ordersList = null;
try {
//设置当前页和每页数量
PageHelper.startPage(pageNum,4);
//设置查询条件
map = new HashMap<>();
map.put("name",name);
map.put("idNumber",idNumber);
map.put("typeName",typeName);
map.put("roomId",roomId);
map.put("status", orderState.equals("预订中") ? Arrays.asList("2"): orderStatus.equals("0") ? Arrays.asList("1","2","8","9"):Arrays.asList(orderStatus));
ordersList = ordersService.list(map);
//获取PageInfo对象,该对象封装的分页的相关信息
PageInfo<Orders> pageInfo = new PageInfo<>(ordersList);
model.addAttribute("pageInfo",pageInfo);
} catch (Exception e) {
e.printStackTrace();
}
return orderState.equals("预订中") ? "stay/reserve/reserveList" : orderState.equals("入住结算") ? "stay/settleAccounts/settleAccounts":"stay/checkIn/checkInList";
}
入住登记:
@RequestMapping("/addCheckInRegisterOrders")
@ResponseBody
public Boolean addCheckInRegisterOrders(Orders orders,OrderDetail orderDetail,HttpSession session){
Boolean result = null;
try {
Integer count = ordersService.insertCheckInRegister(orders,orderDetail);//添加订单
result = count > 0 ? true : false;
} catch (Exception e) {
e.printStackTrace();
result = false;
}
return result;
}
账单结算:
@PostMapping("/addOrderDetail")
@ResponseBody
public Boolean addOrderDetail(OrderDetail orderDetail,HttpSession session){
Integer result = 0;
try {
result = orderDetailService.insert(orderDetail);
} catch (Exception e) {
e.printStackTrace();
}
return result > 0 ? true : false;
}
@PostMapping("/payment")
@ResponseBody
public Boolean payment(@RequestParam("ordersId") String ordersId){
Integer result = 0;
try {
//获取原来数据修改已支付金额为总金额
Orders orders = ordersService.listByOrdersId(ordersId).get(0);
orders.setRepayMoney(orders.getTotalMoney());
result = ordersService.updateAll(orders);
} catch (Exception e) {
e.printStackTrace();
}
return result > 0 ? true : false;
}
房间管理:
@RequestMapping("/toRoomType")
public String roomType(RoomType roomType, Integer pageNum, Model model) {
try {
//设置当前页和每页数量
PageHelper.startPage(pageNum,5);
//在这里看看是否有值
System.out.println("是否有值"+roomType);
//设置查询条件
List<RoomType> roomTypeList = roomTypeService.getRoomTypesByRoomType(roomType);
//获取PageInfo对象,该对象封装的分页的相关信息
PageInfo<RoomType> pageInfo = new PageInfo<>(roomTypeList);
//查询分页
model.addAttribute("pageInfo",pageInfo);
//数据回显
System.out.println("roomType----"+roomType);
model.addAttribute("roomType",roomType);
} catch (Exception e) {
e.printStackTrace();
/*message = "查询房间状态信息时出现异常:" + e.getMessage();*/
}
return "room/typeRoomSet/roomType";
}
房间设置:
@RequestMapping("/getRoomInfo")
@ResponseBody
public Object getRoomInfoWithId(String roomId){
try {
return roomService.getRoomInfoWithId(roomId);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
员工管理:
@RequestMapping("/toEmployee")
public String toEmployeeInfo(Employee employee, Integer pageNum, Model model,Integer roleId){
try {
//设置当前页和每页数量
PageHelper.startPage(pageNum,5);
//设置查询条件
if (roleId != null)
employee.getRole().setRoleId(roleId);
List<Employee> employees = employeeService.getAllEmployeeByEmployee(employee);
//获取PageInfo对象,该对象封装的分页的相关信息
PageInfo<Employee> pageInfo = new PageInfo<>(employees);
//查询分页
model.addAttribute("pageInfo",pageInfo);
//显示列表值
List<Role> roles = roleService.getAllRoleInfo();
model.addAttribute("roles",roles);
//数据回显
model.addAttribute("employee",employee);
} catch (Exception e) {
e.printStackTrace();
}
return "system/employee/employeeInfo";
}
房客管理:
@RequestMapping("/list")
public String findCustomerList(Customer customer, @RequestParam("pageNum")Integer pageNum, Model model, HttpSession session){
try {
//设置分页的页数和每页数量
PageHelper.startPage(pageNum,5);
//查询条件
//创建map集合
Map<String,Object> map = new HashMap<String, Object>();
map.put("name",customer.getName());
map.put("sex",customer.getSex());
map.put("phone",customer.getPhone());
map.put("idNumber",customer.getIdNumber());
List<Customer> list = customerService.findCustomerList(map);
//添加一条模拟数据,(用来点击修改模态框的时候不为空)
model.addAttribute("emp",new Customer(null,"sss","男","18625893214","广白云区州市",new Date(),"542222199902145896","二代身份证","汉族",null,2));
model.addAttribute("map",map);
//model.addAttribute("list",list);
//获取pageInfo对象
PageInfo<Customer> pageInfo = new PageInfo<>(list);
model.addAttribute("pageInfo",pageInfo);
} catch (Exception e) {
e.printStackTrace();
}
return "system/tenantPage/tenantList";
}
修改个人密码:
@ResponseBody
@RequestMapping("/updatePassword")
public Map<String, Object> updatePassword(Integer empId, String newPassword, Model model, HttpSession session) {
Map<String,Object> map = new HashMap<String, Object>();
try {
Employee employee = (Employee) session.getAttribute(ConstantValue.LOGIN_USER);
if (employee != null) {
employeeService.update(empId, newPassword);
map.put("success", true);
} else {
map.put("success", false);
}
} catch (Exception e) {
e.printStackTrace();
}
return map;
}
日志查看:
@RequestMapping("/toLogging")
public String toLogging(LoggingQueryVo loggingQueryVo,Integer pageNum,Model model) {
//2019-07-10 22:38:10.0
try {
//设置当前页和每页数量
PageHelper.startPage(pageNum,5);
//设置查询条件
List<Logging> loggingLists = loggingService.getAllLoggingLists(loggingQueryVo);
//获取PageInfo对象,该对象封装的分页的相关信息
PageInfo<Logging> pageInfo = new PageInfo<>(loggingLists);
//查询分页
model.addAttribute("pageInfo",pageInfo);
//数据回显
model.addAttribute("loggingQueryVo",loggingQueryVo);
} catch (Exception e) {
e.printStackTrace();
}
return "room/logging/loggingInfo";
}
财务查看:
// 指定图表的配置项和数据
var option = {
title: {
text: '收入'
},
tooltip: {
trigger: 'axis'
},
toolbox: {
show: true,
feature: {
dataZoom: {
yAxisIndex: 'none'
}, //区域缩放,区域缩放还原
dataView: {
readOnly: false
}, //数据视图
magicType: {
type: ['line', 'bar']
}, //切换为折线图,切换为柱状图
restore: {}, //还原
saveAsImage: {} //保存为图片
}
},
系统适用于课程设计或者毕业设计参考学习使用,如有需要,可联系博主详聊