源码获取:博客首页 "资源" 里下载!
主要技术:java springmvc mybatis mysql tomcat js jauery jsp log4j等一些常见基本技术适用于Java毕设和学习使用
主要实现:
前台:登录、注册、酒店信息浏览、搜索酒店信息、查看房间、预定房间、等
后台:部门管理、房间管理、楼层管理、订单管理、入住管理、营业额报表、承担控制权限、员工管理、角色管理、预定报表等
主要功能截图如下:
前端登陆注册和一些基本信息查看等
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/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;}
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%;}
</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">
<button class="layui-btn layui-btn layui-btn-normal layui-btn-fluid" lay-submit="" lay-filter="login" id="submitBtn">登 入</button>
</div>
</form>
</div>
</div>
</div>
<script src="${APP_PATH}/statics/layui/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="${APP_PATH}/statics/layui/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="${APP_PATH}/statics/layui/lib/jq-module/jquery.particleground.min.js" charset="utf-8"></script>
<script>
layui.use(['form','layer','jquery'], function () {
var form = layui.form,
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>
</body>
</html>
首页:
房间的预定:
房间的介绍
面积:15-18㎡ | 床型:大床1.8米 | 可住: | 网络: 包含无线、宽带 | 楼层:7层-8层
客房设施:空调
媒体科技:电视机
食品饮品:瓶装水
浴室:室内卫生间、室内洗浴间
预定房间录入相关信息:
酒店后台管理:
酒店后台具体功能比较多:
部门信息管理:
房间信息管理:
楼层信息管理:
房间型号管理:
订单信息管理:
入住管理:
图表:
菜单信息管理:
编辑
员工管理:
角色分配菜单:
源码结构和表ER图:
商品业务控制层:
/**
* <p>
* 前端控制器
* </p>
*
*/
@RestController
@RequestMapping("/goods")
public class GoodsController {
@Autowired
private GoodsService goodsService;
@Autowired
private ProviderService providerService;
@Autowired
private CategoryService categoryService;
/**
* 商品模糊查询
*
* @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("/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 bool = goodsService.save(goods);
if (bool) {
return Result.success(true, "200", "添加成功!");
}
return Result.error(false, null, "添加失败!");
}
/**
* 修改商品信息
*
* @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, "修改失败!");
}
/**
* 删除单条数据
*
* @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查询当前商品拥有的类别
*
* @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);
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;
}
}
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);
Goods goods = goodsService.getById(goodsid);
return new DataGridViewResult(goods);
}
/**
* 为商品分配类别
*
* @param categoryids
* @param goodsid
* @return
*/
@SysLog("类别添加操作")
@RequestMapping("/saveGoodsCategory")
public Result saveGoodsCategory(String categoryids, int goodsid) {
try {
if (goodsService.saveGoodsCategory(goodsid, categoryids)) {
return Result.success(true, null, "分配成功");
}
} catch (Exception e) {
e.printStackTrace();
}
return Result.error(false, null, "分配失败");
}
/**
* 加载下拉框
*
* @return
*/
@RequestMapping("/loadAllGoods")
public DataGridViewResult loadAllGoods() {
QueryWrapper<Goods> queryWrapper = new QueryWrapper<>();
List<Goods> list = goodsService.list(queryWrapper);
return new DataGridViewResult(list);
}
/**
* 根据供应商查商品下拉框
*
* @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());
}
}
return new DataGridViewResult(list);
}
}
源码获取:博客首页 "资源" 里下载!