• Java项目:律师事务所律师管理系统(java+SSM+HTML+JS+jsp+mysql)


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

    项目介绍

    管理员角色包含以下功能:
    管理员登录,律师信息管理,预约审核管理,预约记录查看,拒绝预约查询,注册一个用户,个人信息修改等功能。

    用户角色包含以下功能:
    用户登录,律师信息查看,预约记录查询,预约某一个律师,取消预约管理,个人信息修改等功能。


    环境需要

    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.数据库:MySql 5.7版本;


    技术栈

    1. 后端:Spring+SpringMVC+Mybatis
    2. 前端:HTML+CSS+JavaScript+jsp


    使用说明

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

     

     

     

     

     

    用户管理控制层:

    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. }

    系统管理控制层:

    1. @Controller
    2. public class HomeController {
    3. @Autowired
    4. private HttpSession session;
    5. @Autowired
    6. private UserService userService;
    7. @Autowired
    8. private PowerTeamConfig powerTeamConfig;
    9. @RequestMapping(value = "/", method = RequestMethod.GET)
    10. public String signIn() {
    11. return "sys/home";
    12. }
    13. @RequestMapping(value = "/signIn", method = RequestMethod.POST)
    14. @ResponseBody
    15. public ResultData<User> signIn(@RequestBody User user) {
    16. ResultData<User> result = userService.signIn(user);
    17. if (result.isSuccess()) {
    18. user = result.getData();
    19. session.setAttribute("User", user);
    20. }
    21. return result;
    22. }
    23. @RequestMapping(value = "/signOut", method = RequestMethod.GET)
    24. @RequireSession
    25. public String signOut() {
    26. session.invalidate();
    27. return "redirect:" + powerTeamConfig.getWebRoot();
    28. }
    29. }

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

  • 相关阅读:
    统计目录下的文件数量
    【MySQL面试复习】谈一谈你对SQL的优化经验
    计算机毕业设计 基于SpringBoot的企业内部网络管理系统的设计与实现 Java实战项目 附源码+文档+视频讲解
    HIPPO-4J 1.3.0 正式发布:支持 Dubbo、RibbitMQ、RocketMQ 框架线程池
    spring cloud 快速上手系列 -> 03-消息队列 Stream -> 033-使用spring cloud bus实现配置中心热刷新-Client
    负载均衡的艺术:释放 Ribbon 的潜力
    vue2实现字节流byte[]数组的图片预览
    【数据库】数据库中的检查点Checkpoint,数据落盘的重要时刻
    BigDecimal四大误区
    双指针算法_移动零_
  • 原文地址:https://blog.csdn.net/m0_66863468/article/details/124940758