基于javaweb+mysql的酒店宾馆管理系统(java+SpringBoot+html+layui+jQuery+maven+mysql)

基于javaweb+mysql的酒店宾馆管理系统(java+SpringBoot+html+layui+jQuery+maven+mysql),第1张

功能介绍
springboot酒店宾馆管理系统。该系统为后管系统,无前台。主要分三种角色:管理者/工作人员/前台人员。

主要功能有:
客房:客房标准、房间信息;
订单:入住订单;
员工:员工信息;
事务:事务信息;
停车:车位信息;
财务:财务信息;
历史:订单历史、车库历史;
会员:会员信息;

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

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目

6.数据库:MySql 8.0版本;

技术栈

后端:SpringBoot

前端:html+layui+jQuery

使用说明

使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,下载所需jar包;

使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

将项目中db.properties配置文件中的数据库配置改为自己的配置

配置tomcat,然后运行项目,输入localhost:8888 登录

数据库中的employ中有密码,密码是加密过的,三种权限,管理者/工作人员/前台人员
管理账号:admin 密码:worker1
工作人员账号:worker1 密码:worker1

前台人员:sever1 密码:worker1




适用

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

		Map<String,String> retMap = new HashMap<String, String>();
		if(account == null){
			retMap.put("type", "error");
			retMap.put("msg", "请填写正确的用户信息!");
			return retMap;
		}
		if(StringUtils.isEmpty(account.getName())){
			retMap.put("type", "error");
			retMap.put("msg", "用户名不能为空!");
			return retMap;
		}
		if(StringUtils.isEmpty(account.getPassword())){
			retMap.put("type", "error");
			retMap.put("msg", "密码不能为空!");
			return retMap;
		}
		if(StringUtils.isEmpty(vcode)){
			retMap.put("type", "error");
			retMap.put("msg", "验证码不能为空!");
			return retMap;
		}
		Object attribute = request.getSession().getAttribute("accountLoginCpacha");
		if(attribute == null){
		if(StringUtils.isEmpty(ids)){
			ret.put("type", "error");
			ret.put("msg", "请选择相应的权限!");
			return ret;
		}
		if(roleId == null){
			ret.put("type", "error");
			ret.put("msg", "请选择相应的角色!");
			return ret;
		}
		if(ids.contains(",")){
			ids = ids.substring(0,ids.length()-1);
		}
		String[] idArr = ids.split(",");
		if(idArr.length > 0){
			authorityService.deleteByRoleId(roleId);
		}
		for(String id:idArr){
			Authority authority = new Authority();
			authority.setMenuId(Long.valueOf(id));
			authority.setRoleId(roleId);
			authorityService.add(authority);
		}
		ret.put("type", "success");
		ret.put("msg", "修改成功!");
		return ret;
	}
	
	/**
	 * 分页查询房间信息
	 * @param sn
	 * @param page
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.POST)
	@ResponseBody
	public Map<String,Object> list(
			@RequestParam(name="sn",defaultValue="") String sn,
			@RequestParam(name="status",required=false) Integer status,
			@RequestParam(name="roomTypeId",required=false) Long roomTypeId,
			@RequestParam(name="floorId",required=false) Long floorId,
			Page page
			){
		Map<String,Object> ret = new HashMap<String, Object>();
		Map<String,Object> queryMap = new HashMap<String, Object>();
		queryMap.put("sn", sn);
		queryMap.put("status", status);
		queryMap.put("roomTypeId", roomTypeId);
前台首页控制器:
/**
 * 前台首页控制器
 * @author yy
 *
 */
@RequestMapping("/home")
@Controller
public class HomeController {
	
	@Autowired
	private RoomTypeService roomTypeService;
	@Autowired
	private AccountService accountService;
	
	/**
	 * 前台首页
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, String> edit(RoomType roomType){
		Map<String, String> ret = new HashMap<String, String>();
		if(roomType == null){
			ret.put("type", "error");
			ret.put("msg", "请填写正确的房间类型信息!");
			return ret;
		}
		if(StringUtils.isEmpty(roomType.getName())){
			ret.put("type", "error");
			ret.put("msg", "房间类型名称不能为空!");
			return ret;
		}
		Map<String, String> ret = new HashMap<String, String>();
		if(room == null){
			ret.put("type", "error");
			ret.put("msg", "请填写正确的房间信息!");
			return ret;
		}
		if(StringUtils.isEmpty(room.getSn())){
			ret.put("type", "error");
			ret.put("msg", "房间编号不能为空!");
			return ret;
		}
		if(room.getRoomTypeId() == null){
			ret.put("type", "error");
			ret.put("msg", "请选择房间类型!");
			return ret;
		}
		if(room.getFloorId() == null){
			ret.put("type", "error");
				ret.put("msg", "房间数设置不合理!");
				return ret;
			}
		}
		if(roomTypeService.edit(roomType) <= 0){
			ret.put("type", "error");
			ret.put("msg", "修改失败,请联系管理员!");
			return ret;
		}
		ret.put("type", "success");
		ret.put("msg", "修改成功!");
		return ret;
	}
	
	/**
	 * 分页查询房间类型信息
	 * @param name
	 * @param page
	 * @return
	public Map<String, String> edit(User user){
		Map<String, String> ret = new HashMap<String, String>();
		if(user == null){
			ret.put("type", "error");
			ret.put("msg", "请填写正确的用户信息!");
			return ret;
		}
		if(StringUtils.isEmpty(user.getUsername())){
			ret.put("type", "error");
			ret.put("msg", "请填写用户名!");
			return ret;
		}
//		if(StringUtils.isEmpty(user.getPassword())){
//			ret.put("type", "error");
//			ret.put("msg", "请填写密码!");
//			return ret;
//		}
		if(user.getRoleId() == null){
			ret.put("type", "error");
			ret.put("msg", "请选择所属角色!");
			return ret;
		}
		if(isExist(user.getUsername(), user.getId())){
			ret.put("type", "error");
			ret.put("msg", "该用户名已经存在,请重新输入!");
@Controller
public class RoomController {
	
	@Autowired
	private RoomTypeService roomTypeService;
	
	@Autowired
	private RoomService roomService;
	
	@Autowired
	private FloorService floorService;
	
	/**
	 * 房间管理列表页面
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.GET)
	
	
	/**
	 * 房间类型管理列表页面
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.GET)
	public ModelAndView list(ModelAndView model){
		model.setViewName("room_type/list");
		return model;
	}
	
	/**
	 * 房间类型信息添加 *** 作
	 * @param roomType
	 * @return
	 */
	@RequestMapping(value="/add",method=RequestMethod.POST)

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1322894.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-12
下一篇2022-06-12

发表评论

登录后才能评论

评论列表(0条)

    保存