作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
本项目为前后端分离的项目;
系统分为管理员、经理、财务部长等多种角色,角色和角色对应权限可由管理员进行配置;
本系统包含登录、薪资管理(五险一金、参保城市、工资管理)、权限管理(角色管理、菜单管理)、系统管理(文件管理、员工管理、部门管理)、考勤管理(请假审批、考勤表现)、个人信息等功能
使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 前端推荐使用vscode;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
6.是否为前后端分离项目:是;
技术栈
后端框架:Springboot
前端技术:ElementUI、Vue、nodejs
使用说明
后端项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入源码中的hrm项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,控制台提示运行成功后再去运行前端项目;
前端项目运行:
1.打开运行中的cmd;
2.cd到vue-elementui-hrm文件夹目录;
3.执行命令:npm run serve
4. 运行成功后,在浏览器中输入地址:http://localhost:8080/
管理员:000001/123456
财务部部长:000002/123456
运行截图
相关代码
HomeController
package com.hrm.controller;
import com.hrm.dto.ResponseDTO;
import com.hrm.service.HomeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Author qiujie
* @Date 2022/2/27
* @Version 1.0
*/
@RestController
@RequestMapping("/home")
public class HomeController {
@Resource
private HomeService homeService;
@GetMapping("/staff")
public ResponseDTO getStaffData() {
return this.homeService.getStaffData();
}
@GetMapping("/count")
public ResponseDTO getCountData() {
return this.homeService.getCountData();
}
@GetMapping("/city")
public ResponseDTO getCityData() {
return this.homeService.getCityData();
}
@GetMapping("/attendance")
public ResponseDTO getAttendanceData(@RequestParam Integer id, String month) {
return this.homeService.getAttendanceData(id, month);
}
@GetMapping("/department")
public ResponseDTO getDepartmentData() {
return this.homeService.getDepartmentData();
}
}
StaffController
package com.hrm.controller;
import com.hrm.entity.Staff;
import com.hrm.dto.ResponseDTO;
import com.hrm.service.StaffRoleService;
import com.hrm.service.StaffService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author qiujie
* @since 2022-01-27
*/
@RestController
@RequestMapping("/staff")
public class StaffController {
@Resource
private StaffService staffService;
@Resource
private StaffRoleService staffRoleService;
@ApiOperation("新增")
@PostMapping
public ResponseDTO add(@RequestBody Staff staff){
return this.staffService.add(staff);
}
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
public ResponseDTO deleteById(@PathVariable Integer id){
return this.staffService.deleteById(id);
}
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids){
return this.staffService.deleteBatch(ids);
}
@ApiOperation("编辑更新")
@PutMapping
public ResponseDTO edit(@RequestBody Staff staff){
return this.staffService.edit(staff);
}
@ApiOperation("查询")
@GetMapping("/{id}")
public ResponseDTO findById(@PathVariable Integer id){
return this.staffService.findById(id);
}
@ApiOperation("多条件分页查询")
@PostMapping("/page")
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, @RequestBody Staff staff){
return this.staffService.list(current, size, staff);
}
@ApiOperation("数据导出接口")
@GetMapping("/export")
public ResponseDTO export(HttpServletResponse response) throws IOException {
return this.staffService.export(response);
}
@ApiOperation("数据导入接口")
@PostMapping("/import")
public ResponseDTO imp(MultipartFile file) throws IOException {
return this.staffService.imp(file);
}
@ApiOperation("为员工设置角色")
@PostMapping("/role/{staffId}")
public ResponseDTO setRole(@PathVariable Integer staffId, @RequestBody List<Integer> roleIds){
return this.staffRoleService.setRole(staffId, roleIds);
}
@ApiOperation("得到员工的角色")
@GetMapping("/role/{staffId}")
public ResponseDTO getRole(@PathVariable Integer staffId){
return this.staffRoleService.getRole(staffId);
}
@ApiOperation("检查员工的密码")
@GetMapping("/check/{pwd}/{id}")
public ResponseDTO checkPassword(@PathVariable String pwd,@PathVariable Integer id){
return this.staffService.checkPassword(pwd,id);
}
@ApiOperation("更新密码")
@PutMapping("/pwd")
public ResponseDTO updatePassword(@RequestBody Staff staff){
return this.staffService.updatePassword(staff);
}
}
StaffLeaveController
package com.hrm.controller;
import com.hrm.service.StaffLeaveService;
import com.hrm.entity.StaffLeave;
import com.hrm.dto.ResponseDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author qiujie
* @since 2022-04-05
*/
@RestController
@RequestMapping("/staff-leave")
public class StaffLeaveController {
@Resource
private StaffLeaveService staffLeaveService;
@ApiOperation("新增")
@PostMapping
public ResponseDTO add(@RequestBody StaffLeave staffLeave) {
return this.staffLeaveService.add(staffLeave);
}
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
public ResponseDTO delete(@PathVariable Integer id) {
return this.staffLeaveService.deleteById(id);
}
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.staffLeaveService.deleteBatch(ids);
}
@ApiOperation("编辑更新")
@PutMapping
public ResponseDTO edit(@RequestBody StaffLeave staffLeave) {
return this.staffLeaveService.edit(staffLeave);
}
@ApiOperation("查询")
@GetMapping("/{id}")
public ResponseDTO findById(@PathVariable Integer id) {
return this.staffLeaveService.findById(id);
}
@ApiOperation("分页条件查询")
@GetMapping
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name) {
return this.staffLeaveService.list(current, size, name);
}
@ApiOperation("数据导出接口")
@GetMapping("/export")
public ResponseDTO export(HttpServletResponse response) throws IOException {
return this.staffLeaveService.export(response);
}
@ApiOperation("数据导入接口")
@PostMapping("/import")
public ResponseDTO imp(MultipartFile file) throws IOException {
return this.staffLeaveService.imp(file);
}
@ApiOperation("分页")
@GetMapping("/staff")
public ResponseDTO findByStaffId(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, Integer id) {
return this.staffLeaveService.findByStaffId(current, size, id);
}
@ApiOperation("查询未被审核的请假")
@GetMapping("/staff/{id}")
public ResponseDTO findUnauditedByStaffId(@PathVariable Integer id) {
return this.staffLeaveService.findUnauditedByStaffId(id);
}
}
OvertimeController
package com.hrm.controller;
import com.hrm.entity.Overtime;
import com.hrm.dto.ResponseDTO;
import com.hrm.service.OvertimeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 加班表 前端控制器
* </p>
*
* @author qiujie
* @since 2022-03-28
*/
@RestController
@RequestMapping("/overtime")
public class OvertimeController {
@Resource
private OvertimeService overtimeService;
@ApiOperation("新增")
@PostMapping
public ResponseDTO add(@RequestBody Overtime overtime) {
return this.overtimeService.add(overtime);
}
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
public ResponseDTO delete(@PathVariable Integer id) {
return this.overtimeService.deleteById(id);
}
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.overtimeService.deleteBatch(ids);
}
@ApiOperation("编辑更新")
@PutMapping
public ResponseDTO edit(@RequestBody Overtime overtime) {
return this.overtimeService.edit(overtime);
}
@ApiOperation("查询")
@GetMapping("/{id}")
public ResponseDTO findById(@PathVariable Integer id) {
return this.overtimeService.findById(id);
}
@ApiOperation("获取")
@GetMapping("/{deptId}/{typeId}")
public ResponseDTO find(@PathVariable Integer deptId, @PathVariable Integer typeId) {
return this.overtimeService.find(deptId, typeId);
}
@ApiOperation("设置加班")
@PostMapping("/set")
public ResponseDTO setOvertime(@RequestBody Overtime overtime) {
return this.overtimeService.setOvertime(overtime);
}
}
如果也想学习本系统,下面领取。关注并回复:228boot