基于javaweb的SSM+Maven企业oa管理系统(java+ssm+html+layui+bootstrap+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

040023162402

050023162402

060023162402

080023162402

090023162402

100023162402

基于javaweb的SSM+Maven企业oa管理系统(java+ssm+html+layui+bootstrap+mysql)

项目介绍

本项目包含管理员与普通员工两种角色, 管理员角色包含以下功能: 岗位管理,部门管理,工龄奖金管理,员工管理,考勤管理,工资查询,职称管理,统计图表,工资项管理,管理员登录等功能。 员工角色包含以下功能: 个人信息管理,工资详情,考勤管理,员工登录等功能。

环境需要

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. 前端:HTML+CSS+JavaScript+LayUI+jquery+bootstrap

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中dbconfig.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ssm_esms_oa 登录 注:tomcat中需配置路径为/ssm_esms_oa,否则会有异常 管理员账号/密码:admin/admin 用户账号/密码:18080833/123456

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
        Map<String,String> map = new HashMap<String, String>();
if (!excel.isEmpty()) {
String result = importDataService.insertMATable(excel);
map.put("result",result);
return map;
/*if (importDataService.insertMATable(excel)) {
//return "admin/importData/success.jsp";
map.put("result","导入成功");
return map;
}
else{
map.put("result","只能导入Microsoft Excel 97-2003 工作表 (.xls),请检查文件是否正确");
return map;
}*/
} else {
map.put("result","导入的文件不存在,请重新选择文件");
return map;
}
}

/**
*
* @param excel 补发金额表excel
* @return
*/
@RequestMapping("/importReissue.do")
@ResponseBody
public Map<String,String> importReissueTable(@RequestParam("file") MultipartFile excel) throws Exception{
Map<String,String> map = new HashMap<String, String>();
if (!excel.isEmpty()) {
String result = importDataService.insertReissueTable(excel);
map.put("result",result);
return map;
}
else {
map.put("result","导入的文件不存在,请重新选择文件");
return map;
}
}
}
package com.esms.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
            @RequestParam(value="limit", defaultValue="10") int limit,
@RequestParam(value="year", defaultValue="1") String year,
HttpSession httpSession) throws Exception {

Integer eId = (Integer) httpSession.getAttribute("employeeId");
//pageNum:起始页面 pageSize:每页的大小
PageHelper.startPage(pageNum,limit);
//查找条件,一定要紧跟在startPage后
List<Salary> salaryList = userInforService.getEmployeeSalaryList(eId, year);

PageInfo pageResult = new PageInfo(salaryList);

//设置前台需要的数据
EmployeeSalaryVO employeeSalaryVO = new EmployeeSalaryVO();
employeeSalaryVO.setCode(0);
employeeSalaryVO.setMsg("");
employeeSalaryVO.setCount((int) pageResult.getTotal());
employeeSalaryVO.setData(pageResult.getList());
return employeeSalaryVO;
}

}
package com.esms.controller;



/**
* @Description: 管理员和员工登陆控制
**/
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
* 
*/

@Controller
@RequestMapping("/department")
public class DepartmentController {
@Autowired
public DepartmentService departmentService = null;

/**
* 查找部门
* @param pageNum
* @param limit
* @param d_name
* @return
* @throws Exception
*/
@RequestMapping("/findSelective.do")
@ResponseBody
public DepartmentPages findSelective(
@RequestParam(value="page", defaultValue="1")int pageNum,
@RequestParam(value="limit", defaultValue="5") int limit,
@RequestParam(value="d_name", defaultValue="") String d_name) throws Exception {
List<Department> list;

//模糊查询,有多少个条件就接收多少个字段

Department department = new Department();
department.setdName(d_name);

//pageNum:起始页面 pageSize:每页的大小
PageHelper.startPage(pageNum,limit);
//查找条件,一定要紧跟在startPage后
list = departmentService.findSelective(department);
PageInfo pageResult = new PageInfo(list);

//设置前台需要的数据
DepartmentPages departmentPages = new DepartmentPages();
departmentPages.setCode(0);
departmentPages.setMsg("");
departmentPages.setCount((int) pageResult.getTotal());
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
    @Autowired
private MonthlyAttendanceCustomVoMapper monthlyAttendanceCustomVoMapper = null;

@Autowired
private MonthlyAttendanceMapper monthlyAttendanceMapper = null;

@RequestMapping("test.do")
@ResponseBody
public List<MonthlyAttendanceCustomVo> test(){
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("e_account","4");
map.put("d_id",4);
List<MonthlyAttendanceCustomVo> monthlyAttendanceCustomVos =
monthlyAttendanceCustomVoMapper.selectMonthlyAttendanceCustomVoMapperByeAccountAnddIdAndTime(map);
return monthlyAttendanceCustomVos;
}


/**
* 查找
* @param pageNum
* @param limit
* @param e_account
* @param d_id
* @param attendance_time
* @return
* @throws Exception
*/
@RequestMapping("/findSelective.do")
@ResponseBody
public MonthlyAttendancePages findSelective(
@RequestParam(value="page", defaultValue="1")int pageNum,
@RequestParam(value="limit", defaultValue="5") int limit,
@RequestParam(value="e_account", defaultValue="") String e_account,
@RequestParam(value="d_id", defaultValue="0") int d_id,
@RequestParam(value="attendance_time", defaultValue="") String attendance_time) throws Exception {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("e_account",e_account);
map.put("d_id",d_id);
map.put("attendance_time",attendance_time);
//pageNum:起始页面 pageSize:每页的大小
PageHelper.startPage(pageNum,limit);
//查找条件,一定要紧跟在startPage后
List<MonthlyAttendanceCustomVo> list =
monthlyAttendanceCustomVoMapper.selectMonthlyAttendanceCustomVoMapperByeAccountAnddIdAndTime(map);
// System.out.println(list.get(0).getMonthlyAttendance().getAttendanceTime()+"========================");
PageInfo pageResult = new PageInfo(list);

//设置前台需要的数据
MonthlyAttendancePages monthlyAttendancePages = new MonthlyAttendancePages();
monthlyAttendancePages.setCode(0);
monthlyAttendancePages.setMsg("");
monthlyAttendancePages.setCount((int) pageResult.getTotal());
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
        positionService.deleteByPrimaryKey(id);
return 1;
}


/**
* 批量删除
* @param ids
*/
@RequestMapping("/deleteByQuery.do")
public void deleteByQuery (@RequestParam(value = "arr")int[] ids) {
//批量删除,实则修改状态为0
//如果有id才执行
if(ids.length > 0) {
positionService.deleteByQuery(ids);
}


}
}
package com.esms.controller;




/**
* Created with IntelliJ IDEA.
* Description:
* User: Lizefeng


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