基于SSM的高校学生社团管理系统的设计与实现

a 夏天 提交于 2019-11-27 16:07:12
  在社团建设中,资金成为限制学生分类的主要因素。在此情况下,学校应该在保证一定大学生社团平台分类专项经费的基础上,积极争取政策、多渠道筹集经费,为大学生社团平台提供必要的经费保障。同时大学生社团平台要增强自身的造血功能,利用自身的知识优势、专业优势组织开展面向广大学生、面向社会的服务分类,实现经费来源多元化。此外学校要充分考虑各社团的性质、特点、分类形式等因素,对分类场所、办公场所及办公用品等合理分配、高效利用。
  大学生社团平台作为社会发展的必然产物,对新一代大学生的成长成才影响巨大,同时也给学校各项工作带来了新的挑战和机遇。高校社团建设是一个长期、复杂的过程,只有在高校党、团组织的高度重视和领导下,切实加强学生社团管理系统工作,实现社团管理的规范化和制度化,学生社团管理系统才能充分发挥出其服务于教育、服务于学生的积极作用。
   随之而来,大学社团的管理工作也需要达到一定的高度去管理、把从平时很多同学辛苦烦劳的体力劳动中解脱出来,便于社团管理人员及时的对会费进行管理,对社团人的发展有一定的促进作用!
本系统最大的特点是使用操作简单、友好的提示信息。本系统将实现以下基本功能: (1)系统具有简洁大方的页面,使用简便,友好的错误操作提示 (2)管理员用户具有管理社团相关信息、分类、成员信息等功能 (3)普通用户用户具有浏览学院简介、社团列表、社团分类、成员信息等功能 (4)具有较强的安全性,避免用户的恶意操作 系统的功能结构图,分普通用户平台,管理员平台。普通用户功能模块图说明,如图下图所示:

技术选型:jdk1.7、tomat8、mysql5.6、eclipse3.5 技术框架:SSM
在这里插入图片描述
登录模块代码如下:

1. //注册页面(只有前台有注册)
    	    @RequestMapping(value = "/register.do") 		public String register(Model model) { 			List<School>
    schoolList=schoolService.listAll();
    			model.addAttribute("schoolList", schoolList);	 			return
    "login/uRegister"; 		}		 		//登陆页面 		@RequestMapping(value =
    "/login.do") 		public String login(Integer role) { 			if(role==1){
    				return "login/uLogin"; 			}else{
    				return "login/mLogin"; 			} 		}		 		 /** 		 * 跳转到忘记密码页面 		 * @return 		 */
    	   @RequestMapping(value = "/forgetPassWord.do") 		public String forgetPassWord(){ 			return "login/forgetPassWord";
    						}				
    	   //退出 		@RequestMapping(value = "/tuichu.do") 		public String tuichu(Integer role, HttpServletRequest request) { 			if(role==1){
    				HttpSession  session = request.getSession();
    				session.invalidate();
    				return "login/uLogin"; 			}else{
    				HttpSession  session = request.getSession();
    				session.invalidate();
    				return "login/mLogin"; 			} 		}			 		//登录成功进入首页 		@RequestMapping(value = "/index.do") 		public String index(Integer
    role, Model model,HttpSession session){ 			Integer parentId =
    (Integer) session.getAttribute("parentId"); 			Integer schoolId =
    (Integer) session.getAttribute("schoolId"); 			Integer classroomId =
    (Integer) session.getAttribute("classroomId"); 			if(role==1){
    			List<Introduction>
    introductionList=introductionService.listAll();
    			model.addAttribute("introductionList", introductionList);
    			//社团活动 			Map<String, Object> map1 = getMap();
    		    map1.put("type",1);
    		    map1.put("a",1); 			List<News> newsList=newsService.list(map1); 			model.addAttribute("newsList",
    newsList); 			//社团新闻 			Map<String, Object> map2 = getMap();
    		    map2.put("type",2);
    		    map2.put("parentId",parentId);
    		    map2.put("schoolId",schoolId);
    		    map2.put("classroomId",classroomId);
    		    map2.put("a",1); 			List<News> newsList1=newsService.list(map2); 			model.addAttribute("newsList1",
    newsList1); 			//社团公告 			List<Notice>
    noticeList=noticeService.list(map1);
    			model.addAttribute("noticeList", noticeList); 			//社团公告
    			List<Notice> noticeList1=noticeService.list(map2);
    			model.addAttribute("noticeList1", noticeList1); 			//最新动态系统最新动态
    			List<News> newsList2=newsService.list(map1);
    			model.addAttribute("newsList2", newsList2); 			//最新动态社团最新动态
    			List<News> newsList3=newsService.list(map2);
    			model.addAttribute("newsList3", newsList3); 			//留言和回复信息
    			List<Message> messagesList=messageService.list(map2);
    			model.addAttribute("messagesList", messagesList); 			//社团活动下载
    			List<Homework> homeworkList=homeworkService.list(map2);
    			model.addAttribute("homeworkList", homeworkList);
    			
    				return "login/uIndex"; 			}else{
    				return "login/mIndex"; 			} 		}

在这里插入图片描述

在这里插入图片描述

进入后台页面代码如下:

  /**
     * 登陆以后进入首页
     * @return
     * @throws IOException 
     */
	@RequestMapping("/index.json")
	@ResponseBody
    public String index(HttpServletRequest request, HttpServletResponse response, HttpSession session ,Manage manage) throws IOException{
	        //查询该用户是否存在
			 Map<String, Object> map = getMap();
			 map.put("adminName",manage.getAdminName());
	    	 Manage m1 =manageService.loadBySqlId("loadBySqlId", map);
	    	 map.put("loginName",manage.getAdminName());
    		 Teacher t1=teacherService.loadBySqlId("loadBySqlId", map);
    		JSONObject jsonObject = JsonUtil2.getJsonObject();
    	if(m1==null&&t1==null){
    		   jsonObject.put("result", 3); //该用户不存在
    	}else{
    		 //查询用户和密码是否 正确
	        map.put("passWord",manage.getPassWord());
			Manage m =manageService.loadBySqlId("loadBySqlId", map);
			Teacher t=teacherService.loadBySqlId("loadBySqlId", map);
		   if(m!=null||t!=null){
			   if(m!=null){
				   jsonObject.put("result", 1); //登录成功
				   if (session!=null && !session.isNew()) {
					    session.invalidate();
					}
					session = request.getSession(true);		
		           session.setAttribute("realName", m.getRealName());
		           session.setAttribute("adminId", m.getId());
		           session.setAttribute("type", m.getType());
		           session.setAttribute("schoolId", m.getSchoolId());  
			   }
			   if(t!=null){
				   jsonObject.put("result", 1); //登录成功
				   if (session!=null && !session.isNew()) {
					    session.invalidate();
					}
					session = request.getSession(true);		
		           session.setAttribute("realName", t.getRealName());
		           session.setAttribute("adminId", t.getId());
		           session.setAttribute("type", t.getType());
		           session.setAttribute("schoolId", t.getSchoolId());
		           session.setAttribute("classroomId", t.getClassroomId());
		           session.setAttribute("gradeId", t.getGradeId());
		           session.setAttribute("id", t.getId());
			   }
	        }else{
	        	jsonObject.put("result",2);//密码错误
	        }
    	}
     	return jsonObject.toString();
    }	
	/**
	 * 分页查询 返回list对象(通过对象)
	 * 
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/findByObj.do")
	public String findByObj(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
		Pager<Manage> pagers=new Pager<Manage>();
		if(!isEmpty(manage.getAdminName())){
			 Map<String, Object> map = getMap();
			 map.put("adminName",manage.getAdminName());
			//模糊查询分页查询
			pagers = manageService.findByMap(map);
		}else{
			//分页查询
			 pagers = manageService.findByEntity(manage);
		}
		model.addAttribute("pagers", pagers);
		//存储查询条件
		model.addAttribute("obj", manage);
		return "manage/manage";
	}	
	/**
	 * 分页查询 返回list对象(通过Map)
	 * 
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/findByMap.do")
	public String findByMap(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
		//通过map查询
		Map<String,Object> params = new HashMap<String,Object>();
        if(!isEmpty(manage.getAdminName())){
        	params.put("adminName", manage.getAdminName());
		}
        if(!isEmpty(manage.getIsDelete())){
        	params.put("isDelete", manage.getIsDelete());
		}
        if(!isEmpty(manage.getPhone())){
        	params.put("phone", manage.getPhone());
		}
        if(!isEmpty(manage.getPassWord())){
        	params.put("passWord", manage.getPassWord());
		}
        if(!isEmpty(manage.getRealName())){
        	params.put("realName", manage.getRealName());
		}
        if(!isEmpty(manage.getType())){
        	params.put("type", manage.getType());
		}
        if(!isEmpty(manage.getSchoolId())){
        	params.put("schoolId", manage.getSchoolId());
		}
		//分页查询
		Pager<Manage> pagers = manageService.findByMap(params);
		model.addAttribute("pagers", pagers);
		//存储查询条件
		model.addAttribute("obj", manage);
		return "manage/manage";
	}
	
	
	/**
	 * 跳至添加页面
	 * @return
	 */
	@RequestMapping(value = "/add.do")
	public String add(Model model) {
		List<School> schoolList=schoolService.listAll();
		model.addAttribute("schoolList", schoolList);
		return "manage/add";
	}	
	/**
	 * 添加执行
	 * @return
	 */
	@RequestMapping(value = "/exAdd.do")
	public String exAdd(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response,HttpSession session) {
		manage.setIsDelete(0);
		manage.setType(1);
		manageService.insert(manage);
		return "redirect:/manage/findByObj.do";
	}	
	
	/**
	 * 跳至修改页面
	 * @return
	 */
	@RequestMapping(value = "/update.do")
	public String update(Integer id,Model model) {
		Manage obj = manageService.load(id);
		model.addAttribute("obj",obj);
		List<School> schoolList=schoolService.listAll();
		model.addAttribute("schoolList", schoolList);
		return "manage/update";
	}	
	/**
	 * 添加修改
	 * @return
	 */
	@RequestMapping(value = "/exUpdate.do")
	public String exUpdate(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
		manageService.update(manage);
		return "redirect:/manage/findByObj.do";
	}	
	/**
	 * 删除通过主键
	 * @return
	 */
	@RequestMapping(value = "/delete.do")
	public String delete(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
		//真正删除
//		manageService.deleteById(id);
		manage.setIsDelete(1);
		//逻辑删除
		manageService.update(manage);
		//通过参数删除
        //Map<String,Object> params = new HashMap<String,Object>();
		//params.put("id", id);
		//manageService.deleteBySqId("deleteBySql", params);
		//状态删除
		//Manage load = manageService.load(id);
		//load.setIsDelete(1);
		//manageService.update(load);
		return "redirect:/manage/findByObj.do";
	}
	
	// --------------------------------------- 华丽分割线 ------------------------------
	
	/**
	 * 分页查询 返回list json(通过对象)
	 * 
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/findByObj.json",produces=MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
	@ResponseBody
	public String findByObjByEntity(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
		//分页查询
		Pager<Manage> pagers = manageService.findByEntity(manage);
		JSONObject jsonObject = JsonUtil2.getJsonObject();
		jsonObject.put("pagers", pagers);
		jsonObject.put("obj", manage);
		return jsonObject.toString();
	}
	  
	/**
	 * 分页查询 返回list json(通过Map)
	 * 
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/findByMap.json", produces=MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
	@ResponseBody
	public String findByMapMap(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
		//通过map查询
		Map<String,Object> params = new HashMap<String,Object>();
        if(!isEmpty(manage.getAdminName())){
        	params.put("adminName", manage.getAdminName());
		}
        if(!isEmpty(manage.getIsDelete())){
        	params.put("isDelete", manage.getIsDelete());
		}
        if(!isEmpty(manage.getPhone())){
        	params.put("phone", manage.getPhone());
		}
        if(!isEmpty(manage.getPassWord())){
        	params.put("passWord", manage.getPassWord());
		}
        if(!isEmpty(manage.getRealName())){
        	params.put("realName", manage.getRealName());
		}
		//分页查询
		Pager<Manage> pagers = manageService.findByMap(params);
		JSONObject jsonObject = JsonUtil2.getJsonObject();
		jsonObject.put("pagers", pagers);
		jsonObject.put("obj", manage);
		return jsonObject.toString();
	}
	

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!