当前位置: 首页 > news >正文

Java项目:SSM律师事务所律师管理系统

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本项目包含管理员与用户两种角色;

管理员角色包含以下功能:

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

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

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

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版本;

6.是否Maven项目:是;

技术栈

1. 后端:Spring+SpringMVC+Mybatis

2. 前端:JSP+CSS+JavaScript+jQuery+bootstrap

使用说明

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

4. 运行项目,输入localhost:8080/ssm_lvshi_yuyue 登录
管理员账号/密码:admin/admin
用户账号/密码: user/123456 

运行截图
管理员角色

 

 

 

 

用户页面

 

 

 

 

代码相关

登录管理控制器

@Controller
public class LoginController {
    @Autowired
    private LoginServiceImpl loginService = null;
    /**
     * @Author: admin
     * @Description:
     * @Param: [request, response]
     * @Return: void
     **/

    //获取验证码
    @RequestMapping(value = "/changeCode.do")
    @ResponseBody
    public void getIdentifyingCode(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        // 验证码存储在session的identifyingCode,属性中
        CaptchaUtil.outputCaptcha(request, response);
    }

    // 获取员工登陆界面
    @RequestMapping("/")
    public String getLoginPage(){
        return "employee/login.html";
    }

    // 获取管理员登陆界面
    @RequestMapping("/admin.do")
    public String getAdminLoginPage(){
        return "admin/adminLogin.html";
    }

    //员工登录判断
    @RequestMapping(value = "/employeeLogin.do")
    @ResponseBody
    public Map<String,String> employeeLogin(Model model, HttpSession httpSession, String username,
                             String password, String identifyingcode)
    {
        String code = (String) httpSession.getAttribute("identifyingCode");
        HashMap<String, String> map = new HashMap<String, String>();
        if(identifyingcode.equalsIgnoreCase(code)){
            Employee employee = null;
            try {
                employee = loginService.findEmployeeByIdAndPassword(username, password);
            } catch (CustomException e) {
                map.put("msg",e.getMessage());
                map.put("status","500");
                return map;
            }
            // 保存到session
            httpSession.setAttribute("employeeId",employee.geteId());
            map.put("url","/ssm_esms/loginSuccess.do");
            map.put("msg","成功");
            map.put("status","200");
            return map;
        }else{
            map.put("msg","验证码错误");
            map.put("status","0");
            return map;
        }
    }



    @RequestMapping(value = "/loginSuccess.do")
    public String loginSucceses(Model model) throws Exception
    {
        return "employee/index.html";
    }


    //管理员登录判断
    @RequestMapping(value = "/adminLogin.do")
    @ResponseBody
    public Map<String,String> adminLogin(Model model, HttpSession httpSession, String username,
                                            String password, String identifyingcode)
    {
        String code = (String) httpSession.getAttribute("identifyingCode");
        HashMap<String, String> map = new HashMap<String, String>();
        if(identifyingcode.equalsIgnoreCase(code)){
            SystemManager manager = null;
            try {
                 manager = loginService.findSystemManagerByIdAndPassword(username, password);
            } catch (CustomException e) {
                map.put("msg",e.getMessage());
                map.put("status","500");
                return map;
            }
            // 保存到session
            httpSession.setAttribute("admin",manager);
            map.put("url","toPage.do?url=admin/index.html");
            map.put("msg","成功");
            map.put("status","200");
            return map;
        }else{
            map.put("msg","验证码错误");
            map.put("status","0");
            return map;
        }
    }
    @RequestMapping(value = "/getAdminAccount.do")
    @ResponseBody
    public String getAdminAccount(HttpSession httpSession){
        SystemManager systemManager = (SystemManager) httpSession.getAttribute("admin");
//        SystemManager manager = loginService.findSystemManagerById(id);
        return systemManager.getSmAccount();
    }

    @RequestMapping(value = "/getEmployeeAccount.do")
    @ResponseBody
    public Map<String,String> getEmployeeAccount(HttpSession httpSession){
        Integer id = (Integer) httpSession.getAttribute("employeeId");
        Employee employee = loginService.findEmployeeById(id);
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("account",employee.geteAccount());
        map.put("name",employee.geteName());
        return map;
    }
    @RequestMapping(value = "/logout.do")
    public String logout(HttpSession httpSession){
        httpSession.removeAttribute("employeeId");
        return "redirect:/";
    }

    @RequestMapping(value = "/logoutAdmin.do")
    public String logoutAdmin(HttpSession httpSession){
       httpSession.removeAttribute("admin");
       return "redirect:/admin.do";
    }
}

 下载管理控制器

@Controller
public class DownloadExcelController {
    @Autowired
    private IDownloadExcelService downloadExcelService;

    @RequestMapping(value = "downloadExcel.do")
    public void downloadExcel(HttpServletRequest request, HttpServletResponse response,String eAccount,Integer dId,String sTime)  throws Exception{
        downloadExcelService.getSalaryExcel(request,response,eAccount,dId,sTime) ;
    }
}

登录拦截器

public class LoginInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest httpServletRequest,
                             HttpServletResponse httpServletResponse, Object o) throws Exception {
//        String requestUri = httpServletRequest.getRequestURI();
//        String contextPath = httpServletRequest.getContextPath();
//        String url = requestUri.substring(contextPath.length());
//        System.out.println(url);
//        System.out.println(requestUri);
//        if ("/".equals(url)){
//            return true;
//        }
//        if ("/employeeLogin.do".equals(url)){
//            return true;
//        }else{
        String string = (String) httpServletRequest.getSession().getAttribute("employeeId");
        SystemManager systemManager = (SystemManager) httpServletRequest.getSession().getAttribute("admin");
        if (string != null) {
            return true;
        } else if (string == null){
            httpServletResponse.sendRedirect("/");
            return false;
        } else if (systemManager != null) {
            return true;
        } else {
            httpServletResponse.sendRedirect("/admin.do");
            return false;
        }
    }

    @Override
    public void postHandle(HttpServletRequest httpServletRequest,
                           HttpServletResponse httpServletResponse,
                           Object o, ModelAndView modelAndView) throws Exception {

    }

    @Override
    public void afterCompletion(HttpServletRequest httpServletRequest,
                                HttpServletResponse httpServletResponse,
                                Object o, Exception e) throws Exception {

    }
}

 

如果也想学习本系统,下面领取。关注并回复:107ssm 

相关文章:

  • 《MongoDB入门教程》第11篇 数组运算符
  • java Python+Django的大学生提问论坛系统-在线答疑系统
  • Vue学习第18天——Vue中的过度与动画效果的使用与案例
  • 设计模式 单一职责原则、开放封闭原则、依赖倒置原则、里氏代换原则
  • Codeforces Round #816 (Div. 2)补题(A-E)
  • 【牛客网-公司真题-前端入门篇】——百度2021校招Web前端研发工程师笔试卷(第二批)
  • 【Android应用与开发】DAY1-安装Android Studio报错整合及学习
  • Mybatis实战练习六【批量删除Mybatis参数传递】
  • 小白量化《穿云箭集群量化》(1)小白草根超级量化软件介绍
  • C语言指针操作(七)*指针数组和多重指针
  • 【python经验总结】我与bug的那些日子
  • <栈和队列及模拟实现>——《Data Structure in C Train》
  • 猿创征文|【Typescript】搭建TS的编译环境
  • 【项目管理】beautyeye
  • Connor学Android - HandlerThread和IntentService
  • Google 是如何开发 Web 框架的
  • [分享]iOS开发-关于在xcode中引用文件夹右边出现问号的解决办法
  • “Material Design”设计规范在 ComponentOne For WinForm 的全新尝试!
  • 【跃迁之路】【735天】程序员高效学习方法论探索系列(实验阶段492-2019.2.25)...
  • C++回声服务器_9-epoll边缘触发模式版本服务器
  • CSS3 变换
  • C学习-枚举(九)
  • Date型的使用
  • Git 使用集
  • Java知识点总结(JDBC-连接步骤及CRUD)
  • js操作时间(持续更新)
  • Netty+SpringBoot+FastDFS+Html5实现聊天App(六)
  • Python代码面试必读 - Data Structures and Algorithms in Python
  • Stream流与Lambda表达式(三) 静态工厂类Collectors
  • SwizzleMethod 黑魔法
  • WePY 在小程序性能调优上做出的探究
  • 阿里云ubuntu14.04 Nginx反向代理Nodejs
  • 不上全站https的网站你们就等着被恶心死吧
  • 等保2.0 | 几维安全发布等保检测、等保加固专版 加速企业等保合规
  • 精彩代码 vue.js
  • 名企6年Java程序员的工作总结,写给在迷茫中的你!
  • 前端工程化(Gulp、Webpack)-webpack
  • 网络应用优化——时延与带宽
  • 微信开源mars源码分析1—上层samples分析
  • 温故知新之javascript面向对象
  • Play Store发现SimBad恶意软件,1.5亿Android用户成受害者 ...
  • ​TypeScript都不会用,也敢说会前端?
  • # C++之functional库用法整理
  • #define、const、typedef的差别
  • $Django python中使用redis, django中使用(封装了),redis开启事务(管道)
  • (07)Hive——窗口函数详解
  • (delphi11最新学习资料) Object Pascal 学习笔记---第7章第3节(封装和窗体)
  • (二)Linux——Linux常用指令
  • (附源码)spring boot网络空间安全实验教学示范中心网站 毕业设计 111454
  • (附源码)springboot 房产中介系统 毕业设计 312341
  • (附源码)springboot车辆管理系统 毕业设计 031034
  • (提供数据集下载)基于大语言模型LangChain与ChatGLM3-6B本地知识库调优:数据集优化、参数调整、Prompt提示词优化实战
  • **Java有哪些悲观锁的实现_乐观锁、悲观锁、Redis分布式锁和Zookeeper分布式锁的实现以及流程原理...
  • .NET CF命令行调试器MDbg入门(二) 设备模拟器
  • .net core使用ef 6