Java 实战范例之员工管理系统的实现
短信预约 -IT技能 免费直播动态提醒
一、项目简述
本系统功能包括:分为前端翻后端部分,包括用户,区分晋通用户以及誉里员用户,包括首页展示,部门管理,人事管理,员工管理三个模块等等。
二、项目运行
环境配置: Jdkl . 8 + Tomcats . 5 + Mysql + HBuilderX ( Webstorm 也行)+ Eclispe ( IntelliJ IDEA,Eclispe , MyEclispe , Sts 都支持)。
项目技术: html + css +js + vue + v 一 charts + electron + springboot + mybatis + Mysql + Maven 等等。
员工操作代码:
@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);
}
@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);
}
@GetMapping("/getUserById")
public EmployeeDTO getUserAllInfoById(@RequestParam(name = "id") Integer id) {
return employeeService.getUserById(id);
}
@GetMapping("/getEmployeeById")
public Employee getUserById(@RequestParam(name = "id") Integer id) {
return employeeMapper.selectById(id);
}
@PostMapping("/add")
public Map<String, Object> addUser(@RequestBody Employee employee) {
log.info(employee.toString());
return employeeService.add(employee);
}
@PostMapping("/update")
public Map<String, Object> updateUser(@RequestBody Employee employee) {
log.info(employee.toString());
return employeeService.update(employee);
}
@GetMapping("/delete")
public Result deleteEmployeeById(@RequestParam(name = "id") Integer id) {
return employeeService.deleteEmployeeById(id);
}
@GetMapping("/dismiss")
public Map<String, Object> dismissEmployeeById(@RequestParam(name = "id") Integer id) {
return employeeService.dismissEmployeeById(id);
}
@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 实战范例之员工管理系统的实现的详细内容,更多关于Java 员工管理系统的资料请关注编程网其它相关文章!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341