基于javaweb+mysql的ssm酒店人事管理系统(java+ssm+jsp+jquery+ajax+mysql)

基于javaweb+mysql的ssm酒店人事管理系统(java+ssm+jsp+jquery+ajax+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

基于javaweb+mysql的SSM酒店人事管理系统(java+ssm+jsp+jquery+ajax+mysql)

一、项目运行

环境配置:

Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)

项目技术:

JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax 等等

map.put(SystemConstant.MESSAGE,"删除成功");

}else{

map.put(SystemConstant.SUCCESS,false);//删除失败

map.put(SystemConstant.MESSAGE,"删除失败");

return JSON.toJSONString(map);

//查看该角色编号下是否有员工

@RequestMapping("/checkRoleHasEmployee")

public String checkDeptHasEmployee(Integer id){

Map<String,Object> map = new HashMap<String, Object>();

int countById = employeeService.getEmployeeCountByRoleId(id);

if (countById>0){

//该角色是否有员工在用

map.put(SystemConstant.EXISI,true);

map.put(SystemConstant.MESSAGE,"用户名存在,请重新输入");

}else{

map.put(SystemConstant.EXISI,false);

return JSON.toJSONString(map);

房间管理控制层:

@Controller

@RequestMapping("/room")

public class RoomController {

@Resource

private RoomService roomService;

@Resource


List<Role> roleList = roleService.findRoleList(roleVo);

//创建分页对象

PageInfo<Role> pageInfo = new PageInfo<Role>(roleList);

//返回数据

return new DataGridViewResult(pageInfo.getTotal(),pageInfo.getList());

//添加部门信息

@RequestMapping("/addRole")

public String addRole(Role role){

//创建map存放信息

Map<String,Object> map = new HashMap<String, Object>();

int addRole = roleService.addRole(role);

if(addRole>0){

@RestController

public class RoleController {

@Autowired

private RoleService roleService;

@Autowired

private EmployeeService employeeService;

@Autowired

private MenuService menuService;

/**

* 角色列表查询

* @return

*/

//保存登录用户信息到session中

Session.setAttribute(SystemConstant.FRONT_LOGIN_USER,loginUser);

}else{

map.put(SystemConstant.SUCCESS,false);

map.put(SystemConstant.MESSAGE,"用户名或密码错误,请重新登录!");

return JSON.toJSONString(map);

/**

* 根据用户名查询用户信息

* @param loginName

* @return

*/


* @param user

* @return

*/

@RequestMapping("/register")

@ResponseBody

public String register(User user){

Map<String,Object> map = new HashMap<String,Object>();

//调用注册的方法

if(userService.addUser(user)>0){

map.put(SystemConstant.SUCCESS,true);

map.put(SystemConstant.MESSAGE,"恭喜你,注册成功!");

}else{

map.put(SystemConstant.SUCCESS,false);


}else{

map.put(SystemConstant.SUCCESS,false);//删除失败

map.put(SystemConstant.MESSAGE,"删除失败");

return JSON.toJSONString(map);

//查看该角色编号下是否有员工

@RequestMapping("/checkRoleHasEmployee")

public String checkDeptHasEmployee(Integer id){

Map<String,Object> map = new HashMap<String, Object>();

int countById = employeeService.getEmployeeCountByRoleId(id);

if (countById>0){

//该角色是否有员工在用

map.put(SystemConstant.EXISI,true);//存在

*/

@RequestMapping("/initRoleListByEmpId")

public DataGridViewResult initRoleListByEmpId(int id){

List<Map<String, Object>> roleList = roleService.findRoleListByMap();

//调用根据员工ID查询该员工拥有的角色列表的方法

List<Integer> roleIds = roleService.findEmployeeRoleByEmployeeId(id);

//循环比较两个集合中的角色ID值是否相等,相等则选中该角色

for (Map<String, Object> map : roleList) {

//定义变量,标识是否选中

boolean flag = false;//不选中

//获取每一个角色ID

Integer rid = (Integer) map.get("id");//id是主键,以主键作为map集合中key

//内层循环遍历该员工拥有的角色列表

for (Integer roleId : roleIds) {

public DataGridViewResult list(RoleVo roleVo){

//设置分页信息

PageHelper.startPage(roleVo.getPage(),roleVo.getLimit());

//调用分页查询的方法

List<Role> roleList = roleService.findRoleList(roleVo);

//创建分页对象

PageInfo<Role> pageInfo = new PageInfo<Role>(roleList);

//返回数据

return new DataGridViewResult(pageInfo.getTotal(),pageInfo.getList());

//添加部门信息

@RequestMapping("/addRole")

public String addRole(Role role){

}else{

map.put(SystemConstant.SUCCESS,false);//删除失败

map.put(SystemConstant.MESSAGE,"删除失败");

return JSON.toJSONString(map);

//查看该角色编号下是否有员工

@RequestMapping("/checkRoleHasEmployee")

public String checkDeptHasEmployee(Integer id){

Map<String,Object> map = new HashMap<String, Object>();

int countById = employeeService.getEmployeeCountByRoleId(id);

if (countById>0){

//该角色是否有员工在用

map.put(SystemConstant.EXISI,true);//存在

/**

* 角色列表查询

* @return

*/

@RequestMapping("/list")

public DataGridViewResult list(RoleVo roleVo){

//设置分页信息

PageHelper.startPage(roleVo.getPage(),roleVo.getLimit());

//调用分页查询的方法

List<Role> roleList = roleService.findRoleList(roleVo);

//创建分页对象


}else{

map.put(SystemConstant.SUCCESS,false);

map.put(SystemConstant.MESSAGE,"酒店预订失败,请重试!");

return JSON.toJSONString(map);

角色管理控制层: 

/**

* 角色管理

*/

@RequestMapping("/admin/role")

@RestController

public class RoleController {

@Autowired


public String list(Model model){

//调用查询所有房型列表的方法

List<RoomType> roomTypeList = roomTypeService.findRoomTypeList(null);

//创建查询条件类

RoomVo roomVo = new RoomVo();

roomVo.setStatus(3);//可预订

//查询房间列表

List<Room> roomList = roomService.findRoomListByPage(roomVo);

//将数据放到模型中

model.addAttribute("roomTypeList",roomTypeList);


model.addAttribute("roomTypeList",roomTypeList);

model.addAttribute("roomList",roomList);

model.addAttribute("typeId",id);//将当前选中的房型ID保存到模型中,目的是在页面中回显选中的文本(改变选中的颜色)

return "hotelList";

订单管理控制层:

@Controller

@RequestMapping("/orders")

public class OrdersController {

@Resource

private OrdersService ordersService;


/**

* 角色列表查询

* @return

*/

@RequestMapping("/list")

public DataGridViewResult list(RoleVo roleVo){

//设置分页信息

PageHelper.startPage(roleVo.getPage(),roleVo.getLimit());

//调用分页查询的方法

List<Role> roleList = roleService.findRoleList(roleVo);

//创建分页对象

PageInfo<Role> pageInfo = new PageInfo<Role>(roleList);

//返回数据


map.put(SystemConstant.MESSAGE,"酒店预订成功");

}else{

map.put(SystemConstant.SUCCESS,false);

map.put(SystemConstant.MESSAGE,"酒店预订失败,请重试!");

return JSON.toJSONString(map);

角色管理控制层: 

/**

* 角色管理

*/

@RequestMapping("/admin/role")

@RestController

public class RoleController {

@Autowired

* @return

*/

@RequestMapping("/register")

@ResponseBody

public String register(User user){

Map<String,Object> map = new HashMap<String,Object>();

//调用注册的方法

if(userService.addUser(user)>0){

map.put(SystemConstant.SUCCESS,true);

map.put(SystemConstant.MESSAGE,"恭喜你,注册成功!");

}else{

请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值