基于javaweb+jsp的酒店管理系统(java+SSM+jsp+mysql+maven)
主要技术:java springmvc mybatis mysql tomcat js jquery jsp log4j等一些常见基本技术适用于Java毕设和学习使用
主要实现:
前台:登录、注册、酒店信息浏览、搜索酒店信息、查看房间、预定房间、等
后台:部门管理、房间管理、楼层管理、订单管理、入住管理、营业额报表、承担控制权限、员工管理、角色管理、预定报表等
主要功能截图如下:
前端登陆注册和一些基本信息查看等
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
* 根据供应商查商品下拉框** @param providerid* @return*/@RequestMapping("/loadGoodsByProvidreId")public DataGridViewResult loadGoodsByProvidreId(Integer providerid) {QueryWrapper<Goods> goodsQueryWrapper = new QueryWrapper<>();goodsQueryWrapper.eq(providerid != null, "providerid", providerid);List<Goods> list = goodsService.list(goodsQueryWrapper);for (Goods goods : list) {
}}<%@ page contentType="text/html;charset=UTF-8" language="java" %><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>酒店管理系统</title><%pageContext.setAttribute("APP_PATH", request.getContextPath());%><link rel="icon" href="${App_PATH}/statics/layui/images/favicon.ico"><link rel="stylesheet" href="${APP_PATH}/statics/layui/lib/layui-v2.5.5/css/layui.css" media="all"><![endif]--><style>html, body {width: 100%;height: 100%;overflow: hidden}body {background: #1E9FFF;}
layer = layui.layer,$=layui.jquery;// 粒子线条背景$(document).ready(function(){$('.layui-container').particleground({dotColor:'#7ec7fd',lineColor:'#7ec7fd'});});// 进行登录操作form.on('submit(login)', function (data) {console.log(data);//发送请求$.post("/admin/employee/login",data.field,function (result) {if (result.success){location.href="home.html";}else {layer.msg(result.message);}},"json")return false;});});</script>
面积:15-18㎡ | 床型:大床1.8米 | 可住: | 网络: 包含无线、宽带 | 楼层:7层-8层客房设施:空调媒体科技:电视机食品饮品:瓶装水浴室:室内卫生间、室内洗浴间预定房间录入相关信息:酒店后台管理:酒店后台具体功能比较多:部门信息管理:房间信息管理:楼层信息管理:房间型号管理:订单信息管理:入住管理:图表:菜单信息管理:员工管理:角色分配菜单:源码结构和表ER图:商品业务控制层:/*** <p>* 前端控制器* </p>
}map.put("LAY_CHECKED", flag);}} catch (Exception e) {e.printStackTrace();}return new DataGridViewResult(Long.valueOf(mapList.size()), mapList);}/*** 根据商品id加载商品信息* @param goodsid* @return*/@GetMapping("/loadGoodsById")public DataGridViewResult loadGoodsById(int goodsid) {QueryWrapper<Goods> goodsQueryWrapper = new QueryWrapper<>();goodsQueryWrapper.eq(goodsid != 0, "gid", goodsid);
}/*** 根据供应商查商品下拉框** @param providerid* @return*/@RequestMapping("/loadGoodsByProvidreId")public DataGridViewResult loadGoodsByProvidreId(Integer providerid) {QueryWrapper<Goods> goodsQueryWrapper = new QueryWrapper<>();goodsQueryWrapper.eq(providerid != null, "providerid", providerid);List<Goods> list = goodsService.list(goodsQueryWrapper);for (Goods goods : list) {Provider provider = providerService.getById(goods.getProviderid());if (null != provider) {goods.setProvidername(provider.getProvidername());}
body {background: #1E9FFF;}body:after {content:'';background-repeat:no-repeat;background-size:cover;-webkit-filter:blur(3px);-moz-filter:blur(3px);-o-filter:blur(3px);-ms-filter:blur(3px);filter:blur(3px);position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;}.layui-container {width: 100%;height: 100%;overflow: hidden}.admin-login-background {width:360px;height:300px;position:absolute;left:50%;top:40%;margin-left:-180px;margin-top:-100px;}.logo-title {text-align:center;letter-spacing:2px;padding:14px 0;}.logo-title h1 {color:#1E9FFF;font-size:25px;font-weight:bold;}.login-form {background-color:#fff;border:1px solid #fff;border-radius:3px;padding:14px 20px;box-shadow:0 0 8px #eeeeee;}.login-form .layui-form-item {position:relative;}.login-form .layui-form-item label {position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;color:#d2d2d2;}.login-form .layui-form-item input {padding-left:36px;}.captcha {width:60%;display:inline-block;}.captcha-img {display:inline-block;width:34%;float:right;}.captcha-img img {height:34px;border:1px solid #e6e6e6;height:36px;width:100%;}
$.post("/admin/employee/login",data.field,function (result) {if (result.success){location.href="home.html";}else {layer.msg(result.message);}},"json")return false;});});</script></body></html>首页:房间的预定:房间的介绍面积:15-18㎡ | 床型:大床1.8米 | 可住: | 网络: 包含无线、宽带 | 楼层:7层-8层客房设施:空调媒体科技:电视机食品饮品:瓶装水浴室:室内卫生间、室内洗浴间预定房间录入相关信息:酒店后台管理:
public Result updateGoods(Goods goods) {//商品图片不是默认图片if (!(goods.getGoodsimg()!=null&&goods.getGoodsimg().equals(Constast.DEFAULT_IMG))){if (goods.getGoodsimg().endsWith("_temp")){String newName = AppFileUtils.renameFile(goods.getGoodsimg());goods.setGoodsimg(newName);//删除原先的图片String oldPath = goodsService.getById(goods.getGid()).getGoodsimg();AppFileUtils.removeFileByPath(oldPath);}}boolean bool = goodsService.updateById(goods);if (bool) {
<div class="layui-form login-form"><form class="layui-form" action="login"><div class="layui-form-item logo-title"><h1>酒店管理系统</h1></div><div class="layui-form-item"><label class="layui-icon layui-icon-username"></label><input type="text" name="userName" lay-verify="required|account" placeholder="请填写账号" autocomplete="off" class="layui-input" ></div><div class="layui-form-item"><label class="layui-icon layui-icon-password"></label><input type="password" name="password" lay-verify="required|password" placeholder="密码" autocomplete="off" class="layui-input" ></div>
int cateId = (int) map.get("cateid");for (Integer cid : cateIdList) {if (cid == cateId) {flag = true;break;}}map.put("LAY_CHECKED", flag);}} catch (Exception e) {e.printStackTrace();}return new DataGridViewResult(Long.valueOf(mapList.size()), mapList);}/*** 根据商品id加载商品信息* @param goodsid* @return
}}boolean bool = goodsService.updateById(goods);if (bool) {return Result.success(true, "200", "修改成功!");}return Result.error(false, null, "修改失败!");}/*** 删除单条数据** @param id* @return*/@SysLog("商品删除操作")
});});// 进行登录操作form.on('submit(login)', function (data) {console.log(data);//发送请求$.post("/admin/employee/login",data.field,function (result) {if (result.success){location.href="home.html";}else {layer.msg(result.message);
/*** <p>* 前端控制器* </p>**/@RestController@RequestMapping("/goods")public class GoodsController {@Autowiredprivate GoodsService goodsService;@Autowiredprivate ProviderService providerService;@Autowiredprivate CategoryService categoryService;/*** 商品模糊查询*
e.printStackTrace();}return new DataGridViewResult(Long.valueOf(mapList.size()), mapList);}/*** 根据商品id加载商品信息* @param goodsid* @return*/@GetMapping("/loadGoodsById")public DataGridViewResult loadGoodsById(int goodsid) {QueryWrapper<Goods> goodsQueryWrapper = new QueryWrapper<>();goodsQueryWrapper.eq(goodsid != 0, "gid", goodsid);Goods goods = goodsService.getById(goodsid);
public DataGridViewResult initGoodsByCategoryId(int id) {List<Map<String, Object>> mapList = null;try {//查询所有类别列表mapList = categoryService.listMaps();//根据商品id查询商品拥有的类别Set<Integer> cateIdList = categoryService.findGoodsByCategoryId(id);for (Map<String, Object> map : mapList) {//定义标记 默认不选中boolean flag = false;int cateId = (int) map.get("cateid");for (Integer cid : cateIdList) {if (cid == cateId) {flag = true;break;
** @param id* @return*/@RequestMapping("/initGoodsByCategoryId")public DataGridViewResult initGoodsByCategoryId(int id) {List<Map<String, Object>> mapList = null;try {//查询所有类别列表mapList = categoryService.listMaps();//根据商品id查询商品拥有的类别Set<Integer> cateIdList = categoryService.findGoodsByCategoryId(id);
boolean bool = goodsService.updateById(goods);if (bool) {return Result.success(true, "200", "修改成功!");}return Result.error(false, null, "修改失败!");}/*** 删除单条数据** @param id* @return*/@SysLog("商品删除操作")@RequestMapping("/deleteOne")public Result deleteOne(int id) {boolean bool = goodsService.removeById(id);if (bool) {return Result.success(true, "200", "删除成功!");}return Result.error(false, null, "删除失败!");}/*** 根据id查询当前商品拥有的类别
酒店后台具体功能比较多:部门信息管理:房间信息管理:楼层信息管理:房间型号管理:订单信息管理:入住管理:图表:菜单信息管理:员工管理:角色分配菜单:源码结构和表ER图:商品业务控制层:/**
.login-form .layui-form-item label {position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;color:#d2d2d2;}.login-form .layui-form-item input {padding-left:36px;}.captcha {width:60%;display:inline-block;}.captcha-img {display:inline-block;width:34%;float:right;}.captcha-img img {height:34px;border:1px solid #e6e6e6;height:36px;width:100%;}</style></head><body><div class="layui-container"><div class="admin-login-background"><div class="layui-form login-form"><form class="layui-form" action="login"><div class="layui-form-item logo-title"><h1>酒店管理系统</h1></div><div class="layui-form-item"><label class="layui-icon layui-icon-username"></label><input type="text" name="userName" lay-verify="required|account" placeholder="请填写账号" autocomplete="off" class="layui-input" ></div><div class="layui-form-item"><label class="layui-icon layui-icon-password"></label><input type="password" name="password" lay-verify="required|password" placeholder="密码" autocomplete="off" class="layui-input" ></div><div class="layui-form-item">
});</script></body></html>首页:房间的预定:房间的介绍面积:15-18㎡ | 床型:大床1.8米 | 可住: | 网络: 包含无线、宽带 | 楼层:7层-8层客房设施:空调媒体科技:电视机
.logo-title h1 {color:#1E9FFF;font-size:25px;font-weight:bold;}.login-form {background-color:#fff;border:1px solid #fff;border-radius:3px;padding:14px 20px;box-shadow:0 0 8px #eeeeee;}.login-form .layui-form-item {position:relative;}.login-form .layui-form-item label {position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;color:#d2d2d2;}.login-form .layui-form-item input {padding-left:36px;}.captcha {width:60%;display:inline-block;}.captcha-img {display:inline-block;width:34%;float:right;}.captcha-img img {height:34px;border:1px solid #e6e6e6;height:36px;width:100%;}</style></head><body><div class="layui-container"><div class="admin-login-background"><div class="layui-form login-form"><form class="layui-form" action="login"><div class="layui-form-item logo-title"><h1>酒店管理系统</h1></div><div class="layui-form-item"><label class="layui-icon layui-icon-username"></label><input type="text" name="userName" lay-verify="required|account" placeholder="请填写账号" autocomplete="off" class="layui-input" ></div><div class="layui-form-item">
/*** 商品模糊查询** @param* @return*/@SysLog("商品查询操作")@RequestMapping("/goodsList")public DataGridViewResult goodsList(GoodsVO goodsVO) {//创建分页信息 参数1 当前页 参数2 每页显示条数IPage<Goods> page = new Page<>(goodsVO.getPage(), goodsVO.getLimit());QueryWrapper<Goods> queryWrapper = new QueryWrapper<>();queryWrapper.eq(goodsVO.getProviderid() != null && goodsVO.getProviderid() != 0, "providerid", goodsVO.getProviderid());queryWrapper.like(!StringUtils.isEmpty(goodsVO.getGname()), "gname", goodsVO.getGname());IPage<Goods> goodsIPage = goodsService.page(page, queryWrapper);List<Goods> records = goodsIPage.getRecords();for (Goods goods : records) {Provider provider = providerService.getById(goods.getProviderid());if (null != provider) {goods.setProvidername(provider.getProvidername());}}return new DataGridViewResult(goodsIPage.getTotal(), records);
* @param goods* @return*/@SysLog("商品修改操作")@PostMapping("/updategoods")public Result updateGoods(Goods goods) {//商品图片不是默认图片if (!(goods.getGoodsimg()!=null&&goods.getGoodsimg().equals(Constast.DEFAULT_IMG))){if (goods.getGoodsimg().endsWith("_temp")){String newName = AppFileUtils.renameFile(goods.getGoodsimg());goods.setGoodsimg(newName);//删除原先的图片String oldPath = goodsService.getById(goods.getGid()).getGoodsimg();AppFileUtils.removeFileByPath(oldPath);}}boolean bool = goodsService.updateById(goods);if (bool) {return Result.success(true, "200", "修改成功!");}return Result.error(false, null, "修改失败!");
Provider provider = providerService.getById(goods.getProviderid());if (null != provider) {goods.setProvidername(provider.getProvidername());}}return new DataGridViewResult(goodsIPage.getTotal(), records);}/*** 添加商品信息** @param goods* @return*/@SysLog("商品添加操作")@PostMapping("/addgoods")public Result addGoods(Goods goods) {String id = RandomStringUtils.randomAlphanumeric(8);if (goods.getGoodsimg()!=null&&goods.getGoodsimg().endsWith("_temp")){String newName = AppFileUtils.renameFile(goods.getGoodsimg());goods.setGoodsimg(newName);}goods.setGnumbering(id);
//定义标记 默认不选中boolean flag = false;int cateId = (int) map.get("cateid");for (Integer cid : cateIdList) {if (cid == cateId) {flag = true;break;}}map.put("LAY_CHECKED", flag);
角色分配菜单:源码结构和表ER图:商品业务控制层:/*** <p>* 前端控制器* </p>**/@RestController@RequestMapping("/goods")
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
如果觉得《基于javaweb+jsp的酒店管理系统(java+SSM+jsp+mysql+maven)》对你有帮助,请点赞、收藏,并留下你的观点哦!