基于javaweb的SSM企业人事管理系统(java+ssm+jsp+h-ui+echarts+ztree+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

230023462402

240023462402

250023462402

260023462402

270023462402

280023462402

基于javaweb的SSM企业人事管理系统(java+ssm+jsp+h-ui+echarts+ztree+mysql)

项目介绍

本项目包含管理员与用户角色;

管理员角色包含以下功能: 管理员登录,修改管理员资料,用户管理,公告管理,部门管理,职位管理,员工管理,薪资管理,出勤管理等功能。

用户角色包含以下功能: 用户登录,修改个人资料,查看公告,部门查看,查看职位,员工查看,查看薪资,查看出勤等功能。

环境需要

1.运行环境:最好是jaa 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.是否Maen项目:否;

技术栈

  1. 后端:Spring+SpringMC+Mybatis 2. 前端:JSP+CSS+JaaScript+h-ui+jquery+echarts+zTree

使用说明

  1. 使用Naicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maen项目请选择maen; 若为maen项目,导入成功后请执行maen clean;maen install命令,然后运行; 3. 将项目中src/config/spring-mc.xml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录

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
			util = new User();                                             
util.setId(Integer.parseInt(id));
try{
gongaoMapper.deleteObject(util.getId());
}catch(Exception e){}
}
return this.getAllUtil(request, model);
}

@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, Gongao util, Model model) {
List<Gongao> list = gongaoMapper.getObjectList("s_0", util.getS_0());
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Gongao/saveOrUpdate";
}
gongaoMapper.insertObject(util);
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Gongao/saveOrUpdate";
}
gongaoMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
}
package graduation.design.controller;

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
		
}

}
package com.baidu.ueditor.upload;





public class BinaryUploader {

public static final State save(HttpServletRequest request,
Map<String, Object> conf) {
FileItemStream fileStream = null;
boolean isAjaxUpload = request.getHeader( "X_Requested_With" ) != null;

if (!ServletFileUpload.isMultipartContent(request)) {
return new BaseState(false, AppInfo.NOT_MULTIPART_CONTENT);
}

ServletFileUpload upload = new ServletFileUpload(
new DiskFileItemFactory());

if ( isAjaxUpload ) {
upload.setHeaderEncoding( "UTF-8" );
}
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
	@RequestMapping(value = "/deleteManyUtil.do")                    
public String deleteManyUtil(HttpServletRequest request, User util,
Model model) {
String ids[] = request.getParameterValues("id");
for (String id : ids) {
util = new User();
util.setId(Integer.parseInt(id));
try{
chuqinMapper.deleteObject(util.getId());
}catch(Exception e){}
}
return this.getAllUtil(request, model);
}

@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, Chuqin util, Model model) {
List<Chuqin> list = chuqinMapper.getObjectList("s_0", util.getS_0());
List<Kaoqinstatus> listKaoqinstatus = kaoqinstatusMapper.getObjectList(null, null);
model.addAttribute("listKaoqinstatus", listKaoqinstatus);
List<YuangongguanliFile> listYuangongguanliFile = yuangongguanliFileMapper.getObjectList(null, null);
model.addAttribute("listYuangongguanliFile", listYuangongguanliFile);
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Chuqin/saveOrUpdate";
}
chuqinMapper.insertObject(util);
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Chuqin/saveOrUpdate";
}
chuqinMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
}
package graduation.design.controller;



@Controller
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
		model.addAttribute("errMsg", "密码信息不能为空");
model.addAttribute("util", userTmp);
return "User/updatepwd";
}

if (!newPwd.equals(rePwd)) {
model.addAttribute("errMsg", "确认密码不一致");
model.addAttribute("util", userTmp);
return "User/updatepwd";
}

if (newPwd.equals(oldPwd)) {
model.addAttribute("errMsg", "旧密码不能与新密码一致");
model.addAttribute("util", userTmp);
return "User/updatepwd";
}

if (!oldPwd.equals(userTmp.getS_1())) {
model.addAttribute("errMsg", "旧密码错误");
model.addAttribute("util", userTmp);
return "User/updatepwd";
}
userTmp.setS_1(newPwd);
userMapper.updateObject(userTmp);
return "User/uppwdok";
}

@RequestMapping(value = "/updateinfo.do")
public String updateinfo(HttpServletRequest request, User util, Model model) {
userMapper.updateObject(util);
model.addAttribute("util", util);
model.addAttribute("errMsg", "个人信息修改成功");
return "User/updateinfo";
}

@RequestMapping(value = "/beforepass.do")
public String beforepass(HttpServletRequest request, User util, Model model) {
HttpSession session = request.getSession();
int user_id = (Integer) session.getAttribute("user_id");
util = userMapper.selectObject(user_id);
model.addAttribute("util", util);
return "User/updatepwd";
}

@RequestMapping(value = "/beforeinfo.do")
public String beforeinfo(HttpServletRequest request, User util, Model model) {
HttpSession session = request.getSession();
int user_id = (Integer) session.getAttribute("user_id");
util = userMapper.selectObject(user_id);
model.addAttribute("util", util);
return "User/updateinfo";
}

@RequestMapping(value = "/register.do")
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
		int h = 20;
java.util.Random random = new java.util.Random();
BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics pen = img.getGraphics();
pen.setColor(Color.WHITE);
pen.fillRect(0, 0, w, h);
for (int i = 0; i < 50; i++) {
pen.setColor(new Color(random.nextInt(255), random.nextInt(255),
random.nextInt(255)));
int x1 = random.nextInt(w);
int y1 = random.nextInt(h);
int x2 = random.nextInt(10) + x1;
int y2 = random.nextInt(10) + y1;
pen.drawLine(x1, y1, x2, y2);
}
StringBuffer sb = new StringBuffer();
pen.setFont(new Font("黑体", Font.BOLD, 16));
for (int i = 0; i < 4; i++) {
pen.setColor(new Color(random.nextInt(100), random.nextInt(100),
random.nextInt(100)));
String num = String.valueOf(random.nextInt(10));
pen.drawString(num, i * 20 + 10, 15);
sb.append(num);
}
request.getSession().setAttribute("code", sb.toString());
response.setHeader("Pragma", "no-store");
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");
ImageIO.write(img, "jpeg", response.getOutputStream());
}


}
package com.baidu.ueditor.upload;


public class Uploader {
private HttpServletRequest request = null;
private Map<String, Object> conf = null;

public Uploader(HttpServletRequest request, Map<String, Object> conf) {
this.request = request;
this.conf = conf;
}

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
	model.addAttribute("util", util);
return "User/saveOrUpdate";
}

@SuppressWarnings({ "rawtypes", "unchecked" })
@RequestMapping(value = "/getAllUtil.do")
public String getAllUtil(HttpServletRequest request, User util, Model model) {
String field = request.getParameter("field");
String fieldValue = request.getParameter("fieldValue");
String pageNo = request.getParameter("pageModel.currentPageNo");
int currentPageNo = 1;
try {
fieldValue = new String(fieldValue.getBytes("UTF-8"), "UTF-8");
currentPageNo = Integer.parseInt(pageNo);
} catch (Exception e) {
}
List<User> list = userMapper.getObjectList(field, fieldValue);
PageModel pageModel = new PageModel();
pageModel = pageModel.getUtilByController(list, currentPageNo);
model.addAttribute("pageModel", pageModel);
model.addAttribute("fieldValue", fieldValue);
model.addAttribute("field", field);
return "User/find";
}

@RequestMapping(value = "/deleteManyUtil.do")
public String deleteManyUtil(HttpServletRequest request, User util,
Model model) {
String ids[] = request.getParameterValues("id");
for (String id : ids) {
util = new User();
util.setId(Integer.parseInt(id));
try {
userMapper.deleteObject(util.getId());
} catch (Exception e) {
}
}
return this.getAllUtil(request, util, model);
}

@RequestMapping(value = "/deleteUtil.do")
public String deleteUtil(HttpServletRequest request, User util, Model model) {
try {
userMapper.deleteObject(util.getId());
} catch (Exception e) {


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