基于ssm的社区疫情返乡管控系统设计实现

Posted 程序猿麦小七

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了基于ssm的社区疫情返乡管控系统设计实现相关的知识,希望对你有一定的参考价值。

项目描述

临近学期结束,还是毕业设计,你还在做java程序网络编程,期末作业,老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等。这里根据疫情当下,你想解决的问题,今天给大家介绍一篇基于ssm的社区疫情返乡管控系统设计实现。

功能需求

截止到目前,无论是国内还是国外新冠病毒仍在肆虐,社区疫情防控趋势化越来越明显,以社区为单位进行疫情防控,毫无疑问能够对疫情防控取到很好的作用。社区疫情防控系统方便对社区疫情的信息管理,对居民健康信息、行程、以及疫情防控所需的活动进行系统化、信息化管理。例如居民每日健康填报,核酸检测记录、发放防控物资等。社区疫情防控管理系统的设计需要考虑两种角色,用户和系统管理员。

具备以下功能:

前端用户模块:用户登录注册、忘记密码、首页、关于我们、疫情新闻、信息记录、健康打卡等功能。
后端管理员模块:管理员登录、人员管理、工作人员管理、返乡信息录入、健康打卡管理、网站管理配置、用户留言板留言管理、修改密码、退出系统。

部分效果图








部分代码
	
 @RequestMapping( "/user/register.html" )
    @ResponseBody
    public Map<String, Object> reg(@Validated final Member member, final BindingResult result, @RequestParam("gender") final String gender, @RequestParam("repassword") final String repassword) 
        final Map<String, Object> errorMap = new HashMap<String, Object>();
        final List<String> errorList = new ArrayList<String>();
        if (result.hasErrors() || !member.getMpassword().equals(repassword)) 
            errorMap.put("status", "0");
            if (!member.getMpassword().equals(repassword)) 
                errorList.add("\\u4e24\\u6b21\\u8f93\\u5165\\u5bc6\\u7801\\u4e0d\\u4e00\\u81f4");
            
            final FieldError nameError = result.getFieldError("mname");
            final FieldError mpasswordError = result.getFieldError("mpassword");
            final FieldError midnoError = result.getFieldError("midno");
            final FieldError mphoneError = result.getFieldError("mphone");
            final FieldError memailError = result.getFieldError("memail");
            if (nameError != null) 
                errorList.add(nameError.getDefaultMessage());
            
            if (mpasswordError != null) 
                errorList.add(mpasswordError.getDefaultMessage());
            
            if (midnoError != null) 
                errorList.add(midnoError.getDefaultMessage());
            
            if (mphoneError != null) 
                errorList.add(mphoneError.getDefaultMessage());
            
            if (memailError != null) 
                errorList.add(memailError.getDefaultMessage());
            
            errorMap.put("errorList", errorList);
        
        else 
            if (gender.equals("1")) 
                member.setMgender(1);
            
            else 
                member.setMgender(0);
            
            member.setMdate(new Date());
            this.memberService.addMember(member);
            errorMap.put("status", "1");
            errorMap.put("msg", "\\u6ce8\\u518c\\u6210\\u529f\\uff0c\\u8bf7\\u524d\\u5f80\\u767b\\u5f55\\uff01");
        
        return errorMap;
    
    
    @RequestMapping( "/user/verifyemailandphone.html" )
    @ResponseBody
    public Map<String, Object> verifyEmailAndPhone(final String memail, final String mphone) 
        final Map<String, Object> verifyMap = new HashMap<String, Object>();
        if (memail != null && !memail.equals(" ")) 
            final MemberExample memberExample1 = new MemberExample();
            final MemberExample.Criteria criteria = memberExample1.createCriteria();
            criteria.andMemailEqualTo(memail);
            final long memailCount = this.memberService.countByExample(memberExample1);
            if (memailCount > 0L) 
                verifyMap.put("status", 0);
                verifyMap.put("msg", "\\u90ae\\u7bb1\\u5df2\\u88ab\\u6ce8\\u518c");
                return verifyMap;
            
        
        if (mphone != null && !mphone.equals(" ")) 
            final MemberExample memberExample2 = new MemberExample();
            final MemberExample.Criteria criteria2 = memberExample2.createCriteria();
            criteria2.andMphoneEqualTo(mphone);
            final long mphoneCount = this.memberService.countByExample(memberExample2);
            if (mphoneCount > 0L) 
                verifyMap.put("status", 0);
                verifyMap.put("msg", "\\u624b\\u673a\\u53f7\\u5df2\\u88ab\\u6ce8\\u518c");
                return verifyMap;
            
        
        verifyMap.put("status", 1);
        return verifyMap;
    
    
    @RequestMapping( "/login/captcha.html" )
    public void captcha(final HttpServletRequest request, final HttpServletResponse response) throws Exception 
        final String capText = this.kaptcha.createText();
        request.getSession().setAttribute("KAPTCHA_SESSION_KEY", (Object)capText);
        final BufferedImage bi = this.kaptcha.createImage(capText);
        final ServletOutputStream out = response.getOutputStream();
        ImageIO.write(bi, "jpg", (OutputStream)out);
        try 
            out.flush();
        
        finally 
            out.close();
        
        out.close();
    
    
    @RequestMapping( "/kaptchaverify.html" )
    @ResponseBody
    public Map<String, Object> verifyCode(final String code, final HttpServletResponse response, final HttpServletRequest request) 
        final Map<String, Object> verifyMap = new HashMap<String, Object>();
        final String codeText = (String)request.getSession().getAttribute("KAPTCHA_SESSION_KEY");
        if (codeText.equals(code)) 
            verifyMap.put("status", 1);
        
        else 
            verifyMap.put("status", 0);
            verifyMap.put("msg", "\\u9a8c\\u8bc1\\u7801\\u9519\\u8bef");
        
        return verifyMap;
    
    
    @RequestMapping( "/user/resetpwd.html" )
    @ResponseBody
    public Map<String, Object> resetPwd(final String email) 
        final Map<String, Object> map = new HashMap<String, Object>();
        if (email != null && !email.equals(" ")) 
            final MemberExample memberExample = new MemberExample();
            final MemberExample.Criteria criteria = memberExample.createCriteria();
            criteria.andMemailEqualTo(email);
            final List<Member> members = this.memberService.selectByExample(memberExample);
            if (members.size() > 0) 
                if (SendMail.sendMail(email, members.get(0).getMname())) 
                    final String newPwd = Funcs.MD5("stern123456789");
                    members.get(0).setMpassword(newPwd);
                    this.memberService.updateByPrimaryKeySelective(members.get(0));
                    map.put("msg", "\\u91cd\\u7f6e\\u6210\\u529f\\uff0c\\u8bf7\\u7528\\u65b0\\u5bc6\\u7801\\u767b\\u5f55,\\u5982\\u679c\\u6ca1\\u6709\\u67e5\\u6536\\u5230\\u90ae\\u4ef6\\uff0c\\u8bf7\\u5230\\u5783\\u573e\\u7bb1\\u4e2d\\u67e5\\u770b\\uff01");
                
                else 
                    map.put("msg", "\\u91cd\\u7f6e\\u5931\\u8d25");
                
            
            else if (members.size() == 0) 
                map.put("msg", "\\u8be5\\u90ae\\u7bb1\\u6ca1\\u6709\\u88ab\\u6ce8\\u518c");
            
        
        else 
            map.put("msg", "\\u8bf7\\u8f93\\u5165\\u6b63\\u786e\\u7684\\u90ae\\u7bb1");
        
        return map;
    
    
    @RequestMapping( "/login.html" )
    public String loginPage(final HttpServletRequest request, final Model model) throws IOException 
        final Cookie[] cookies = request.getCookies();
        String username = "";
        String pwd = "";
        if (cookies != null) 
            Cookie[] array;
            for (int length = (array = cookies).length, i = 0; i < length; ++i) 
                final Cookie cookie = array[i];
                if (cookie.getName().equals("user")) 
                    username = URLDecoder.decode(cookie.getValue().split("#")[0], "UTF-8");
                    pwd = cookie.getValue().split("#")[1];
                    break;
                
            
            model.addAttribute("mname", (Object)username);
            model.addAttribute("mpassword", (Object)pwd);
        
        return "login";
    
    
    @RequestMapping( "/user/login.html" )
    @ResponseBody
    public Map<String, String> login(final String mname, final String mpassword, final HttpServletRequest request, final HttpServletResponse response) throws Exception 
        final Map<String, String> res = new HashMap<String, String>();
        final Member member = this.memberService.selectMemberByNameAndPwd(mname, mpassword);
        if (member != null) 
            res.put("status", "1");
            if (request.getParameter("isRemember") != null) 
                final Cookie cookie = new Cookie("user", String.valueOf(URLEncoder.encode(mname, "utf-8")) + "#" + mpassword);
                cookie.setPath("/");
                cookie.setMaxAge(604800);
                response.addCookie(cookie);
            
            res.put("username", mname);
            request.getSession().setAttribute("member", (Object)member);
        
        else 
            res.put("status", "0");
            res.put("msg", "\\u7528\\u6237\\u540d\\u6216\\u8005\\u5bc6\\u7801\\u9519\\u8bef\\uff01");
        
        return res;
    
    
    @RequestMapping( "/member/loginout.html" )
    @ResponseBody
    public Map<String, Object> loginout(final HttpServletRequest request) 
        final Map<String, Object> loginoutMap = new HashMap<String, Object>();
        request.getSession().removeAttribute("member");
        request.getSession().invalidate();
        loginoutMap.put("status", 1);
        return loginoutMap;
    
    
    @RequestMapping( "admin/adminindex.html" )
    public Object admin(final HttpServletRequest request, final HttpServletResponse response, final Model model) throws IOException 
        final Member member = (Member)request.getSession().getAttribute("member");
        if (!member.getMname().equals("admin")) 
            response.setCharacterEncoding("utf-8");
            response.setContentType("text/html;charset=utf-8;");
            final PrintWriter writer = response基于Java+Springboot+Vue+elememt社区疫情返乡管控系统设计实现

毕业设计:基于Springboot+Vue+ElementUI实现疫情社区管理系统

毕业设计:基于Springboot+Vue+ElementUI实现疫情社区管理系统

基于Springboot社区人口管理系统的分析与实现

关于南禅寺街道开展核酸检测应急演练(压力测试)的通告

基于java ssm springboot+VUE疫情防疫系统系统前后端分离设计和实现必须收藏