一,项目简介

系统是前后端分离的项目,直接启动Springboot应用程序类后,再启动前端工程访问即可。主要实现了企业的人事管理功能,主要包含员工管理、薪资管理、职位管理、权限管理、网盘文件分享管理等模块。

系统亮点:使用REDIS进行数据缓存,优化查询性能;使用分布式文件系统进行文件存储服务;基于Springboot vue实现前后端分离开发

二,环境介绍

语言环境:Java: jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat: tomcat8.5.31

开发工具:IDEA或eclipse

开发技术:Element UI 、Vue、Axios、SpringBoot、MyBatis、MySQL、Redis、FastDFS(或OSS)、Tomcat8.5.31

三,系统展示

下面展示一下系统的基本功能:

用户登陆:

系统主界面:

员工管理:

高级搜索

员工奖惩管理

添加奖惩

工资套账(工资标准)管理

员工工资管理

系统管理—部门管理

系统管理--职位管理

系统管理—职称管理

文件管理:将文件存储在分布式文件服务Fastdfs或阿里云OSS上,可以在系统中自行配置

以上是本系统的基本功能功能展示,本系统所使用技术比较先进,功能比较完整,界面美观大方,适合毕业设计使用。

四,核心代码展示

package com.me.controller;
import com.me.pojo.Department;
import com.me.pojo.RespBean;
import com.me.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
public class DepartmentController {
    @Autowired
    DepartmentService departmentService;
    @GetMapping("/dep/deps")
    public RespBean getAllDepartments() {
        List<Department> list = departmentService.getAllDepartments();
//        for (Department department : list) {
//            System.out.println(department);
//        }
        return RespBean.ok("AllDepartments", list);
    }
    @PostMapping("/dep/add")
    public RespBean addDep(@RequestBody Department dep) {
        System.out.println(dep);
        departmentService.addDep(dep);
        if (dep.getResult() == 1) {
            return RespBean.ok("添加成功", dep);
        }
        return RespBean.error("添加失败");
    }
    @DeleteMapping("/dep/{id}")
    public RespBean deleteDepById(@PathVariable Integer id) {
        Department dep = new Department();
        dep.setId(id);
        departmentService.deleteDepById(dep);
        if (dep.getResult() == -2) {
            return RespBean.error("该部门下有子部门,删除失败");
        } else if (dep.getResult() == -1) {
            return RespBean.error("该部门下有员工,删除失败");
        } else if (dep.getResult() == 1) {
            return RespBean.ok("删除成功");
        }
        return RespBean.error("删除失败");
    }
}
package com.me.controller;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.me.pojo.*;
import com.me.service.DepartmentService;
import com.me.service.EmployeeService;
import com.me.service.JobLevelService;
import com.me.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RestController
public class EmpController {
    @Autowired
    EmployeeService employeeService;
    @Autowired
    PositionService positionService;
    @GetMapping("/emp/query")
    public RespPageBean getEmployeeByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Employee employee,  Date[] beginDateScope) {
//        System.out.println(employee);
        return employeeService.getEmployeeByPage(page, size, employee, beginDateScope);
    }
    @PostMapping("/emp/add")
    public RespBean addEmp(@RequestBody Employee employee) {
//        System.out.println(employee);
        if (employeeService.addEmp(employee) == 1) {
            return RespBean.ok("添加成功!");
        }
        return RespBean.error("添加失败!");
    }
    @PutMapping("/emp/update")
    public RespBean updateEmp(@RequestBody Employee employee) {
//        System.out.println(employee);
        if (employeeService.updateEmp(employee) == 1) {
            return RespBean.ok("更新成功!");
        }
        return RespBean.error("更新失败!");
    }
    @DeleteMapping("/emp/delete/{id}")
    public RespBean deleteEmpByEid(@PathVariable Integer id) {
        if (employeeService.deleteEmpByEid(id) == 1) {
            return RespBean.ok("删除成功!");
        }
        return RespBean.error("删除失败!");
    }
    @GetMapping("/emp/getAllPositions")
    public RespBean getAllPositions() {
        return RespBean.ok("positions-",positionService.getAllPositions()) ;
    }
    @GetMapping("/emp/nations")
    public RespBean getAllNations() {
        return RespBean.ok("nations-",employeeService.getAllNations());
    }
    @GetMapping("/emp/politicsstatus")
    public RespBean getAllPoliticsstatus() {
        return RespBean.ok("politicsss-",employeeService.getAllPoliticsstatus()) ;
    }
    @Autowired
    private JobLevelService jobLevelService;
    @GetMapping("/emp/joblevels")
    public RespBean getAllJobLevels() {
        return RespBean.ok("joblevels-",jobLevelService.getAllJobLevels());
    }
    @Autowired
    private DepartmentService departmentService;
    @GetMapping("/emp/deps")
    public RespBean getAllDepartments() {
        List<Department> list = departmentService.getAllDepartments();
//        for (Department department : list) {
//            System.out.println(department);
//        }
        return RespBean.ok("AllDepartments", list);
    }
}
package com.me.controller;
import com.me.pojo.Employee;
import com.me.pojo.Employeeec;
import com.me.pojo.RespBean;
import com.me.pojo.RespPageBean;
import com.me.service.EmployeeecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
public class EmployeeecController {
    @Autowired
    EmployeeecService employeeecService;
    @GetMapping("/ec/{keyword}")
    public RespBean selectByNameOrWorkId(@PathVariable String keyword){
        System.out.println(keyword);
        return RespBean.ok("获取到-",employeeecService.selectByNameOrWorkId(keyword));
    }
    @DeleteMapping("/ec/{id}")
    public RespBean deleteById(@PathVariable int id){
        System.out.println(id);
        if(employeeecService.deleteById(id)==1){
            return RespBean.ok("删除成功");
        }
        return RespBean.error("失败");
    }
    @PostMapping("/ec/add")
    public RespBean add(@RequestBody Employeeec employeeec){
        System.out.println(employeeec);
        if(employeeecService.insertEc(employeeec)==1){
            return RespBean.ok("添加成功");
        }
        return RespBean.error("失败");
    }
    @PutMapping("/ec/update")
    public RespBean put(@RequestBody Employeeec employeeec){
        System.out.println(employeeec);
        if(employeeecService.updateEc(employeeec)==1){
            return RespBean.ok("添加成功");
        }
        return RespBean.error("失败");
    }
}
package com.me.controller;
import com.me.pojo.RespBean;
import com.me.service.FileService;
import com.me.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
@RestController
public class FileController {
    @Autowired
    FileService fileService;
    @Autowired
    private StringRedisTemplate stringRedisTemplate;
    @PostMapping("/file/upload")
    public RespBean updateFile(MultipartFile file,int id) {
        System.out.println(id);
        System.out.println(MD5Util.getMultiFileMd5(file));
        if(fileService.uploadFile(file,id)){
            return RespBean.ok("上传成功");
        }
        return RespBean.error("图片过大或者格式不对");
    }
    @DeleteMapping("/file/{id}")
    public RespBean deleteById(@PathVariable int id){
//        System.out.println(id);
        if(fileService.deleteById(id)){
            return RespBean.ok("删除成功");
        }
        return RespBean.error("删除失败");
    }
    @GetMapping("/file/getAll/{id}")
    public RespBean getAll(@PathVariable String id){
        return RespBean.ok("files-",fileService.getAllHrFiles(id));
    }
    @GetMapping("/file/getLoginHrId")
    public RespBean getHrId(HttpServletRequest request){
        String token = request.getHeader("token");
        String s = stringRedisTemplate.opsForValue().get("id" token);
        return RespBean.ok("获取到用户id",s);
    }
}
package com.me.controller;
import com.me.pojo.Hr;
import com.me.pojo.RespBean;
import com.me.service.HrService;
import org.csource.fastdfs.StorageClient1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
@RestController
public class HrController {
    @Autowired
    private StringRedisTemplate stringRedisTemplate;
    @Autowired
    private HrService hrService;
    @GetMapping("/hr/getLoginUser")
    public RespBean getLoginUser(HttpServletRequest request){
        String token = request.getHeader("token");
        String s = stringRedisTemplate.opsForValue().get(token);
//        System.out.println("getLoginUser" s);
        Hr hr = hrService.loadUserByUsername(s);
        return RespBean.ok("获取到用户",hr);
    }
    @PutMapping("/hr/pass")
    public RespBean updateHrPasswd(@RequestBody Map<String, Object> info,HttpServletRequest request) {
        String oldpass = (String) info.get("oldpass");
        String pass = (String) info.get("pass");
        Integer hrid = (Integer) info.get("hrid");
        System.out.println(hrid pass);
        if (hrService.updateHrPasswd(oldpass, pass, hrid)) {
            //修改密码后需要重新登录
            String token = request.getHeader("token");
            Boolean b = stringRedisTemplate.delete(token);
            return RespBean.ok("更新成功!请重新登录!");
        }
        return RespBean.error("更新失败!");
    }
    @PutMapping("/hr/info")
    public RespBean updateHr(@RequestBody Hr hr) {
        if (hrService.updateHr(hr) == 1) {
            return RespBean.ok("更新成功!");
        }
        return RespBean.error("更新失败!");
    }
    @PostMapping("/hr/userface")
    public RespBean updateHrUserface(MultipartFile file, Integer id) {
        System.out.println("face    " id);
       if(hrService.updateHrUserface(file,id)){
           return RespBean.ok("更新成功!");
       }
       return RespBean.error("图片过大或者格式不对");
    }
}

五,项目总结

项目采用springboot vue实现前后端分离的项目开发,功能简洁大方,另外使用了redis缓存数据库和oss分布式文件存储服务,是项目的一大亮点。

到此这篇关于Springboot与vue实例讲解实现前后端分离的人事管理系统的文章就介绍到这了,更多相关Springboot人事管理系统内容请搜索Devmax以前的文章或继续浏览下面的相关文章希望大家以后多多支持Devmax!

Springboot与vue实例讲解实现前后端分离的人事管理系统的更多相关文章

  1. SpringBoot本地磁盘映射问题

    这篇文章主要介绍了SpringBoot本地磁盘映射问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

  2. java SpringBoot 分布式事务的解决方案(JTA+Atomic+多数据源)

    这篇文章主要介绍了java SpringBoot 分布式事务的解决方案(JTA+Atomic+多数据源),文章围绕主题展开详细的内容介绍,具有一定的参考价值,感兴趣的小伙伴可以参考一下

  3. SpringBoot整合Javamail实现邮件发送的详细过程

    日常开发过程中,我们经常需要使用到邮件发送任务,比方说验证码的发送、日常信息的通知等,下面这篇文章主要给大家介绍了关于SpringBoot整合Javamail实现邮件发送的详细过程,需要的朋友可以参考下

  4. SpringBoot详细讲解视图整合引擎thymeleaf

    这篇文章主要分享了Spring Boot整合使用Thymeleaf,Thymeleaf是新一代的Java模板引擎,类似于Velocity、FreeMarker等传统引擎,关于其更多相关内容,需要的小伙伴可以参考一下

  5. Springboot集成mybatis实现多数据源配置详解流程

    在日常开发中,若遇到多个数据源的需求,怎么办呢?通过springboot集成mybatis实现多数据源配置,简单尝试一下,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

  6. SpringBoot使用Minio进行文件存储的实现

    本文主要介绍了SpringBoot使用Minio进行文件存储的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

  7. 解析SpringBoot中使用LoadTimeWeaving技术实现AOP功能

    这篇文章主要介绍了SpringBoot中使用LoadTimeWeaving技术实现AOP功能,AOP面向切面编程,通过为目标类织入切面的方式,实现对目标类功能的增强,本文给大家介绍的非常详细,需要的朋友可以参考下

  8. 详解springboot测试类注解

    这篇文章主要介绍了springboot测试类注解,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

  9. SpringBoot实现过滤器和拦截器的方法

    大家应该都晓得实现过滤器需要实现 javax.servlet.Filter 接口,而拦截器会在处理指定请求之前和之后进行相关操作,配置拦截器需要两步,本文通过实例代码给大家介绍SpringBoot 过滤器和拦截器的相关知识,感兴趣的朋友一起看看吧

  10. SpringBoot中使用@scheduled定时执行任务的坑

    本文主要介绍了SpringBoot中使用@scheduled定时执行任务的坑,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

随机推荐

  1. 基于EJB技术的商务预订系统的开发

    用EJB结构开发的应用程序是可伸缩的、事务型的、多用户安全的。总的来说,EJB是一个组件事务监控的标准服务器端的组件模型。基于EJB技术的系统结构模型EJB结构是一个服务端组件结构,是一个层次性结构,其结构模型如图1所示。图2:商务预订系统的构架EntityBean是为了现实世界的对象建造的模型,这些对象通常是数据库的一些持久记录。

  2. Java利用POI实现导入导出Excel表格

    这篇文章主要为大家详细介绍了Java利用POI实现导入导出Excel表格,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

  3. Mybatis分页插件PageHelper手写实现示例

    这篇文章主要为大家介绍了Mybatis分页插件PageHelper手写实现示例,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

  4. (jsp/html)网页上嵌入播放器(常用播放器代码整理)

    网页上嵌入播放器,只要在HTML上添加以上代码就OK了,下面整理了一些常用的播放器代码,总有一款适合你,感兴趣的朋友可以参考下哈,希望对你有所帮助

  5. Java 阻塞队列BlockingQueue详解

    本文详细介绍了BlockingQueue家庭中的所有成员,包括他们各自的功能以及常见使用场景,通过实例代码介绍了Java 阻塞队列BlockingQueue的相关知识,需要的朋友可以参考下

  6. Java异常Exception详细讲解

    异常就是不正常,比如当我们身体出现了异常我们会根据身体情况选择喝开水、吃药、看病、等 异常处理方法。 java异常处理机制是我们java语言使用异常处理机制为程序提供了错误处理的能力,程序出现的错误,程序可以安全的退出,以保证程序正常的运行等

  7. Java Bean 作用域及它的几种类型介绍

    这篇文章主要介绍了Java Bean作用域及它的几种类型介绍,Spring框架作为一个管理Bean的IoC容器,那么Bean自然是Spring中的重要资源了,那Bean的作用域又是什么,接下来我们一起进入文章详细学习吧

  8. 面试突击之跨域问题的解决方案详解

    跨域问题本质是浏览器的一种保护机制,它的初衷是为了保证用户的安全,防止恶意网站窃取数据。那怎么解决这个问题呢?接下来我们一起来看

  9. Mybatis-Plus接口BaseMapper与Services使用详解

    这篇文章主要为大家介绍了Mybatis-Plus接口BaseMapper与Services使用详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

  10. mybatis-plus雪花算法增强idworker的实现

    今天聊聊在mybatis-plus中引入分布式ID生成框架idworker,进一步增强实现生成分布式唯一ID,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

返回
顶部