Java 实战范例之员工管理系统的实现
作者:qq_1334611189 发布时间:2023-03-31 08:09:33
标签:Java,员工,管理系统
一、项目简述
本系统功能包括:分为前端翻后端部分,包括用户,区分晋通用户以及誉里员用户,包括首页展示,部门管理,人事管理,员工管理三个模块等等。
二、项目运行
环境配置: Jdkl . 8 + Tomcats . 5 + Mysql + HBuilderX ( Webstorm 也行)+ Eclispe ( IntelliJ IDEA,Eclispe , MyEclispe , Sts 都支持)。
项目技术: html + css +js + vue + v 一 charts + electron + springboot + mybatis + Mysql + Maven 等等。
员工操作代码:
/**
* @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();
}
}
来源:https://blog.csdn.net/m0_59687645/article/details/121202147


猜你喜欢
- 这是一个运用网格布局来做的简易计算器,可能没有那么美观,大家可以继续完善首先先看看成果吧首先先建一个新的Project Calculator
- Java核心代码:public String getSmsInPhone() { final String SMS_URI_ALL = &q
- 多数据源配置首先是配置文件这里采用yml配置文件,其他类型配置文件同理我配置了两个数据源,一个名字叫ds1数据源,一个名字叫ds2数据源,如
- 在springboot中,默认继承好了一套完好的redis包,可以直接使用,但是如果使用中出了错不容易找到错误的原因,因此这里使用自己配置的
- Linq中的排序操作符包括OrderBy、OrderByDescending、ThenBy、ThenByDescending和Reverse
- 今天学习了Map集合的几种方法,尤其是遍历Map集合感觉尤为重要,所以发出来供大家学习和自己复习以用。众所周知Map集合里存储元素是以键值对
- 如下所示:package com.lstc.test;public class TestDemo3 {String str = new St
- 微信对话列表滑动删除效果很不错的,借鉴了github上SwipeListView(项目地址:https://github.com/likeb
- 1.文件页面编码导致的乱码。每一个文件(java,js,jsp,html等)都有其本身的编码格式,文件中的代码在一种编码中显示正常,在另外一
- 本文实例讲述了C#信号量用法。分享给大家供大家参考,具体如下:using System;using System.Collections.G
- 前言Android6.0代号棉花糖。尽管是在15年I/O大会上Google被正式发布的了。但是看看大多数人的项目中大家的 targetSdk
- 本文实例讲述了C#中实现一次执行多条带GO的sql语句。分享给大家供大家参考。具体如下:using System;using System.
- C#实现IDispose接口.net的GC机制有两个问题:首先GC并不能释放所有资源,它更不能释放非托管资源。其次,GC也不是实时的,所有G
- 前言目前正在做的项目,为了增加用户的体验度,准备增加一些动画效果,其中底部栏中间按钮的点击事件参考了闲鱼的动效,便在此基础上仿写了该动效,并
- 开发过程中有这样一个场景,2个 bean 初始化逻辑中有依赖关系,需要控制二者的初始化顺序。实现方式可以有多种,本文结合目前对 Spring
- Spring Batch job任务只跑一次在一次实际使用spring batch的过程中,在定时任务中,第一次执行Job没有出现问题,然后
- 本文实例为大家分享了Unity实现新手引导镂空效果的具体代码,供大家参考,具体内容如下一、实现思路创建有8个顶点的Mesh,内外边界都是四边
- 前言跳过废话,直接看正文当年入坑Java是因为它的跨平台优势。那时我认为,”编写一次,处处运行。”这听上去多么牛逼,应该是所有语言发展的终极
- 项目结构把源码 clone 下来 , 可以看到 retrofit 整体结构如下图 http包目录下就是一些http协议常用接口 , 比如 请
- 目录前言connectTimeout:callTimeout:pingIntervalwriteTimeoutreadTimeout总结前言