关于后端:基于SSM的人事管理系统文档

39次阅读

共计 11450 个字符,预计需要花费 29 分钟才能阅读完成。


  博主介绍:✌退职 Java 研发工程师、专一于程序设计、源码分享、技术交换、专一于 Java 技术畛域和毕业设计✌

项目名称

基于 SSM 的人事管理系统 + 文档

下载地址

基于 SSM 的人事管理系统 + 文档

视频演示

基于 SSM 的人事管理系统_哔哩哔哩_bilibili

零碎介绍

摘 要

古代企业人事管理中,高效治理形式对于进步企业竞争力和倒退至关重要。传统人事管理办法通常遵循固定流程,不足应变能力,难以应答各种变动和挑战。管理层通常负责制订政策和流程,员工参与度不高,可能导致较低的归属感和忠诚度。此外,传统人事管理易出错,工作繁琐,效率低下,难以适应古代企业管理制度的需要。因而,开发联合计算机技术的古代企业人事信息管理系统已成为进步人事管理品质和效率的要害路径。

本文介绍了一款基于 SSM+MySQL 框架开发的人事管理系统。该零碎具备齐备的功能设计,满足日常人事管理的各项需要,包含员工治理、财务人员治理、部门治理、岗位治理、工资管理、招聘治理、销假治理和考勤治理等模块。零碎中的角色分为管理员、员工和财务人员三类,各自负责相应的功能模块。总的来说,该零碎性能全面、应用便捷,已具备商业利用的条件。

关键词:人事管理系统;SSM 框架;信息管理;MySQL

3.1  需要剖析

人力资源管理是企业治理的重要组成部分,随着企业规模的扩充和竞争的加剧,越来越多的企业开始器重人力资源管理,从而推动了人事管理系统市场的倒退。市场规模:人事管理系统市场规模逐年扩充,依据市场钻研报告,寰球人事管理软件市场规模预计将在将来几年内以年均复合增长率超过 10% 的速度增长。市场需求:随着企业规模的扩充和员工数量的减少,传统的人力资源管理形式曾经无奈满足企业的需要。人事管理系统的需要越来越强烈,企业须要一个集成化的零碎来治理员工的信息、考勤、薪资等。市场趋势:随着云计算、大数据和人工智能技术的倒退,人事管理系统市场正在朝着智能化和云化方向倒退。将来的人事管理系统将更加智能化、自动化、数字化和挪动化。竞争态势:人事管理系统市场竞争强烈,次要竞争对手包含 SAP、Oracle、Workday、ADP 等国内知名企业和一些外乡企业。在竞争中,企业须要不断创新和降级,进步产品质量和服务水平,以取得市场竞争劣势。发展趋势:将来人事管理系统将向数字化、智能化和自动化方向倒退,能够预感,将来人事管理系统将更加智能化、自动化、数字化和挪动化。同时,企业还须要关注员工隐衷爱护、信息安全等问题,增强数据安全保障。

3.2  零碎可行性剖析

3.2.1 技术可行性

零碎技术可行性是指在技术层面上,零碎是否可能顺利地实现预期的性能,并且满足性能、稳定性、安全性等要求。在进行人事管理系统的技术可行性剖析时,须要思考以下几个方面:

首先,须要依据需要剖析和功能设计,确定零碎的技术计划。在抉择开发语言、数据库、服务器等技术计划时,须要思考技术成熟度、开发效率、扩展性等因素,从而保证系统的可行性。

其次,零碎的架构也是零碎设计的外围。在零碎架构设计时,须要思考零碎的可扩展性、可维护性、可降级性等因素,从而保证系统的技术可行性。

3.2.2 经济可行性

针对一款合格的网络系统的开发来说,次要是硬件费用、软件费用以及人工工夫的老本。对于本次零碎来说采纳的硬件只须要一台联网的电脑即可,因为当初的电脑配置广泛都可能反对 Web 零碎的开发,并且能够将电脑作为服务器进行零碎的客户端和服务器的运行。另外软件上,零碎开发工具、数据库管理工具、数据库建模工具、客户端浏览器都能够收费下载到并投以应用,所以也不须要什么老本。零碎的开发次要是人工的工夫老本,只有对于开发技术把握纯熟,并且对于问题的查找有肯定的教训,就可能在很短时间内开发出本零碎。

3.2.3 操作可行性

该我的项目只须要在一台电脑上运行即可操作,对电脑的硬件要求并不会很高,根本配置的电脑都可运行。现如今家家户户个别都会有配置电脑,所以基本上不会存在额定开销。并且我的项目操作简略便携,不会存在很高的培训老本即可应用该零碎。

3.3  我的项目设计指标与准则

1. 公司人事管理制度的根本要求

公司人事管理制度的根本要求包含多个方面。首先,性能需要应笼罩集体核心、员工治理、部门经理治理、部门信息管理、员工考勤治理、签到治理、销假治理、薪资查问治理和部门类型治理模块。其次,鉴于人事管理系统须要存储大量信息,对存储容量有较高要求,因而必须依赖弱小的数据库来确保信息存储的平安与稳固。此外,为保障平安及保密性,平台必须履行实名注册制度,仅容许实名注册用户登录零碎。最初,环境方面要求灵便,操作系统能够应用 Windows、Vista 等。

2. 设计准则

稳定性和完整性是人事管理系统必要条件,在开发该零碎时,采纳了 JSP 技术,这样的话,能够在后续 Mysql 数据库开发中,保障该零碎达到咱们的初始指标。

(1)零碎响应效率:现阶段人们对效率的要求看的很高,为此我在开发人事管理系统的时候充分考虑到此方面问题,对系统响应效率着重对待,所以人事管理系统反对多人应用工作。

(2)操作简略晦涩:该零碎使用者大多数都是简略理解计算机的人,所以操作要简单明了,以便用户应用。

(3)零碎晦涩稳固:掂量一个零碎最根底的指标是做到运行晦涩、无卡顿、含糊等状况。

环境须要

1. 运行环境:最好是 java jdk 1.8,咱们在这个平台上运行的。其余版本实践上也能够。
2.IDE 环境:IDEA,Eclipse,Myeclipse 都能够。举荐 IDEA;
3.tomcat 环境:Tomcat 7.x,8.x,9.x 版本均可
4. 硬件环境:windows 7/8/10 1G 内存以上;或者 Mac OS;
5. 数据库:MySql 5.7 版本;
6. 是否 Maven 我的项目:否;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis
  2. 前端:JSP+CSS+JavaScript+jQuery

应用阐明

  1. 应用 Navicat 或者其它工具,在 mysql 中创立对应名称的数据库,并导入我的项目的 sql 文件;
  2. 应用 IDEA/Eclipse/MyEclipse 导入我的项目,Eclipse/MyEclipse 导入时,若为 maven 我的项目请抉择 maven;
    若为 maven 我的项目,导入胜利后请执行 maven clean;maven install 命令,而后运行;
  3. 将我的项目中 springmvc-servlet.xml 配置文件中的数据库配置改为本人的配置;
  4. 运行我的项目,在浏览器中输出 http://localhost:8080/ 登录

运行截图

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

​编辑

 用户管理控制层:

package com.houserss.controller;

import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.houserss.common.Const;
import com.houserss.common.Const.Role;
import com.houserss.common.ServerResponse;
import com.houserss.pojo.User;
import com.houserss.service.IUserService;
import com.houserss.service.impl.UserServiceImpl;
import com.houserss.util.MD5Util;
import com.houserss.util.TimeUtils;
import com.houserss.vo.DeleteHouseVo;
import com.houserss.vo.PageInfoVo;

/**

  • Created by admin
    */

@Controller
@RequestMapping(“/user/”)
public class UserController {

@Autowired
private IUserService iUserService;

/**
 * 用户登录
 * @param username
 * @param password
 * @param session
 * @return
 */
@RequestMapping(value = "login.do",method = RequestMethod.POST)
@ResponseBody
public ServerResponse<User> login(User user,String uvcode, HttpSession session){String code = (String)session.getAttribute("validationCode");
    if(StringUtils.isNotBlank(code)) {if(!code.equalsIgnoreCase(uvcode)) {return ServerResponse.createByErrorMessage("验证码不正确");
        }
    }
    ServerResponse<User> response = iUserService.login(user.getUsername(),user.getPassword());
    if(response.isSuccess()){session.setAttribute(Const.CURRENT_USER,response.getData());
    }
    return response;
}



}

管理员管理控制层:

package com.sxl.controller.admin;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sxl.controller.MyController;

@Controller(“adminController”)
@RequestMapping(value = “/admin”)
public class AdminController extends MyController {



@RequestMapping(value = "/index")
public String frame(Model model, HttpServletRequest request)throws Exception {return "/admin/index";}

@RequestMapping(value = "/main")
public String main(Model model, HttpServletRequest request)throws Exception {return "/admin/main";}

@RequestMapping(value = "/tj1")
public String tj1(Model model, HttpServletRequest request)throws Exception {String sql="select DATE_FORMAT(insertDate,'%Y-%m-%d') dates,sum(allPrice) price from t_order order by DATE_FORMAT(insertDate,'%Y-%m-%d')  desc";
    List<Map> list = db.queryForList(sql);
    model.addAttribute("list", list);
    System.out.println(list);
    return "/admin/tj/tj1";
}


@RequestMapping(value = "/password")
public String password(Model model, HttpServletRequest request)throws Exception {return "/admin/password";}


@RequestMapping(value = "/changePassword")
public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {Map admin = getAdmin(request);
    if(oldPassword.equals(admin.get("password").toString())){
        String sql="update t_admin set password=? where id=?";
        db.update(sql, new Object[]{newPassword,admin.get("id")});
        return renderData(true,"1",null);
    }else{return renderData(false,"1",null);
    }
}

}

批改明码业务逻辑:

package com.sxl.controller.admin;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sxl.controller.MyController;

@Controller(“userController”)
@RequestMapping(value = “/user”)
public class UserController extends MyController {



@RequestMapping(value = "/index")
public String frame(Model model, HttpServletRequest request)throws Exception {return "/user/index";}

@RequestMapping(value = "/main")
public String main(Model model, HttpServletRequest request)throws Exception {return "/user/main";}


@RequestMapping(value = "/password")
public String password(Model model, HttpServletRequest request)throws Exception {return "/user/password";}


@RequestMapping(value = "/changePassword")
public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {Map user = getUser(request);
    if(oldPassword.equals(user.get("password").toString())){
        String sql="update t_user set password=? where id=?";
        db.update(sql, new Object[]{newPassword,user.get("id")});
        return renderData(true,"1",null);
    }else{return renderData(false,"1",null);
    }
}
@RequestMapping(value = "/mine")
public String mine(Model model, HttpServletRequest request)throws Exception {

Map user =getUser(request);Map map = db.queryForMap(“select * from t_user where id=?”,new Object[]{user.get(“id”)});model.addAttribute(“map”, map); return “/user/mine”;

}



@RequestMapping(value = "/mineSave")
public ResponseEntity<String> mineSave(Model model,HttpServletRequest request,Long id
    ,String username,String password,String name,String gh,String mobile) throws Exception{
    int result = 0;
        String sql="update t_user set name=?,gh=?,mobile=? where id=?";
        result = db.update(sql, new Object[]{name,gh,mobile,id});
    if(result==1){return renderData(true,"操作胜利",null);
    }else{return renderData(false,"操作失败",null);
    }
}
}

通用治理模块:

package com.sxl.controller;

import java.nio.charset.Charset;
import java.util.Locale;
import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;

import com.sxl.util.JacksonJsonUtil;
import com.sxl.util.StringUtil;
import com.sxl.util.SystemProperties;

public class BaseController {

public static final Long EXPIRES_IN = 1000 * 3600 * 24 * 1L;// 1 天

@Autowired
private SystemProperties systemProperties;

/**
 * 取得配置文件内容
 */
public String getConfig(String key) {return systemProperties.getProperties(key);
}

/**
 * 返回服务器地址 like http://192.168.1.1:8441/UUBean/
 */
public String getHostUrl(HttpServletRequest request) {String hostName = request.getServerName();
    Integer hostPort = request.getServerPort();
    String path = request.getContextPath();

    if (hostPort == 80) {return "http://" + hostName + path + "/";} else {return "http://" + hostName + ":" + hostPort + path + "/";}
}

/***
 * 获取以后的 website 门路 String
 */
public static String getWebSite(HttpServletRequest request) {String returnUrl = request.getScheme() + "://"
            + request.getServerName();

    if (request.getServerPort() != 80) {returnUrl += ":" + request.getServerPort();
    }

    returnUrl += request.getContextPath();

    return returnUrl;
}



/**
 * 初始化 HTTP 头.
 * 
 * @return HttpHeaders
 */
public HttpHeaders initHttpHeaders() {HttpHeaders headers = new HttpHeaders();
    MediaType mediaType = new MediaType("text", "html",
            Charset.forName("utf-8"));
    headers.setContentType(mediaType);
    return headers;
}

/**
 * 返回 信息数据
 * 
 * @param status
 * @param msg
 * @return
 */
public ResponseEntity<String> renderMsg(Boolean status, String msg) {if (StringUtils.isEmpty(msg)) {msg = "";}
    String str = "{\"status\":\"" + status + "\",\"msg\":\""+ msg +"\"}";
    ResponseEntity<String> responseEntity = new ResponseEntity<String>(str,
            initHttpHeaders(), HttpStatus.OK);
    return responseEntity;
}

/**
 * 返回 obj 数据
 * 
 * @param status
 * @param msg
 * @param obj
 * @return
 */
public ResponseEntity<String> renderData(Boolean status, String msg,
        Object obj) {if (StringUtils.isEmpty(msg)) {msg = "";}
    StringBuffer sb = new StringBuffer();
    sb.append("{");
    sb.append("\"status\":\"" + status + "\",\"msg\":\""+ msg +"\",");
    sb.append("\"data\":" + JacksonJsonUtil.toJson(obj) + "");
    sb.append("}");

    ResponseEntity<String> responseEntity = new ResponseEntity<String>(sb.toString(), initHttpHeaders(), HttpStatus.OK);
    return responseEntity;
}


/***
 * 获取 IP(如果是多级代理,则失去的是一串 IP 值)*/
public static String getIpAddr(HttpServletRequest request) {String ip = request.getHeader("x-forwarded-for");
    if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {ip = request.getHeader("Proxy-Client-IP");
    }

    if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {ip = request.getHeader("WL-Proxy-Client-IP");
    }

    if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {ip = request.getRemoteAddr();
    }

    if (ip != null && ip.length() > 0) {String[] ips = ip.split(",");
        for (int i = 0; i < ips.length; i++) {if (!"unknown".equalsIgnoreCase(ips[i])) {ip = ips[i];
                break;
            }
        }
    }

    return ip;
}

/**
 * 国际化取得语言内容
 * 
 * @param key
 *            语言 key
 * @param args
 * @param argsSplit
 * @param defaultMessage
 * @param locale
 * @return
 */
public static String getLanguage(String key, String args, String argsSplit,
        String defaultMessage, String locale) {
    String language = "zh";
    String contry = "cn";
    String returnValue = defaultMessage;

    if (!StringUtil.isEmpty(locale)) {
        try {String[] localeArray = locale.split("_");
            language = localeArray[0];
            contry = localeArray[1];
        } catch (Exception e) {}}

    try {
        ResourceBundle resource = ResourceBundle.getBundle("lang.resource",
                new Locale(language, contry));
        returnValue = resource.getString(key);
        if (!StringUtil.isEmpty(args)) {String[] argsArray = args.split(argsSplit);
            for (int i = 0; i < argsArray.length; i++) {returnValue = returnValue.replace("{" + i + "}",
                        argsArray[i]);
            }
        }
    } catch (Exception e) { }

    return returnValue;
}

}

正文完
 0