基于javaweb的SpringBoot企业员工绩效工资管理系统(java+springboot+freemarker+mysql+maven)

运行环境

Java≥8、MySQL≥5.7

开发工具

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

适用

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

功能说明

440023522402

450023522402

460023522402

480023522402

490023522402

510123072402

基于javaweb的SpringBoot企业员工绩效工资管理系统(java+springboot+freemarker+mysql+maven)

超级管理员等角色,除基础脚手架外,实现的功能有:

超级管理员:系统管理、用户管理(冻结等)、职称管理、部门管理(工资项)、岗位管理(考核指标管理,可指定部门)、工龄管理等。

普通员工:考勤管理(查看自己的考勤记录)、工资管理(查看自己的工资详情)。

HR人事:员工管理、考勤管理、工资管理。

部门经理:部门绩效考核管理、年度考核管理、考核指标管理。

运行环境:windows/Linux均可、jdk1.8、mysql5.7、idea/eclipse均可。

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
    //统一验证法验证
CodeMsg validate = ValidateEntityUtil.validate(jobTitle);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}

//判断是否已有该名称
if(jobTitleService.isExistName(jobTitle.getName(),0l)){
return Result.error(CodeMsg.ADMIN_JOB_TITLE_NAME_EXIST);
}

if(jobTitleService.save(jobTitle) == null){
return Result.error(CodeMsg.ADMIN_JOB_TITLE_SAVE_ERROR);
}
operaterLogService.add("添加职称,职称名:" + jobTitle.getName());
return Result.success(true);
}

/**
* 编辑页面
* @param model
* @param id
* @return
*/
@RequestMapping("/edit")
public String edit(Model model, @RequestParam(value = "id",required = true)Long id){
model.addAttribute("jobTitle",jobTitleService.find(id));
return "admin/job_title/edit";
}

/**
* 编辑表单提交处理
* @param jobTitle
* @return
*/
@RequestMapping(value = "/edit",method = RequestMethod.POST)
@ResponseBody
public Result<Boolean> edit(JobTitle jobTitle){
//统一验证法验证
CodeMsg validate = ValidateEntityUtil.validate(jobTitle);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}

if(jobTitle.getId() == null || jobTitle.getId().longValue() <= 0){
return Result.error(CodeMsg.ADMIN_JOB_TITLE_NO_EXIST);
}

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
        //实发工资
salary.setNetPayroll(netPayroll.add(individualIncomeTax));


return salary;
}

/**
* 发放工资
* @param id
* @return
*/
@RequestMapping(value = "/send",method = RequestMethod.POST)
@ResponseBody
public Result<Boolean> send(@RequestParam(name="id",required=true)Long id){
Salary salary = salaryService.find(id);
if(salary == null){
return Result.error(CodeMsg.ADMIN_SALARY_EMPRY);
}
if(salary.getIsStatus() == IsStatus.IS_ATTENDANCE){
return Result.error(CodeMsg.ADMIN_SALRY_STATUS_SEND);
}
if(salaryService.updateStatus(IsStatus.IS_ATTENDANCE,id) <= 0){
return Result.error(CodeMsg.ADMIN_SALARY_SEND_ERROR);
}
return Result.success(true);
}
/**
* 删除
* @param id
* @return
*/
@RequestMapping(value = "/delete",method = RequestMethod.POST)
@ResponseBody
public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
Salary salary = salaryService.find(id);
if(salary == null){
return Result.error(CodeMsg.ADMIN_SALARY_EMPRY);
}
if(salary.getIsStatus() == IsStatus.IS_ATTENDANCE){
return Result.error(CodeMsg.ADMIN_SALARY_HAS_SEND);
}
try{
salaryService.delete(id);
}catch (Exception e){
return Result.error(CodeMsg.ADMIN_SALARY_DELETE_ERROR);
}
return Result.success(true);
}
}
package com.yuanlrc.base.controller.admin;
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
 *
*/
@RequestMapping("/admin/user")
@Controller
public class UserController {

@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
@Autowired
private OperaterLogService operaterLogService;
/**
* 用户列表页面
* @param model
* @param user
* @param pageBean
* @return
*/
@RequestMapping(value="/list")
public String list(Model model,User user,PageBean<User> pageBean){
model.addAttribute("title", "用户列表");
model.addAttribute("username", user.getUsername());
model.addAttribute("pageBean", userService.findList(user, pageBean));
return "admin/user/list";
}

/**
* 新增用户页面
* @param model
* @return
*/
@RequestMapping(value="/add",method=RequestMethod.GET)
public String add(Model model){
model.addAttribute("roles", roleService.findAll());
return "admin/user/add";
}

/**
* 用户添加表单提交处理
* @param user
* @return
*/
@RequestMapping(value="/add",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> add(User user){
//用统一验证实体方法验证是否合法
CodeMsg validate = ValidateEntityUtil.validate(user);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
        }
try{
salaryService.delete(id);
}catch (Exception e){
return Result.error(CodeMsg.ADMIN_SALARY_DELETE_ERROR);
}
return Result.success(true);
}
}
package com.yuanlrc.base.controller.admin;



/**
* 考勤Controller
*/
@Controller
@RequestMapping("/admin/attendance")
public class AttendanceController {

@Autowired
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
    /**
* 添加年度考核
* @param annualAssessment
* @return
*/
@RequestMapping(value = "/add",method = RequestMethod.POST)
@ResponseBody
public Result<Boolean> add(AnnualAssessment annualAssessment,Long staffId){
if(staffId == null || staffId.longValue() <= 0){
return Result.error(CodeMsg.ADMIN_STAFF_NOT_EXIST_ERROR);
}
Staff staff = staffService.findByIdAndIsStatus(staffId, StaffStatus.ON_THE_JOB.getCode());
if(staff == null){
return Result.error(CodeMsg.ADMIN_STAFF_NOT_EXIST_ERROR);
}

CodeMsg validate = ValidateEntityUtil.validate(annualAssessment);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}

Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);
//获取去年的年份
int year = cal.get(Calendar.YEAR) - 1;

if(annualAssessmentService.findByStaffIdAndYear(staffId,year) != null){
return Result.error(CodeMsg.ANNUAL_YEAR_EXIST);
}

if(annualAssessmentService.save(annualAssessment,staff,year) == null){
return Result.error(CodeMsg.ADMIN_ANNUAL_ASSESSMENT_ERROR);
}

return Result.success(true);
}

}
package com.yuanlrc.base.util;



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