赞
踩
作者主页:编程指南针
作者简介:Java领域优质创作者、CSDN博客专家 、掘金特邀作者、多年架构师设计经验、腾讯课堂常驻讲师
主要内容:Java项目、毕业设计、简历模板、学习资料、面试题库、技术互助
文末获取源码
随着电子信息的飞速发展,计算机已经融入到了生活的各个方面,越来越多的企业开始使用电子计算机来对企业进行管理,信息化的时代已经到来,各个企业无论大小都需要一个信息化的管理系统来对自己公司内部的员工信息进行管理,企业员工信息管理系统是一个针对此问题而进行开发的系统,使得公司的员工管理不如现代化,开启了一个新的管理模式。
本文首先对比了国内外企业员工信息管理的现状,明确了需求的不同以及需要吸收借鉴的部分,然后在员工信息管理的需求基础上,通过系统的功能需求与系统的可行性分析,确立了企业员工信息管理系统的基本功能,构建了该系统的框架以及结构设计,然后对该系统的各个功能的主要代码进行分析、设计,最后对系统的各个功能进行测试,完成了本次系统的开发。企业员工信息管理系统分为两大模块,管理员模块和普通员工模块,管理员可以操作系统的所有功能,主要包括部门管理、员工信息管理、出勤管理、工资管理以及请假审核等功能;为了信息的保密以及系统的安全性,普通员工只具有查看工资以及请假的功能。
文章以需求分析,系统概要设计,系统功能实现,系统测试等为主要内容,详细介绍了一个基于Web技术的B/S结构的企业员工信息管理系统。本系统主要使用MyEclipse软件进行程序编写,使用JSP作为前台的开发语言,使用MySql作为后台的数据库管理系统,服务器采用tomcat,开发出的一个适应现代社会发展的企业员工信息管理系统。
本系统主要实现对企业的人力资源信息的管理功能,主要包含的模块儿有:
招聘管理、职位管理、部门管理、培训管理、薪金管理、用户管理、下载中心、系统管理几个模块。
语言环境:Java: jdk1.8
数据库:Mysql: mysql5.7
应用服务器:Tomcat: tomcat8.5.31
开发工具:IDEA或eclipse
运行环境
MyEclipse(idea) + Tomcat7,8 + MySql5.5+jdk7,8
项目技术(必填)
Jsp+Servlet+apache dbutils+jdbc+c3p0+bootstrap+jquery
后台主界面
招聘管理
职位管理
部门管理
培训管理
薪酬管理
用户管理
下载中心
系统管理
部门核心实现代码:
- package com.hr.service.impl;
- import java.util.List;
-
- import com.hr.dao.AdminDao;
- import com.hr.dao.impl.AdminDaoImpl;
- import com.hr.pojo.Admin;
- import com.hr.service.AdminService;
- public class AdminServiceImpl implements AdminService {
- private AdminDao userDao = new AdminDaoImpl();
- @Override
- public Admin findUserByUsernameAndPassword(String username, String password) {
- Admin user = userDao.findUserByUsernameAndPassword(username, password);
- return user;
- }
- @Override
- public void saveUser(Admin user) {
- AdminDao userDao = new AdminDaoImpl();
- userDao.saveUser(user);
- }
- @Override
- public List findAllUsers() {
- AdminDao userDao = new AdminDaoImpl();
- return userDao.findAllUsers();
- }
- @Override
- public Admin findUserById(String id) {
- AdminDao userDao = new AdminDaoImpl();
- Admin user=userDao.findUserById(id);
- return user;
- }
- @Override
- public void updateUser(Admin user) {
- AdminDao userDao = new AdminDaoImpl();
- userDao.updateUser(user);
- }
- @Override
- public void delete(String id) {
- AdminDao userDao = new AdminDaoImpl();
- userDao.delete(id);
- }
- }
- package com.hr.web;
- import java.io.IOException;
- import java.io.PrintWriter;
- import java.sql.SQLException;
- import java.util.Iterator;
- import java.util.List;
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
-
- import com.hr.pojo.Admin;
- import com.hr.service.AdminService;
- import com.hr.service.ApplicantService;
- import com.hr.service.impl.AdminServiceImpl;
- import com.hr.service.impl.ApplicantServiceImpl;
- import com.hr.utils.DateUtil;
- import com.hr.utils.StringUtil;
- public class AdminServlet extends BaseServlet {
- private AdminService adminService=new AdminServiceImpl();
- private ApplicantService applicantService=new ApplicantServiceImpl();
- //管理员登录
- public String adminLogin(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException {
- //接受用户名和用户密码
- String username=request.getParameter("username");
- String password=request.getParameter("password");
-
- //MD5加密密码
- password=StringUtil.stringToMD5(password);
-
- //调用业务层功能 : 根据用户名查找用户 select * from user where username=?, 返回用户
- Admin admin=adminService.findUserByUsernameAndPassword(username,password);
- //根据返回的用户是否为空,判断用户是否已经存在 ,向客户端响应
- if(null!=admin){
-
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("/public/alert.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- if(admin.getPassword().equals(password)) {
- request.getSession().setAttribute("admin",admin);
- out.println("<script>ok_alert(\"登录成功\",\"main.jsp\");</script>");
- }else {
- out.println("<script>no_alert(\"登录失败,密码错误!\",\"index.jsp\");</script>");
- }
-
- }else{
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("/index.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- out.println("<script>no_alert(\"登录失败,找不到该用户!\",\"index.jsp\");</script>");
- }
- return null;
- }
- //退出
- public String adminLogout(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException {
- request.getSession().removeAttribute("admin");
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("/main.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- out.println("<script>ok_alert(\"退出成功\",\"index.jsp\");</script>");
- return null;
- }
- public String toAddPage(HttpServletRequest request, HttpServletResponse response) throws Exception {
- response.setCharacterEncoding("UTF-8");
- request.getRequestDispatcher("/admin/adduser.jsp").include(request, response);
- return null;
-
- }
- //管理员添加
- public String adminAdd(HttpServletRequest request, HttpServletResponse response) throws Exception{
- Admin admin = new Admin();
- admin.setUsername(request.getParameter("username"));
- admin.setPassword(StringUtil.stringToMD5(request.getParameter("password")));//加密
- admin.setSex(new Byte(request.getParameter("sex")));
- admin.setBirthday(DateUtil.parseToDate(request.getParameter("birthday"), DateUtil.yyyyMMdd));
- admin.setCreatetime(new java.util.Date());
- admin.setContent(request.getParameter("content"));
- String applicantId=request.getParameter("applicantId");
- admin.setIfadmin(new Byte("0"));
- if(applicantId!="") {admin.setIfadmin(new Byte("1"));}
- adminService.saveUser(admin);
- if(applicantId!="") {
- admin.setIfadmin(new Byte("1"));
- List adminList=adminService.findAllUsers();
- Admin u=(Admin)adminList.get(adminList.size() - 1);
- applicantService.updateadminApplicant(applicantId,u.getId().toString());
- };
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("./public/alert.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- //跳转到列表页面
- if(applicantId!="") {
- out.println("<script>ok_alert(\"员工录用成功!\",\"main.jsp?method=findApplicantByIsstock&isstock=3&servlet=ApplicantServlet\");</script>");
- }else {
- out.println("<script>ok_alert(\"添加成功!\",\"main.jsp?method=adminList&servlet=AdminServlet\");</script>");
- }
- return null;
- }
- //管理员list
- public List adminList(HttpServletRequest request, HttpServletResponse response) throws Exception{
- response.setContentType("text/html;charset=utf-8");
- List adminList=adminService.findAllUsers();
- request.setAttribute("adminList", adminList);
- request.getRequestDispatcher("/admin/listadmin.jsp").include(request, response);
- return null;
- }
- //更新管理员页面
- public String toUpdatePage(HttpServletRequest request, HttpServletResponse response) throws Exception {
- String id = request.getParameter("id");
- Admin adminuser =adminService.findUserById(id);
- request.setAttribute("admin", adminuser);
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("/admin/updateuser.jsp").include(request, response);
- return null;
- }
- //更新管理员
- public String updateAdmin(HttpServletRequest request, HttpServletResponse response) throws Exception{
- Admin user = new Admin();
- user.setId(new Long(request.getParameter("id")));
- user.setUsername(request.getParameter("username"));
- user.setPassword(request.getParameter("password"));
- user.setSex(new Byte(request.getParameter("sex")));
- user.setBirthday(DateUtil.parseToDate(request.getParameter("birthday"), DateUtil.yyyyMMdd));
- //user.setCreatetime(new java.util.Date());
- user.setContent(request.getParameter("content"));
-
- adminService.updateUser(user);
- List adminList=adminService.findAllUsers();
- request.setAttribute("adminList", adminList);
-
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("./public/alert.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- out.println("<script>ok_alert(\"修改成功\",\"main.jsp?method=adminList&servlet=AdminServlet\");</script>");
- return null;
- }
- //删除管理员
- public String deleteAdmin(HttpServletRequest request, HttpServletResponse response) throws Exception{
- String id = request.getParameter("id");
-
- adminService.delete(id);
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("./public/alert.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- out.println("<script>ok_alert(\"删除成功\",\"main.jsp?method=adminList&servlet=AdminServlet\");</script>");
- return null;
- }
- }
- package com.hr.web;
-
- import java.io.IOException;
- import java.io.PrintWriter;
- import java.util.List;
-
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
-
- import com.hr.pojo.Department;
- import com.hr.pojo.Position;
- import com.hr.service.DepartmentService;
- import com.hr.service.impl.DepartmentServiceImpl;
-
-
- public class DepartmentServlet extends BaseServlet {
- private DepartmentService departmentService=new DepartmentServiceImpl();
-
- public String listDepartment(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
- response.setContentType("text/html;charset=utf-8");
- List departmentList= departmentService.findAllDepartments();
- request.setAttribute("departmentList", departmentList);
- request.getRequestDispatcher("/admin/listdepartment.jsp").include(request, response);
- return null;
- }
- public String addDepartment(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("/admin/adddepartment.jsp").include(request, response);
- return null;
- }
- public String toUpdatePage(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
- Department department =new Department();
- department.setName(request.getParameter("name"));
- department.setId(new Long(request.getParameter("id")));
- departmentService.updateDepartment(department);
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("./public/alert.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- out.println("<script>ok_alert(\"修改成功!\",\"main.jsp?method=listDepartment&servlet=DepartmentServlet\");</script>");
- return null;
- }
- public String UpdateDepartment(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
- String id = request.getParameter("id");
- response.setContentType("text/html;charset=utf-8");
- Department departmentList= departmentService.findDepartmentById(id);
- request.setAttribute("departmentList", departmentList);
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("/admin/updatedepartment.jsp").include(request, response);
- return null;
- }
-
- public String addToDepartment(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
- Department department =new Department();
- department.setName(request.getParameter("name"));
- departmentService.saveDepartment(department);
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("./public/alert.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- out.println("<script>ok_alert(\"添加成功!\",\"main.jsp?method=listDepartment&servlet=DepartmentServlet\");</script>");
- return null;
- }
- public String departmentDelete(HttpServletRequest request, HttpServletResponse response) throws Exception{
- String id = request.getParameter("id");
- departmentService.delete(id);
- response.setContentType("text/html;charset=utf-8");
- request.getRequestDispatcher("./public/alert.jsp").include(request, response);
- PrintWriter out = response.getWriter();
- out.println("<script>ok_alert(\"删除成功\",\"main.jsp?method=listDepartment&servlet=DepartmentServlet\");</script>");
- return null;
- }
- }
长久以来,企业员工信息管理工作基本上采用的都是过时的管理方式来记录员工的相关信息,这种管理方式的缺点很明显,比如说,员工请假方面需要员工亲自手工申请才能达到请假的目的,严重浪费了太多时间,减少了企业的工作效率。对于小规模企业来说,员工想对较少,这种管理方式还勉强可以接受,但对于规模比较大的企业来说,员工的信息比较多,人工记录非常容易出错,极大的增加了信息管理人员的负担。在国内,大多数企业原有的管理方式已经适应不了形势的发展,急需进行改进,当前的形势下,计算机的出现加强了企业的发展,急需一个信息化管理的系统来实现对员工信息的管理,加强企业的管理模式,使企业更好的适应社会的发展,能够在当前全速发展的浪潮中全速发展。建立一个信息化管理的员工信息管理系统是企业适应社会发展形势的必经之路。
为满足企业发展需求,决定采用各种编程语言JSP开发了基于B/S架构的员工信息管理系统,员工信息管理系统是涉及信息科学、数据计算和计算机技术的复杂的人机交互系统。通过该系统,可以对员工信息管理工作以及考勤工作进行信息化管理,加强上下级之间的联系,有效地记录并查询员工信息、考勤等情况,使企业的员工管理更加高效。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。