——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明





基于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
——————————CodeStart——————————
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) { 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); }
@RequestMapping(value="/modify",method=RequestMethod.POST) public ModelAndView modifyAttendance(Attendance attendance) { boolean result = attendanceService.update(attendance); return new ModelAndView("attendance", "result",result); }
@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; }
@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) { 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); }
@RequestMapping(value="/modify",method=RequestMethod.POST) public ModelAndView modifyAttendance(Attendance attendance) { boolean result = attendanceService.update(attendance); return new ModelAndView("attendance", "result",result); }
@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; }
|
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
|
@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","请登陆后再试"); }
@RequestMapping(value="/updateStatus",method=RequestMethod.GET) public ModelAndView updateStatus(Admin admin){ boolean result = adminService.updateStatus(admin); return new ModelAndView("redirect:list","result",result); }
@RequestMapping(value="/list",method=RequestMethod.GET) public ModelAndView adminList(){ List<Admin> list = adminService.findAll(); return new ModelAndView("system","list",list); }
|
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;
@RequestMapping(value="/add",method=RequestMethod.POST) public ModelAndView createAttendance(Attendance attendance) { boolean result = attendanceService.add(attendance); return new ModelAndView("redirect:list","result",result); }
@RequestMapping(value="/list",method=RequestMethod.GET) public ModelAndView findAllAttendance(@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 = attendanceService.queryByPage(pm); return new ModelAndView("attendance","page",pm); }
@RequestMapping(value="/modify",method=RequestMethod.POST) public ModelAndView modifyAttendance(Attendance attendance) { boolean result = attendanceService.update(attendance); return new ModelAndView("attendance", "result",result); }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=571422322105200lh
https://javayms.pages.dev?id=571422322105200lh