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

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

150023232402

170023232402

180023232402

190023232402

200023232402

基于javaweb的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 等等  

登录:

admin 123456

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
	}

@RequestMapping(value="/modify",method=RequestMethod.POST)
public ModelAndView modifyCandidate(Candidate candidate) {
boolean result = candidateService.update(candidate);
//当是否到岗“为“是”则直接关联到员工表中
if(candidate.getSfdg()!=null) {

if(candidate.getSfdg()==1){
Employee employee = new Employee();
employee.setXm(candidate.getXm()); //姓名
employee.setRzrq(candidate.getDgsj()); //入职日前----到岗时间
employee.setZg_xl(candidate.getXl()); //最高学历----学历
employeeService.add(employee);
}

}

return new ModelAndView("candidate", "result",result);
}

@RequestMapping(value="/del",method=RequestMethod.GET)
public String delCandidate(Model model,Integer id,Integer cp) {
boolean result = candidateService.deleteById(id);
model.addAttribute("result", result);
return "redirect:/candidate/list?currentPage="+cp;
}

@RequestMapping(value="/delbatch",method=RequestMethod.GET)
public String delBatchCandidate(Model model,Integer[] aid,Integer cp) {
for (Integer id : aid) {
candidateService.deleteById(id);
}
return "redirect:/candidate/list?currentPage="+cp;
}

}




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
	 * 列表显示考勤信息
* @param pageSize
* @param currentPage
* @return
*/
@RequestMapping(value="/list",method=RequestMethod.GET)
public ModelAndView findAllAttendance(@RequestParam(required=false)Integer pageSize,Integer currentPage) {
//初始每页5条数据
pageSize = pageSize ==null ? 15 : pageSize;
//初始显示第一页
currentPage = currentPage ==null ? 1 : currentPage;
PageModel pm = new PageModel();
pm.setPageSize(pageSize);
pm.setCurrentPage(currentPage);
pm = attendanceService.queryByPage(pm);
return new ModelAndView("attendance","page",pm);
}

/**
* 修改考勤信息
* @param attendance
* @return
*/
@RequestMapping(value="/modify",method=RequestMethod.POST)
public ModelAndView modifyAttendance(Attendance attendance) {
boolean result = attendanceService.update(attendance);
return new ModelAndView("attendance", "result",result);
}

/**
* 删除考勤信息
* @param attendance
* @return
*/
@RequestMapping(value="/del",method=RequestMethod.GET)
public String delAttendance(Model model,Integer id,Integer cp) {
boolean result = attendanceService.deleteById(id);
model.addAttribute("result", result);
return "redirect:list?currentPage="+cp;
}

/**
* 批量删除考勤信息
* @param attendance
* @return
*/
@RequestMapping(value="/delbatch",method=RequestMethod.GET)
public String delBatchAttendance(Model model,Integer[] aid,Integer cp) {
for (Integer id : aid) {
attendanceService.deleteById(id);
}
return "redirect:list?currentPage="+cp;
}
}
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



@Controller
@RequestMapping("/salaryBase")
public class SalaryBaseController {

@Autowired
private SalaryBaseService salaryBaseService;

@RequestMapping(value="/add",method=RequestMethod.POST)
public ModelAndView createSalaryBase(SalaryBase salaryBase) {
boolean result = salaryBaseService.add(salaryBase);
return new ModelAndView("redirect:list","result",result);
}

@RequestMapping(value="/list",method=RequestMethod.GET)
public ModelAndView findAllSalaryBase(@RequestParam(required=false)Integer pageSize,Integer currentPage) {
pageSize = pageSize ==null ? 15 : pageSize;
currentPage = currentPage ==null ? 1 : currentPage;
PageModel pm = new PageModel();
pm.setPageSize(pageSize);
pm.setCurrentPage(currentPage);
pm = salaryBaseService.queryByPage(pm);
return new ModelAndView("salary_base","page",pm);
}

@RequestMapping(value="/modify",method=RequestMethod.POST)
public ModelAndView modifySalaryBase(SalaryBase salaryBase) {
boolean result = salaryBaseService.update(salaryBase);
return new ModelAndView("salary_base", "result",result);
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
@RequestMapping(value="/list",method=RequestMethod.GET)
public ModelAndView findAllAttendance(@RequestParam(required=false)Integer pageSize,Integer currentPage) {
//初始每页5条数据
pageSize = pageSize ==null ? 15 : pageSize;
//初始显示第一页
currentPage = currentPage ==null ? 1 : currentPage;
PageModel pm = new PageModel();
pm.setPageSize(pageSize);
pm.setCurrentPage(currentPage);
pm = attendanceService.queryByPage(pm);
return new ModelAndView("attendance","page",pm);
}

/**
* 修改考勤信息
* @param attendance
* @return
*/
@RequestMapping(value="/modify",method=RequestMethod.POST)
public ModelAndView modifyAttendance(Attendance attendance) {
boolean result = attendanceService.update(attendance);
return new ModelAndView("attendance", "result",result);
}

/**
* 删除考勤信息
* @param attendance
* @return
*/
@RequestMapping(value="/del",method=RequestMethod.GET)
public String delAttendance(Model model,Integer id,Integer cp) {
boolean result = attendanceService.deleteById(id);
model.addAttribute("result", result);
return "redirect:list?currentPage="+cp;
}

/**
* 批量删除考勤信息
* @param attendance
* @return
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

/**
* 修改密码
* @param admin
* @return
*/
@RequestMapping(value="/updatePwd",method=RequestMethod.POST)
public ModelAndView updatePwd(@RequestParam("oldpwd")String oldpwd,@RequestParam("newpwd")String newpwd,HttpSession session){
Object obj = session.getAttribute("user");
if(obj != null) {
Admin ad = (Admin)obj;
if(Objects.equals(ad.getUser_pwd(), oldpwd)) {
ad.setUser_pwd(newpwd);
boolean result = adminService.updatePwd(ad);
new ModelAndView("forward :logout","msg","修改完成,为确保账户安全,请重新登陆");
}else {
return new ModelAndView("redirect:list","msg","原始密码输入错误");
}
}
return new ModelAndView("login","msg","请登陆后再试");
}

/**
* 修改账户状态
* @param admin
* @return
*/
@RequestMapping(value="/updateStatus",method=RequestMethod.GET)
public ModelAndView updateStatus(Admin admin){
boolean result = adminService.updateStatus(admin);
return new ModelAndView("redirect:list","result",result);
}

/**
* 管理员列表
* @return
*/
@RequestMapping(value="/list",method=RequestMethod.GET)
public ModelAndView adminList(){
List<Admin> list = adminService.findAll();
return new ModelAndView("system","list",list);
}

/**
* 注销
* @param session
* @return
*/
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

@Controller
@RequestMapping("/attendance")
public class AttendanceController {

@Autowired
private AttendanceService attendanceService;

/**
* 添加考勤信息
* @param attendance
* @return
*/
@RequestMapping(value="/add",method=RequestMethod.POST)
public ModelAndView createAttendance(Attendance attendance) {
boolean result = attendanceService.add(attendance);
return new ModelAndView("redirect:list","result",result);
}

/**
* 列表显示考勤信息
* @param pageSize
* @param currentPage
* @return
*/
@RequestMapping(value="/list",method=RequestMethod.GET)
public ModelAndView findAllAttendance(@RequestParam(required=false)Integer pageSize,Integer currentPage) {
//初始每页5条数据
pageSize = pageSize ==null ? 15 : pageSize;
//初始显示第一页
currentPage = currentPage ==null ? 1 : currentPage;
PageModel pm = new PageModel();
pm.setPageSize(pageSize);
pm.setCurrentPage(currentPage);
pm = attendanceService.queryByPage(pm);
return new ModelAndView("attendance","page",pm);
}

/**
* 修改考勤信息
* @param attendance
* @return
*/
@RequestMapping(value="/modify",method=RequestMethod.POST)
public ModelAndView modifyAttendance(Attendance attendance) {
boolean result = attendanceService.update(attendance);
return new ModelAndView("attendance", "result",result);
}

/**
* 删除考勤信息
* @param attendance


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