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

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

590023152402

000023162402

010023162402

020023162402

030023162402

基于javaweb的SSM+Maven企业绩效工资管理系统(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 登录 注:tomcat中需配置路径为/ssm_esms,否则会有异常 管理员账号/密码: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
44
45
46
47
48
49
    departmentPages.setMsg("");
departmentPages.setCount((int) pageResult.getTotal());
departmentPages.setData(pageResult.getList());

return departmentPages;
}

/**
* 添加部门
* @param d_name
* @param d_remark
* @return
* @throws Exception
*/
@RequestMapping("/add.do")
@ResponseBody
public int add(String d_name, String d_remark) throws Exception {

Department department = departmentService.findByDname(d_name);

//查找是否同名
if(department != null) {
return department.getdId();
} else {
Department d = new Department();
d.setdId(null);
d.setdName(d_name);
d.setdRemark(d_remark);
d.setdIsdel(1);
departmentService.insertSelective(d);
return 0;
}
}


/**
* 查找一个部门
* @param id
* @return
* @throws Exception
*/
@RequestMapping("/findByPrimaryKey.do")
@ResponseBody
public Department findByPrimaryKey(int id) throws Exception {
Department department = departmentService.selectByPrimaryKey(id);
return department;
}

/**
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


/**
* @Description
*/
@Controller
@RequestMapping("/monthlyattendance")
public class MonthlyAttendanceController{
@Autowired
private MonthlyAttendanceServiceImpl monthlyAttendanceService;

@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
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
}

/*
* 获取随机数颜色
*/
private static Color getRandomColor()
{
return new Color(random.nextInt(255),random.nextInt(255),
random.nextInt(255));
}

/*
* 返回某颜色的反色
*/
private static Color getReverseColor(Color c)
{
return new Color(255 - c.getRed(), 255 - c.getGreen(),255 - c.getBlue());
}

public static void outputCaptcha(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("image/jpeg");
// 获取验证码字符串
String identifyingCode = getRandomString();
request.getSession(true).setAttribute("identifyingCode", identifyingCode);

int width = 100;
int height = 30;

Color color = getRandomColor();
Color reverse = getReverseColor(color);

BufferedImage bi = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
Graphics2D g = bi.createGraphics();
g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));
g.setColor(color);
g.fillRect(0, 0, width, height);
g.setColor(reverse);
g.drawString(identifyingCode, 18, 20);
for (int i = 0, n = random.nextInt(100); i < n; i++)
{
g.drawRect(random.nextInt(width), random.nextInt(height), 1, 1);
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
    /**
* 删除
* @param id
* @throws Exception
*/
@RequestMapping("/deleteByPrimaryKey.do")
@ResponseBody
public int deleteByPrimaryKey(int id) throws Exception {

// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
// Date date = new Date();
// System.out.println(df.format(new Date()));// new Date()为获取当前系统时间

//假删除,设置离职时间
Employee employee = new Employee();
employee.seteId(id);
employee.seteLeaveTime(new Date());
employee.seteIsdel(0);
employeeService.updateByPrimaryKeySelective(employee);
return 1;
}

/**
* 批量删除
* @param ids
*/
@RequestMapping("/deleteByQuery.do")
@ResponseBody
public int deleteByQuery (@RequestParam(value = "arr")int[] ids) {
// System.out.println(ids+"&"+ids.length);
// for (int i =0 ; i< ids.length;i++) {
// System.out.println(ids[i]);
// }
//假删除
//如果有id才执行
if(ids.length > 0) {
employeeService.deleteByQuery(ids);
}
return 1;

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
    for(int i = 0; i < 4; i++)
{
buffer.append(CHARS[random.nextInt(CHARS.length)]);
}
return buffer.toString();
}

/*
* 获取随机数颜色
*/
private static Color getRandomColor()
{
return new Color(random.nextInt(255),random.nextInt(255),
random.nextInt(255));
}

/*
* 返回某颜色的反色
*/
private static Color getReverseColor(Color c)
{
return new Color(255 - c.getRed(), 255 - c.getGreen(),255 - c.getBlue());
}

public static void outputCaptcha(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("image/jpeg");
// 获取验证码字符串
String identifyingCode = getRandomString();
request.getSession(true).setAttribute("identifyingCode", identifyingCode);

int width = 100;
int height = 30;

Color color = getRandomColor();
Color reverse = getReverseColor(color);

BufferedImage bi = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
Graphics2D g = bi.createGraphics();
g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));
g.setColor(color);
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

@RequestMapping("updateInforEmployee.do")
public @ResponseBody String updateInforEmployee(HttpSession httpSession, Employee employee){
Integer id = (Integer) httpSession.getAttribute("employeeId");
employee.seteId(id);
int i = userInforService.updateEmploueeById(id,employee);
if (i==1){
return "1";
}else {
return "0";
}
}

// @RequestMapping("employeeSalaryList.do")
// @ResponseBody
// public EmployeeSalaryVO employeeSalaryList(@RequestParam(name="year",defaultValue = "1") String year,
// HttpSession httpSession){
// Integer eId = (Integer) httpSession.getAttribute("employeeId");
// List<Salary> salaryList = userInforService.getEmployeeSalaryList(eId, year);
//
// EmployeeSalaryVO employeeSalaryVO = new EmployeeSalaryVO();
// employeeSalaryVO.setCode(0);
// employeeSalaryVO.setMsg("");
// employeeSalaryVO.setCount((int) salaryList.size());
// employeeSalaryVO.setData(salaryList);
// return employeeSalaryVO;
// }


@RequestMapping("employeeSalaryList.do")
@ResponseBody
public EmployeeSalaryVO findSelective(
@RequestParam(value="page", defaultValue="1")int pageNum,
@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);


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