• 基于springboot人事管理系统java项目介绍


    人事管理系统是基于java编程语言,springboot框架,mysql数据库开发,本系统分为员工和管理员两个角色,员工的主要功能有登陆系统,个人信息更新,查看工资,查看公告,查看培训和奖惩信息,对工作事务管理;管理员登陆系统,可以对员工,公告,部门,员工,培训,奖惩,工资等信息进行管理。本设计界面简洁美观,适合作为计算机专业的大学生参考和学习。

     


    jdk版本:1.8 及以上
    ide工具:IDEA
    数据库: mysql5.7 (必须5.7)
    编程语言: Java
    tomcat:   8.0 及以上
    java框架:SSM
    Maven: 3.6.1
    详细技术:HTML+CSS+JS+JSP+JAVA+springboot+MYSQL+JQUERY+MAVEN
    .
    系统分为员工和管理员两个角色

     

     


    员工的主要功能有:

    1.员工登陆系统

    2.个人中心:修改密码和个信息

    3.公告查看:员工查看公司的公告信息

    4.员工培训:员工查看公司的员工培训信息

    5.奖惩信息:   员工查看公司的奖惩信息列表

    6.员工工资:员工查看工资信息

    7.员工事务管理:员工查询,添加,修改个人的公司事务信息

    8.退出登陆


    管理员的主要功能有:

     

    1.管理员输入账户登陆后台

    2.个人中心:管理员修改密码和个人信息

    3.公告信息:管理员对公告信息进行添加,修改,删除,查询

    4.部门管理:管理员对公司部门进行添加,修改,删除,查询

    5.职位管理:管理员对公司职位进行添加,修改,查询,删除

    6.员工管理:管理员对公司的员工信息进行添加,修改,删除,查询,发放工资

    7.员工培训:管理员对公司员工培训进行添加,修改,删除,查询

    8.奖惩管理:  管理员对公司员工的奖惩进行查询,添加,修改,删除

    9.工资管理:管理员对公司员工的工资进行查询,修改,删除

    10.员工事务管理:管理员对公司员工的事务审核,查看,修改,删除

    11.管理员管理,可以添加,修改,删除管理员信息

    12.退出登陆

     

    1. package com.controller;
    2. import java.util.Arrays;
    3. import java.util.Calendar;
    4. import java.util.Date;
    5. import java.util.Map;
    6. import javax.servlet.http.HttpServletRequest;
    7. import org.springframework.beans.factory.annotation.Autowired;
    8. import org.springframework.stereotype.Controller;
    9. import org.springframework.web.bind.annotation.GetMapping;
    10. import org.springframework.web.bind.annotation.PathVariable;
    11. import org.springframework.web.bind.annotation.PostMapping;
    12. import org.springframework.web.bind.annotation.RequestBody;
    13. import org.springframework.web.bind.annotation.RequestMapping;
    14. import org.springframework.web.bind.annotation.RequestParam;
    15. import org.springframework.web.bind.annotation.ResponseBody;
    16. import org.springframework.web.bind.annotation.RestController;
    17. import com.annotation.IgnoreAuth;
    18. import com.baomidou.mybatisplus.mapper.EntityWrapper;
    19. import com.entity.TokenEntity;
    20. import com.entity.UserEntity;
    21. import com.service.TokenService;
    22. import com.service.UserService;
    23. import com.utils.CommonUtil;
    24. import com.utils.MPUtil;
    25. import com.utils.PageUtils;
    26. import com.utils.R;
    27. import com.utils.ValidatorUtils;
    28. /**
    29. * 登录相关
    30. */
    31. @RequestMapping("users")
    32. @RestController
    33. public class UserController{
    34. @Autowired
    35. private UserService userService;
    36. @Autowired
    37. private TokenService tokenService;
    38. /**
    39. * 登录
    40. */
    41. @IgnoreAuth
    42. @PostMapping(value = "/login")
    43. public R login(String username, String password, String captcha, HttpServletRequest request) {
    44. UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username));
    45. if(user==null || !user.getPassword().equals(password)) {
    46. return R.error("账号或密码不正确");
    47. }
    48. String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
    49. return R.ok().put("token", token);
    50. }
    51. /**
    52. * 注册
    53. */
    54. @IgnoreAuth
    55. @PostMapping(value = "/register")
    56. public R register(@RequestBody UserEntity user){
    57. // ValidatorUtils.validateEntity(user);
    58. if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) {
    59. return R.error("用户已存在");
    60. }
    61. userService.insert(user);
    62. return R.ok();
    63. }
    64. /**
    65. * 退出
    66. */
    67. @GetMapping(value = "logout")
    68. public R logout(HttpServletRequest request) {
    69. request.getSession().invalidate();
    70. return R.ok("退出成功");
    71. }
    72. /**
    73. * 密码重置
    74. */
    75. @IgnoreAuth
    76. @RequestMapping(value = "/resetPass")
    77. public R resetPass(String username, HttpServletRequest request){
    78. UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username));
    79. if(user==null) {
    80. return R.error("账号不存在");
    81. }
    82. user.setPassword("123456");
    83. userService.update(user,null);
    84. return R.ok("密码已重置为:123456");
    85. }
    86. /**
    87. * 列表
    88. */
    89. @RequestMapping("/page")
    90. public R page(@RequestParam Map params,UserEntity user){
    91. EntityWrapper ew = new EntityWrapper();
    92. PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
    93. return R.ok().put("data", page);
    94. }
    95. /**
    96. * 列表
    97. */
    98. @RequestMapping("/list")
    99. public R list( UserEntity user){
    100. EntityWrapper ew = new EntityWrapper();
    101. ew.allEq(MPUtil.allEQMapPre( user, "user"));
    102. return R.ok().put("data", userService.selectListView(ew));
    103. }
    104. /**
    105. * 信息
    106. */
    107. @RequestMapping("/info/{id}")
    108. public R info(@PathVariable("id") String id){
    109. UserEntity user = userService.selectById(id);
    110. return R.ok().put("data", user);
    111. }
    112. /**
    113. * 获取用户的session用户信息
    114. */
    115. @RequestMapping("/session")
    116. public R getCurrUser(HttpServletRequest request){
    117. Long id = (Long)request.getSession().getAttribute("userId");
    118. UserEntity user = userService.selectById(id);
    119. return R.ok().put("data", user);
    120. }
    121. /**
    122. * 保存
    123. */
    124. @PostMapping("/save")
    125. public R save(@RequestBody UserEntity user){
    126. // ValidatorUtils.validateEntity(user);
    127. if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) {
    128. return R.error("用户已存在");
    129. }
    130. userService.insert(user);
    131. return R.ok();
    132. }
    133. /**
    134. * 修改
    135. */
    136. @RequestMapping("/update")
    137. public R update(@RequestBody UserEntity user){
    138. // ValidatorUtils.validateEntity(user);
    139. UserEntity u = userService.selectOne(new EntityWrapper().eq("username", user.getUsername()));
    140. if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
    141. return R.error("用户名已存在。");
    142. }
    143. userService.updateById(user);//全部更新
    144. return R.ok();
    145. }
    146. /**
    147. * 删除
    148. */
    149. @RequestMapping("/delete")
    150. public R delete(@RequestBody Long[] ids){
    151. userService.deleteBatchIds(Arrays.asList(ids));
    152. return R.ok();
    153. }
    154. }

  • 相关阅读:
    java毕业设计乡镇卫生院信息管理mybatis+源码+调试部署+系统+数据库+lw
    React源码之Fiber架构
    Serverless实战——2分钟,教你用Serverless每天给女朋友自动发土味情话
    Win10系统设置application identity自动提示拒绝访问怎么办
    【Java毕设项目】基于SpringBoot+Vue校园便利平台的设计与实现
    使用jmeter+ant+jenkins+git搭建自动化测试平台
    NAS文件的名称或路径过长导致文件同步被挂起
    R语言、02 案例2-1 Pelican商店、《商务与经济统计》案例题
    netns与veth
    JVM执行流程
  • 原文地址:https://blog.csdn.net/QQ58850198/article/details/126004827