基于javaweb的SpringBoot酒店管理系统(java+springboot+maven+mybatis-plus+html+thymeleaf+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

011424060701

021424060701

031424060701

041424060701

051424060701

061424060701

071424060701

081424060701

091424060701

101424060701

基于javaweb的SpringBoot酒店管理系统(java+springboot+maven+mybatis-plus+html+thymeleaf+mysql)

项目介绍

角色:管理员、前台工作人员、保洁阿姨、客户 四种角色

客户功能:

客户注册、登录、找回密码

留言板查看和留言

浏览客房,根据入住日期和退房日期查询和预定客房

支付订单,支付已对接了支付宝沙箱支付,可可以随时关闭启动

客户可以退房,续订,取消订单等功能

管理员功能:

客房管理

客房类型管理

订单管理

入住登记管理

退房登记管理

客房清洁管理

留言管理(只有管理员可以进行留言删除)

财务管理

人员管理( 前台人员,清洁人员,客户)

角色管理,权限管理

酒店前台人员:

订单管理

入住登记管理

退房登记管理

客房清洁管理(只能查看)

留言管理,(可以留言回复,不能删除留言)

财务管理

人员管理( 只能看客户) 理、民宿信息管理、房间类型管理、房间信息管理、房间预订管理、房间退订管理、投诉反馈管理、我的收藏管理、系统管理。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

4.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目;

5.数据库:MySql 5.7/8.0等版本均可;

技术栈

后端:SpringBoot+MyBatis-Plus

前端:Html+CSS+jquery+Thymleaf

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

文档介绍(我的订单功能详细设计、浏览客房功能详细设计、房间管理功能详情设计、订单管理功能详情设计、入住管理功能详细设计、营业统计功能详细设计、系统实现、前台管理模块、预定房间、我的订单功能、浏览客房功能、后台管理模块、房间管理、订单管理、入住管理、营业统计功能、系统测试、系统测试目的、测试环境与测试条件、测试用例):

酒店管理首页详情展示: 

酒店详情信息介绍: 

留言板详情展示:

客房列表详情展示:

结算详情信息展示:

酒店后台功能列表展示-财务管理:

酒店后台功能列表展示-订单管理:

酒店后台功能列表展示-订单管理:

酒店后台功能列表展示-客房管理:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
    post.setCategory(category);
model.addAttribute("post", post);

String[] imgUrlList = post.getImgUrl().split(",");
model.addAttribute("imgUrlList", imgUrlList);


// 该房间的预定记录
List<Record> recordList = recordService.findByPostId(id);
model.addAttribute("recordList", recordList);

// 分类列表
List<Category> categoryList = categoryService.findAll();
model.addAttribute("categoryList", categoryList);

model.addAttribute("startDate", start);
model.addAttribute("endDate", end);
return "home/post";
}


/**
* 结算页面
*
* @param postId
* @param start
* @param model
* @return
*/
@GetMapping("/checkout")
public String checkout(@RequestParam("postId") Long postId,
@RequestParam(value = "startDate", required = false) String start,
@RequestParam(value = "endDate", required = false) String end,
Model model) {
DateFormat dateFormat = new SimpleDateFormat(DateUtil.FORMAT);

Date today = new Date();
Date tomorrow = DateUtil.dateAddOne(today);

// 判断入住日期是否合法
Date startDate = null;
if (StringUtils.isEmpty(start)) {
start = dateFormat.format(today);
} else {
try {
startDate = dateFormat.parse(start);
if (startDate.before(today)) {
start = dateFormat.format(today);
}
} catch (ParseException e) {
start = dateFormat.format(today);
e.printStackTrace();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* 查询所有清除记录并渲染Clean页面
*
* @return 模板路径admin/admin_clean
*/
@GetMapping
public String cleanList(@RequestParam(value = "status", defaultValue = "-1") Integer status,
@RequestParam(value = "page", defaultValue = "0") Integer pageNumber,
@RequestParam(value = "size", defaultValue = "10") Integer pageSize,
@RequestParam(value = "sort", defaultValue = "createTime") String sort,
@RequestParam(value = "order", defaultValue = "desc") String order, Model model) {
Page page = PageUtil.initMpPage(pageNumber, pageSize, sort, order);
QueryCondition queryCondition = new QueryCondition();
Clean clean = new Clean();
clean.setStatus(status);
queryCondition.setData(clean);
Page<Clean> CleanPage = cleanService.findAll(page, queryCondition);
model.addAttribute("cleanList", CleanPage.getRecords());
model.addAttribute("pageInfo", PageUtil.convertPageVo(page));
model.addAttribute("status", status);

User user = getLoginUser();
Role currentRole = roleService.findByUserId(user.getId());
model.addAttribute("currentRole", currentRole);
return "admin/admin_clean";
}

/**
* 新增/修改清除记录目录
*
* @param clean
* @return 重定向到/admin/Clean
*/
@PostMapping(value = "/save")
@ResponseBody
public JsonResult saveClean(@ModelAttribute Clean clean) {
cleanService.insertOrUpdate(clean);
return JsonResult.success("保存成功");
}

/**
* 删除清除记录
*
* @param cateId 清除记录Id
* @return JsonResult
*/
@PostMapping(value = "/delete")
@ResponseBody
public JsonResult delete(@RequestParam("id") Long cateId) {

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    condition.setStatus(status);
if (!StringUtils.isBlank(keywords)) {
if (USER_NAME.equals(searchType)) {
condition.setUserName(keywords);
} else if (USER_DISPLAY_NAME.equals(searchType)) {
condition.setUserDisplayName(keywords);
} else if (EMAIL.equals(searchType)) {
condition.setIdCard(keywords);
}
}
String role = RoleEnum.CLEANER.getValue();
Page<User> users = userService.findByRoleAndCondition(role, condition, page);

//角色列表
Integer maxLevel = roleService.findMaxLevelByUserId(getLoginUserId());
List<Role> roles = roleService.findByLessThanLevel(maxLevel);
model.addAttribute("roles", roles);
model.addAttribute("users", users.getRecords());
model.addAttribute("pageInfo", PageUtil.convertPageVo(page));
model.addAttribute("status", status);
model.addAttribute("keywords", keywords);
model.addAttribute("searchType", searchType);
model.addAttribute("sort", sort);
model.addAttribute("order", order);
model.addAttribute("currentRole", role);
return "admin/admin_user";
}


/**
* 删除用户
*
* @param userId 用户Id
* @return JsonResult
*/
@PostMapping(value = "/delete")
@ResponseBody
public JsonResult removeUser(@RequestParam("id") Long userId) {
userService.delete(userId);
return JsonResult.success("删除成功");
}

/**
* 添加用户页面
*
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
        List<Post> postList = postService.findByBatchIds(ids);
//3、如果当前状态为回收站,则删除;否则,移到回收站
for (Post post : postList) {
if (Objects.equals(post.getPostStatus(), PostStatusEnum.RECYCLE.getCode())) {
postService.delete(post.getId());
} else {
post.setPostStatus(PostStatusEnum.RECYCLE.getCode());
postService.update(post);
}
}
return JsonResult.success("删除成功");
}


/**
* 跳转到编辑客房页面
*
* @param postId 客房编号
* @param model model
* @return 模板路径admin/admin_editor
*/
@GetMapping(value = "/edit")
public String editPost(@RequestParam("id") Long postId, Model model) {
Post post = postService.get(postId);
if (post == null) {
throw new MyBusinessException("客房不存在");
}

//当前客房分类
Category category = categoryService.get(post.getCateId());
post.setCategory(category);
model.addAttribute("post", post);


//所有分类
List<Category> allCategories = categoryService.findAll();
model.addAttribute("categories", allCategories);
return "admin/admin_post_edit";
}




}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 * 处理跳转到新建客房页面
*
* @return 模板路径admin/admin_editor
*/
@GetMapping(value = "/new")
public String newPost(Model model) {
//所有分类
List<Category> allCategories = categoryService.findAll();
model.addAttribute("categories", allCategories);
return "admin/admin_post_new";
}



/**
* 添加/更新客房
*
* @param post Post实体
*/
@PostMapping(value = "/save")
@ResponseBody
public JsonResult pushPost(@ModelAttribute Post post) {
// 1、提取摘要
int postSummary = 100;
//客房摘要
String summaryText = HtmlUtil.cleanHtmlTag(post.getPostContent());
if (summaryText.length() > postSummary) {
String summary = summaryText.substring(0, postSummary);
post.setPostSummary(summary);
} else {
post.setPostSummary(summaryText);
}

// 2.处理imgUrl
String postEditor = post.getPostEditor();
if(StringUtils.isNotEmpty(postEditor)) {
List<String> urlList = RegexUtil.getImgSrc(postEditor);
String imgUrl = SensUtils.listToStr(urlList);
post.setImgUrl(imgUrl);
}

// 2.添加/更新入库
postService.insertOrUpdate(post);
return JsonResult.success("发布成功");
}



项目链接:
https://javayms.github.io?id=301524190701201km
https://javayms.pages.dev?id=301524190701201km