Java 实战范例之员工管理系统的实现
读万卷书不如行万里路,只学书上的理论是远远不够的,只有在实战中才能获得能力的提升,本篇文章手把手带你用java+vue+Springboot+ssm+mysql+maven+redis实现一个前后端分离的员工管理系统,大家可以在过程中查缺补漏,提升水平
一、项目简述
本系统功能包括:分为前端翻后端部分,包括用户,区分晋通用户以及誉里员用户,包括首页展示,部门管理,人事管理,员工管理三个模块等等。
二、项目运行
环境配置: Jdkl . 8 + Tomcats . 5 + Mysql + HBuilderX ( Webstorm 也行)+ Eclispe ( IntelliJ IDEA,Eclispe , MyEclispe , Sts 都支持)。
项目技术: html + css +js + vue + v 一 charts + electron + springboot + mybatis + Mysql + Maven 等等。
员工操作代码:
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | /** * @author yy */ @RestController @RequestMapping ( "/employee" ) @CrossOrigin @Slf4j public class EmployeeController { @Autowired private EmployeeService employeeService; @Autowired private DepartmentService departmentService; @Autowired private JobService jobService; @Autowired private EduLevelMapper eduLevelMapper; @Autowired private EmployeeMapper employeeMapper; /** * 搜索接口 */ @GetMapping ( "/search" ) public Result search( @RequestParam (name = "name" , required = false ,defaultValue = "" ) String name, @RequestParam (name = "current" , required = false , defaultValue = "1" ) Integer current, @RequestParam (name = "size" , required = false , defaultValue = "10" ) Integer size) { return employeeService.list(current, size, name); } /** * 分页查询接口 * * @param current * @param size * @return */ @GetMapping ( "/list" ) public Result list( @RequestParam (name = "current" , required = false , defaultValue = "1" ) Integer current, @RequestParam (name = "size" , required = false , defaultValue = "10" ) Integer size) { return employeeService.list(current, size, null ); } /** * 根据id获取员工具体信息 * @param id * @return */ @GetMapping ( "/getUserById" ) public EmployeeDTO getUserAllInfoById( @RequestParam (name = "id" ) Integer id) { return employeeService.getUserById(id); } /** * 根据员工获取信息 * @param id * @return */ @GetMapping ( "/getEmployeeById" ) public Employee getUserById( @RequestParam (name = "id" ) Integer id) { return employeeMapper.selectById(id); } /** * 增加员工接口 * * @param employee * @return */ @PostMapping ( "/add" ) public Map<String, Object> addUser( @RequestBody Employee employee) { log.info(employee.toString()); return employeeService.add(employee); } /** * 更新用户 * @param employee * @return */ @PostMapping ( "/update" ) public Map<String, Object> updateUser( @RequestBody Employee employee) { log.info(employee.toString()); return employeeService.update(employee); } /** * 删除用户 * @param id * @return */ @GetMapping ( "/delete" ) public Result deleteEmployeeById( @RequestParam (name = "id" ) Integer id) { return employeeService.deleteEmployeeById(id); } /** * 辞退员工 * * @param id * @return */ @GetMapping ( "/dismiss" ) public Map<String, Object> dismissEmployeeById( @RequestParam (name = "id" ) Integer id) { return employeeService.dismissEmployeeById(id); } /** * 得到所以工作,部门,学历信息 * * @return */ @GetMapping ( "/otherInfo" ) public Result getAllOtherInfo() { Map<String, Object> info = new HashMap<>(); info.put( "departments" , departmentService.selectAll()); info.put( "jobs" , jobService.selectAll()); info.put( "eduLevels" , eduLevelMapper.selectList( null )); return Result.success(info); } @GetMapping ( "/map" ) public Result getMap() { return employeeService.getMap(); } } |
以上就是Java 实战范例之员工管理系统的实现的详细内容
原文链接:https://blog.csdn.net/m0_59687645/article/details/121202147