基于javaweb+mysql的ssm医院人事管理系统员工考勤管理系统(java+jsp+ssm+mysql+bootstrap)

基于javaweb+mysql的ssm医院人事管理系统员工考勤管理系统(java+jsp+ssm+mysql+bootstrap)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

人事员工考勤管理,登录用户分为:

人事部主任(超级管理员)

人事部员工(管理员)

部门主任(部门管理)

部门员工(普通员工)

个人信息维护、员工管理、请假、签到打卡、审批、部门管理、职位管理等……

技术框架

JavaBean MVC JSP SSM(Spring SpringMVC MyBatis) MySQL Bootstrap……

基于javaweb+mysql的SSM医院人事管理系统员工考勤管理系统(java+jsp+ssm+mysql+bootstrap)

	
	@RequestMapping("/{id}/update.do")
	public String updateById(@PathVariable Integer id, Position position){
		position.setId(id);
		positionService.updateById(position);
		return "forward:/position/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/delete.do")
	public String deleteById(@PathVariable Integer id){
		positionService.deleteById(id);
		return "forward:/position/listPage.do?pageNo=1";
	}
}

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

	@Autowired
	private AttendanceService attendanceService;
	
	@RequestMapping("/addStart.do")
	public String addStart(Integer employeeNumber){
		attendanceService.addStart(employeeNumber);
		return "welcome";
	}
	
	@RequestMapping("/addEnd.do")
	public String addEnd(Integer employeeNumber){
		attendanceService.addEnd(employeeNumber);
		return "welcome";
	@RequestMapping("/{id}/detial.do")
	public String selectEmployee(@PathVariable Integer id, Model model){
		Employee employee = employeeService.selectEmployee(id);
		model.addAttribute("employee", employee);
		return "admin/employee_detail";
	}
	
	@RequestMapping("/toAdd.do")
	public String toAdd(Model model){
		List<History> eList = historyService.selectList(new EntityWrapper<History>()
				.orderBy("employee_number", false));
		model.addAttribute("employeeNumber",eList.get(0).getEmployeeNumber()+1);
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>());
		model.addAttribute("dList", dList);
		List<Position> pList = positionService.selectList(new EntityWrapper<Position>());
		model.addAttribute("pList", pList);
		return "admin/employee_add";
	}
	
	@RequestMapping("/add.do")
	public String add(Employee employee, String date) {
		employee.setBirthday(MTimeUtil.stringParse(date));
		employeeService.addEmployee(employee);
		return "forward:/employee/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/toUpdate.do")
	public String toUpdate(Model model, @PathVariable Integer id){
		Employee employee = employeeService.selectById(id);
		model.addAttribute("employee", employee);
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>());
		model.addAttribute("dList", dList);
		List<Position> pList = positionService.selectList(new EntityWrapper<Position>());
		model.addAttribute("pList", pList);
		return "admin/employee_update";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateById(@PathVariable Integer id, Employee employee, String date, String status, 
			HttpSession session){
		employee.setId(id);
		employee.setBirthday(MTimeUtil.stringParse(date));
		//得到操作人员的名字
		Employee employee2 = (Employee) session.getAttribute("loged");
		if(employee.getDepartmentNumber() == null){
			employee.setDepartment(employee2.getDepartment());
			employee.setDepartmentNumber(employee2.getDepartmentNumber());
		}
		if(employee.getPositionNumber() == null){
	@RequestMapping("/oneself.do")
	public String seletByEmployee(HttpSession session, int pageNo, Model model){
		Employee employee = (Employee)session.getAttribute("loged");
		Page<Leave> page = leaveService.seletByEmployee(employee.getEmployeeNumber(), pageNo);
		model.addAttribute("page", page);
		return "admin/oneself_leave";
	}
	
	@RequestMapping("/notlist.do")
	public String selectNotList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "未批准");
		model.addAttribute("list", list);
		return "admin/leave_notlist";
	}
	
	@RequestMapping("/yeslist.do")
	public String selectYesList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "已批准");
		model.addAttribute("list", list);
		return "admin/leave_yeslist";
	}
}

@Controller
@RequestMapping("/history")
public class HistoryController {

	@Autowired
	private HistoryService historyService;
	@Autowired
	private EmployeeService employeeService;
	
	
}

@Controller
@RequestMapping("/leave")
public class LeaveController {

	@Autowired
	private LeaveService leaveService;
	
	@RequestMapping("/list.do")
	public String selectList(Model model){
		List<Leave> list = leaveService.selectList();
		model.addAttribute("list", list);
		return "admin/leave_list";
	}
	
	@RequestMapping("/{id}/detail.do")
	public String selectLeave(@PathVariable Integer id, Model model){
		Leave leave = leaveService.selectLeave(id);
		model.addAttribute("leave", leave);
		return "admin/leave_detail";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateStatus(@PathVariable Integer id){
		leaveService.updateStatus(id);
		return "forward:/leave/notlist.do";
	}
	
	@RequestMapping("/toAdd.do")
	public String toAdd(){
		return "admin/leave_add";
	}
public class LeaveController {

	@Autowired
	private LeaveService leaveService;
	
	@RequestMapping("/list.do")
	public String selectList(Model model){
		List<Leave> list = leaveService.selectList();
		model.addAttribute("list", list);
		return "admin/leave_list";
	}
	
	@RequestMapping("/{id}/detail.do")
	public String selectLeave(@PathVariable Integer id, Model model){
		Leave leave = leaveService.selectLeave(id);
		model.addAttribute("leave", leave);
		return "admin/leave_detail";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateStatus(@PathVariable Integer id){
		leaveService.updateStatus(id);
		return "forward:/leave/notlist.do";
	}
	
	@RequestMapping("/toAdd.do")
	public String toAdd(){
		return "admin/leave_add";
	}
	
	@RequestMapping("/add.do")
	public String add(HttpSession session,Integer employeeNumber, Leave leave, String start, String end){
		leave.setEmployeeNumber(employeeNumber);
		leave.setStartTime(MTimeUtil.stringParse(start));
		leave.setEndTime(MTimeUtil.stringParse(end));
		Employee employee = (Employee)session.getAttribute("loged");
		leave.setDepartmentNumber(employee.getDepartmentNumber());
		leaveService.insert(leave);
		return "forward:/employee/welcome.do";
	}
	
	@RequestMapping("/oneself.do")
	public String seletByEmployee(HttpSession session, int pageNo, Model model){
		Employee employee = (Employee)session.getAttribute("loged");
		Page<Leave> page = leaveService.seletByEmployee(employee.getEmployeeNumber(), pageNo);
		model.addAttribute("page", page);
		return "admin/oneself_leave";
	}
	
	@RequestMapping("/notlist.do")
	public String selectNotList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "未批准");
		return "forward:/employee/welcome.do";
	}
	
	@RequestMapping("/oneself.do")
	public String seletByEmployee(HttpSession session, int pageNo, Model model){
		Employee employee = (Employee)session.getAttribute("loged");
		Page<Leave> page = leaveService.seletByEmployee(employee.getEmployeeNumber(), pageNo);
		model.addAttribute("page", page);
		return "admin/oneself_leave";
	}
	
	@RequestMapping("/notlist.do")
	public String selectNotList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "未批准");
		model.addAttribute("list", list);
		return "admin/leave_notlist";
	}
	
	@RequestMapping("/yeslist.do")
	public String selectYesList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "已批准");
		model.addAttribute("list", list);
		return "admin/leave_yeslist";
	}
}

@Controller
@RequestMapping("/history")
	@RequestMapping("/add.do")
	public String add(Overtime overtime, String date){
		overtime.setDay(MTimeUtil.stringParse(date));
		overtimeService.insert(overtime);
		return "forward:/overtime/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/toUpdate.do")
	public String toUpdate(Model model, @PathVariable Integer id){
		//查询出要修改的记录信息
		Overtime overtime = overtimeService.selectById(id);
		model.addAttribute("overtime", overtime);
		//查询出所有的部门
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>());
		model.addAttribute("dList", dList);
		//查询出所有的员工
		List<Employee> eList = employeeService.selectList(new EntityWrapper<Employee>());
		model.addAttribute("eList", eList );
		return "admin/overtime_update";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateById(@PathVariable Integer id,  String date, Overtime overtime){
		overtime.setId(id);
		overtime.setDay(MTimeUtil.stringParse(date));
		overtimeService.updateById(overtime);
		return "forward:/overtime/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/delete.do")
	public String deleteById(@PathVariable Integer id){
		overtimeService.deleteById(id);
		return "forward:/overtime/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{employeeNumber}/oneself.do")
	public String select(Model model, @PathVariable Integer employeeNumber, int pageNo){
		Page<Overtime> page = overtimeService.selectByEmployee(pageNo, employeeNumber);
		model.addAttribute("page",page);
		return "admin/oneself_overtime";
	}
	
}


	@Autowired
	private DepartmentService departmentService;
	
	@RequestMapping("/listPage.do")
	public String selectListByPgae(Model model, int pageNo){
		Page<Department> page = departmentService.selectListByPage(pageNo);
		model.addAttribute("page",page);
		return "admin/department_list";
	}
	
	@RequestMapping("/toAdd.do")
	public String toAdd(Model model){
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>()
				.orderBy("department_number", false));
		model.addAttribute("departmentNumber", dList.get(0).getDepartmentNumber()+1);
		return "admin/department_add";
	}
	
	@RequestMapping("/add.do")
	public String add(Department department){
		departmentService.insert(department);
		return "forward:/department/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/toUpdate.do")
	public String toUpdate(@PathVariable Integer id, Model model){
		Department department = departmentService.selectById(id);
		model.addAttribute("department", department);
		return "admin/department_update";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateById(@PathVariable Integer id, Department department){
		department.setId(id);
		departmentService.updateById(department);
		return "forward:/department/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/delete.do")
	@RequestMapping("/toAdd.do")
	public String toAdd(){
		return "admin/leave_add";
	}
	
	@RequestMapping("/add.do")
	public String add(HttpSession session,Integer employeeNumber, Leave leave, String start, String end){
		leave.setEmployeeNumber(employeeNumber);
		leave.setStartTime(MTimeUtil.stringParse(start));
		leave.setEndTime(MTimeUtil.stringParse(end));
		Employee employee = (Employee)session.getAttribute("loged");
		leave.setDepartmentNumber(employee.getDepartmentNumber());
		leaveService.insert(leave);
		return "forward:/employee/welcome.do";
	}
	
	@RequestMapping("/oneself.do")
	public String seletByEmployee(HttpSession session, int pageNo, Model model){
		Employee employee = (Employee)session.getAttribute("loged");
		Page<Leave> page = leaveService.seletByEmployee(employee.getEmployeeNumber(), pageNo);
		model.addAttribute("page", page);
		return "admin/oneself_leave";
	}
	
	@RequestMapping("/notlist.do")
	public String selectNotList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "未批准");
		model.addAttribute("list", list);
		return "admin/leave_notlist";
	}
	
	@RequestMapping("/yeslist.do")
	public String selectYesList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "已批准");
		model.addAttribute("list", list);
		return "admin/leave_yeslist";

@Controller
@RequestMapping("/overtime")
public class OvertimeController {

	@Autowired
	private OvertimeService overtimeService;
	@Autowired
	private EmployeeService employeeService;
	@Autowired
	private DepartmentService departmentService;

	@RequestMapping("/listPage.do")
	public String selectListByPgae(Model model, int pageNo){
		Page<Overtime> page = overtimeService.selectListByPage(pageNo);
		model.addAttribute("page",page);
		return "admin/overtime_list";
	}
	
	@RequestMapping("/toAdd.do")
	public String toAdd(Model model){

@Controller
@RequestMapping("/history")
public class HistoryController {

	@Autowired
	private HistoryService historyService;
	@Autowired
	private EmployeeService employeeService;
	
	@RequestMapping("/retireListPage.do")
	public String selectRetireByPage(Model model, int pageNo){
		Page<History> page = historyService.selectRetireByPage(pageNo);
		model.addAttribute("page", page);
		return "admin/retire_list";
	}
	
	@RequestMapping("/{id}/detail.do")
	public String selectHistory(@PathVariable Integer id, Model model){
		History history = historyService.selectHistory(id);
		model.addAttribute("history", history);
		return "admin/history_detail";
	}

	@RequestMapping("/{id}/toUpdate.do")
	public String toUpdate(Model model, @PathVariable Integer id){
		History history = historyService.selectHistory(id);
		if (history.getStatus().equals("在职")) {
			Employee employee = employeeService.selectByNumber(history.getEmployeeNumber());
			return "forward:/employee/"+ employee.getId() +"/toUpdate.do";
		}else{
			model.addAttribute("history", history);
			return "admin/history_update";
		}
	}
	
	@RequestMapping("/{id}/updateRetire.do")
	public String add(Employee employee, String date) {
		employee.setBirthday(MTimeUtil.stringParse(date));
		employeeService.addEmployee(employee);
		return "forward:/employee/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/toUpdate.do")
	public String toUpdate(Model model, @PathVariable Integer id){
		Employee employee = employeeService.selectById(id);
		model.addAttribute("employee", employee);
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>());
		model.addAttribute("dList", dList);
		List<Position> pList = positionService.selectList(new EntityWrapper<Position>());
		model.addAttribute("pList", pList);
		return "admin/employee_update";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateById(@PathVariable Integer id, Employee employee, String date, String status, 
			HttpSession session){
		employee.setId(id);
		employee.setBirthday(MTimeUtil.stringParse(date));
		//得到操作人员的名字
		Employee employee2 = (Employee) session.getAttribute("loged");
		if(employee.getDepartmentNumber() == null){
			employee.setDepartment(employee2.getDepartment());
			employee.setDepartmentNumber(employee2.getDepartmentNumber());
		}
		if(employee.getPositionNumber() == null){
			employee.setPosition(employee2.getPosition());
			employee.setPositionNumber(employee2.getPositionNumber());
		}
		if(status == null){
			status = "在职";
		}
		employeeService.updateEmployee(employee, status, employee2.getName());
		return "forward:/employee/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/delete.do")
	public String deleteById(@PathVariable Integer id){
	@RequestMapping("/addEnd.do")
	public String addEnd(Integer employeeNumber){
		attendanceService.addEnd(employeeNumber);
		return "welcome";
	}
	
	@RequestMapping("/list.do")
	public String selectList(Model model){
		List<Attendance> list = attendanceService.selectList();
		model.addAttribute("aList",list);
		return "admin/attendance_list";
	}
	
	@RequestMapping("/{employeeNumber}/oneself.do")
	public String select(Model model, @PathVariable Integer employeeNumber){
		List<Attendance> list = attendanceService.selectByEmployee(employeeNumber);
		model.addAttribute("aList",list);
		return "admin/oneself_attendance";
	}
}

@Controller
@RequestMapping("/move")
public class MoveController {

	@Autowired
	private MoveService moveService;
	
	@RequestMapping("/list.do")
	public String selectList(Model model){
		List<Move> list = moveService.selectList();
		model.addAttribute("mList",list);
		return "admin/move_list";
	}
	
		return "login";
	}
		
}

@Controller
@RequestMapping("/overtime")
public class OvertimeController {

	@Autowired
	private OvertimeService overtimeService;
	@Autowired
	private EmployeeService employeeService;
	@Autowired
	private DepartmentService departmentService;

	@RequestMapping("/listPage.do")
	public String selectListByPgae(Model model, int pageNo){
		Page<Overtime> page = overtimeService.selectListByPage(pageNo);
		model.addAttribute("page",page);
		return "admin/overtime_list";
	}
	
	@RequestMapping("/toAdd.do")
	public String toAdd(Model model){
		//查询出所有的部门
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>());
		model.addAttribute("dList", dList);
		//查询出所有的员工
		List<Employee> eList = employeeService.selectList(new EntityWrapper<Employee>());
		model.addAttribute("eList", eList );
public class DepartmentController {

	@Autowired
	private DepartmentService departmentService;
	
	@RequestMapping("/listPage.do")
	public String selectListByPgae(Model model, int pageNo){
		Page<Department> page = departmentService.selectListByPage(pageNo);
		model.addAttribute("page",page);
		return "admin/department_list";
	}
	
	@RequestMapping("/toAdd.do")
	public String toAdd(Model model){
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>()
				.orderBy("department_number", false));
		model.addAttribute("departmentNumber", dList.get(0).getDepartmentNumber()+1);
		return "admin/department_add";
	}
	
	@RequestMapping("/add.do")
	public String add(Department department){
		departmentService.insert(department);
		return "forward:/department/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/toUpdate.do")
	public String toUpdate(@PathVariable Integer id, Model model){
		Department department = departmentService.selectById(id);
		model.addAttribute("department", department);
		return "admin/department_update";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateById(@PathVariable Integer id, Department department){
		department.setId(id);
		departmentService.updateById(department);
		return "forward:/department/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/delete.do")
	public String deleteById(@PathVariable Integer id){
		departmentService.deleteById(id);
		return "forward:/department/listPage.do?pageNo=1";
	}
	public String toUpdate(Model model, @PathVariable Integer id){
		//查询出要修改的记录信息
		Overtime overtime = overtimeService.selectById(id);
		model.addAttribute("overtime", overtime);
		//查询出所有的部门
		List<Department> dList = departmentService.selectList(new EntityWrapper<Department>());
		model.addAttribute("dList", dList);
		//查询出所有的员工
		List<Employee> eList = employeeService.selectList(new EntityWrapper<Employee>());
		model.addAttribute("eList", eList );
		return "admin/overtime_update";
	}
	
	@RequestMapping("/{id}/update.do")
	public String updateById(@PathVariable Integer id,  String date, Overtime overtime){
		overtime.setId(id);
		overtime.setDay(MTimeUtil.stringParse(date));
		overtimeService.updateById(overtime);
		return "forward:/overtime/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{id}/delete.do")
	public String deleteById(@PathVariable Integer id){
		overtimeService.deleteById(id);
		return "forward:/overtime/listPage.do?pageNo=1";
	}
	
	@RequestMapping("/{employeeNumber}/oneself.do")
	public String select(Model model, @PathVariable Integer employeeNumber, int pageNo){
		Page<Overtime> page = overtimeService.selectByEmployee(pageNo, employeeNumber);
		model.addAttribute("page",page);
		return "admin/oneself_overtime";
	}
	
}

	@RequestMapping("/add.do")
	public String add(HttpSession session,Integer employeeNumber, Leave leave, String start, String end){
		leave.setEmployeeNumber(employeeNumber);
		leave.setStartTime(MTimeUtil.stringParse(start));
		leave.setEndTime(MTimeUtil.stringParse(end));
		Employee employee = (Employee)session.getAttribute("loged");
		leave.setDepartmentNumber(employee.getDepartmentNumber());
		leaveService.insert(leave);
		return "forward:/employee/welcome.do";
	}
	
	@RequestMapping("/oneself.do")
	public String seletByEmployee(HttpSession session, int pageNo, Model model){
		Employee employee = (Employee)session.getAttribute("loged");
		Page<Leave> page = leaveService.seletByEmployee(employee.getEmployeeNumber(), pageNo);
		model.addAttribute("page", page);
		return "admin/oneself_leave";
	}
	
	@RequestMapping("/notlist.do")
	public String selectNotList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "未批准");
		model.addAttribute("list", list);
		return "admin/leave_notlist";
	}
	
	@RequestMapping("/yeslist.do")
	public String selectYesList(Model model, HttpSession session){
		//获取登录用户的信息
		Employee employee = (Employee) session.getAttribute("loged");
		List<Leave> list = leaveService.selectListByStatus(employee.getDepartmentNumber(), "已批准");
		model.addAttribute("list", list);
		return "admin/leave_yeslist";
	}
}

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

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值