当前位置:   article > 正文

Java项目:CRM人事管理系统(java+SSM+JSP+Layui+jQuery+mysql)_ssm+mysql员工部门管理系统(引入layui+jquery)的知识点

ssm+mysql员工部门管理系统(引入layui+jquery)的知识点

源码获取:博客首页 "资源" 里下载!

项目介绍

CRM人事管理系统,主要功能有:
用户管理:用户查询、添加用户、编辑、删除;
职位管理:职位查询、添加职位、删除;
部门管理:部门查询、添加部门、删除;
员工管理:员工查询、添加员工、编辑、删除;
公告管理:公告查询、添加公告、删除;
下载中心:文档查询、上传文档;
系统设置:退出系统;


环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 
6.数据库:MySql 5.7版本;


技术栈

1. 后端:Spring SpringMVC MyBatis
2. 前端:JSP+Layui+jQuery


使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 将项目中db.properties配置文件中的数据库配置改为自己的配置
3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
4. 运行项目,输入localhost:8080/xxx 登录

 

 

 

 

 

客户管理控制层:

  1. @Controller
  2. @RequestMapping("/customer")
  3. public class CustomerController extends AuthorizedController {
  4. @Autowired
  5. private CustomerService customerService;
  6. @RequestMapping(value = "", method = RequestMethod.GET)
  7. public String customer() {
  8. return "crm/customer";
  9. }
  10. @RequestMapping(value = "/find", method = RequestMethod.POST)
  11. @ResponseBody
  12. public PageInfo<Customer> find(@RequestBody QueryCustomerVo vo) {
  13. return customerService.find(vo);
  14. }
  15. @RequestMapping(value = "/findAllCustomerCategory", method = RequestMethod.POST)
  16. @ResponseBody
  17. public List<CustomerCategory> findAllCustomerCategory() {
  18. return customerService.findAllCustomerCategory();
  19. }
  20. @RequestMapping(value = "/findAllIndustry", method = RequestMethod.POST)
  21. @ResponseBody
  22. public List<Industry> findAllIndustry() {
  23. return customerService.findAllIndustry();
  24. }
  25. @RequestMapping(value = "/findAllSource", method = RequestMethod.POST)
  26. @ResponseBody
  27. public List<Source> findAllSource() {
  28. return customerService.findAllSource();
  29. }
  30. @RequestMapping(value = "/add", method = RequestMethod.POST)
  31. @ResponseBody
  32. public Result add(@RequestBody Customer customer) {
  33. customer.setCreateBy(getUser().getUserId());
  34. return customerService.insert(customer);
  35. }
  36. @RequestMapping(value = "/checkCustomerName", method = RequestMethod.POST)
  37. @ResponseBody
  38. public Result checkCustomerName(@RequestBody Customer customer) {
  39. return customerService.checkCustomerName(customer);
  40. }
  41. @RequestMapping(value = "/findById", method = RequestMethod.POST)
  42. @ResponseBody
  43. public Customer findById(@RequestBody Customer customer) {
  44. return customerService.findById(customer.getCustomerId());
  45. }
  46. @RequestMapping(value = "/update", method = RequestMethod.POST)
  47. @ResponseBody
  48. public Result update(@RequestBody Customer customer) {
  49. return customerService.update(customer);
  50. }
  51. @RequestMapping(value = "/dashboard/{customerId}", method = RequestMethod.GET)
  52. public ModelAndView dashboard(@PathVariable int customerId) {
  53. ModelAndView vm = new ModelAndView("crm/customerDashboard");
  54. vm.addObject("customerId", customerId);
  55. return vm;
  56. }
  57. @RequestMapping(value = "/updateStar", method = RequestMethod.POST)
  58. @ResponseBody
  59. public Result updateStar(@RequestBody Customer customer) {
  60. return customerService.updateStar(customer);
  61. }
  62. @RequestMapping(value = "/updateLocation", method = RequestMethod.POST)
  63. @ResponseBody
  64. public Result updateLocation(@RequestBody Customer customer) {
  65. return customerService.updateLocation(customer);
  66. }
  67. }

用户管理控制层:

  1. @Controller
  2. @RequestMapping("/user")
  3. public class UserController extends AuthorizedController {
  4. @Autowired
  5. private UserService userService;
  6. @Autowired
  7. private HttpSession session;
  8. @RequestMapping(value = "", method = RequestMethod.GET)
  9. public String index() {
  10. return "sys/user";
  11. }
  12. @RequestMapping(value = "/find", method = RequestMethod.POST)
  13. @ResponseBody
  14. public PageInfo<User> find(@RequestBody QueryUserVo vo) {
  15. return userService.find(vo);
  16. }
  17. @RequestMapping(value = "/add", method = RequestMethod.POST)
  18. @ResponseBody
  19. public Result add(@RequestBody User user) {
  20. return userService.insert(user);
  21. }
  22. @RequestMapping(value = "/remove", method = RequestMethod.POST)
  23. @ResponseBody
  24. public Result delete(@RequestBody List<Integer> ids) {
  25. return userService.deleteByIds(ids);
  26. }
  27. @RequestMapping(value = "/findById", method = RequestMethod.POST)
  28. @ResponseBody
  29. public User findById(@RequestBody User user) {
  30. return userService.findById(user.getUserId());
  31. }
  32. @RequestMapping(value = "/update", method = RequestMethod.POST)
  33. @ResponseBody
  34. public Result update(@RequestBody User user) {
  35. Result result = userService.update(user);
  36. if (result.isSuccess() && user.getUserId() == getUser().getUserId()) {
  37. session.setAttribute("User", userService.findById(getUser().getUserId()));
  38. }
  39. return result;
  40. }
  41. @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
  42. @ResponseBody
  43. public Result updateStatus(@RequestBody User user) {
  44. return userService.updateStatus(user);
  45. }
  46. @RequestMapping(value = "/checkUserName", method = RequestMethod.POST)
  47. @ResponseBody
  48. public Result checkUserName(@RequestBody User user) {
  49. return userService.checkUserName(user);
  50. }
  51. @RequestMapping(value = "/resetPassword", method = RequestMethod.POST)
  52. @ResponseBody
  53. public Result resetPassword(@RequestBody User user) {
  54. return userService.resetPassword(user);
  55. }
  56. @RequestMapping(value = "/profile", method = RequestMethod.GET)
  57. public String profile() {
  58. return "sys/profile";
  59. }
  60. @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
  61. @ResponseBody
  62. public Result updatePassword(@RequestBody UpdatePasswordVo vo) {
  63. return userService.updatePassword(vo);
  64. }
  65. }

角色管理控制层:

  1. @Controller
  2. @RequestMapping("/role")
  3. public class RoleController extends AuthorizedController {
  4. @Autowired
  5. private RoleService roleService;
  6. @RequestMapping(value = "", method = RequestMethod.GET)
  7. public String index() {
  8. return "sys/role";
  9. }
  10. @RequestMapping(value = "/findAll", method = RequestMethod.POST)
  11. @ResponseBody
  12. public List<Role> findAll() {
  13. return roleService.findAll();
  14. }
  15. @RequestMapping(value = "/checkRoleName", method = RequestMethod.POST)
  16. @ResponseBody
  17. public Result existRoleName(@RequestBody Role role) {
  18. return roleService.checkRoleName(role);
  19. }
  20. @RequestMapping(value = "/add", method = RequestMethod.POST)
  21. @ResponseBody
  22. public Result add(@RequestBody Role role) {
  23. return roleService.insert(role);
  24. }
  25. @RequestMapping(value = "/remove", method = RequestMethod.POST)
  26. @ResponseBody
  27. public Result delete(@RequestBody List<Integer> ids) {
  28. return roleService.deleteByIds(ids);
  29. }
  30. @RequestMapping(value = "/findById", method = RequestMethod.POST)
  31. @ResponseBody
  32. public Role findById(@RequestBody Role role) {
  33. return roleService.findById(role.getRoleId());
  34. }
  35. @RequestMapping(value = "/update", method = RequestMethod.POST)
  36. @ResponseBody
  37. public Result update(@RequestBody Role role) {
  38. return roleService.update(role);
  39. }
  40. @RequestMapping(value = "/user/{roleId}", method = RequestMethod.GET)
  41. public ModelAndView roleUser(@PathVariable int roleId) {
  42. ModelAndView vm = new ModelAndView("sys/roleUser");
  43. vm.addObject("roleId", roleId);
  44. return vm;
  45. }
  46. @RequestMapping(value = "/user/findUserInRole", method = RequestMethod.POST)
  47. @ResponseBody
  48. public PageInfo<User> findUserInRole(@RequestBody QueryRoleUserVo vo) {
  49. return roleService.findUserInRole(vo);
  50. }
  51. @RequestMapping(value = "/user/remove", method = RequestMethod.POST)
  52. @ResponseBody
  53. public Result deleteRoleUser(@RequestBody RoleUser roleUser) {
  54. return roleService.deleteRoleUser(roleUser);
  55. }
  56. @RequestMapping(value = "/user/findUserNotInRole", method = RequestMethod.POST)
  57. @ResponseBody
  58. public PageInfo<User> findUserNotInRole(@RequestBody QueryRoleUserVo vo) {
  59. return roleService.findUserNotInRole(vo);
  60. }
  61. @RequestMapping(value = "/user/add", method = RequestMethod.POST)
  62. @ResponseBody
  63. public Result addRoleUser(@RequestBody RoleUser roleUser) {
  64. return roleService.insertRoleUser(roleUser);
  65. }
  66. @RequestMapping(value = "/menu/{roleId}", method = RequestMethod.GET)
  67. public ModelAndView roleMenu(@PathVariable Integer roleId) {
  68. ModelAndView mv = new ModelAndView("sys/roleMenu");
  69. mv.addObject("roleId", roleId);
  70. return mv;
  71. }
  72. @RequestMapping(value = "/menu/saveMenu", method = RequestMethod.POST)
  73. @ResponseBody
  74. public Result saveMenu(@RequestBody Map map) {
  75. return roleService.saveRoleMenu((Integer) map.get("roleId"), (List<Integer>) map.get("menuIdList"));
  76. }
  77. @RequestMapping(value = "/fun/{roleId}", method = RequestMethod.GET)
  78. public ModelAndView roleFun(@PathVariable int roleId) {
  79. ModelAndView vm = new ModelAndView("sys/roleFun");
  80. vm.addObject("roleId", roleId);
  81. return vm;
  82. }
  83. }

源码获取:博客首页 "资源" 里下载! 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/476511
推荐阅读
相关标签
  

闽ICP备14008679号