——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SSM健身俱乐部管理系统(java+ssm+mysql+jsp)
项目介绍:
基于jsp+mysql+Spring+mybatis的SSM健身房管理系统 运行环境: jdk 1.8 IDE环境: Eclipse,Myeclipse,IDEA都可以 tomcat环境: Tomcat 7.x,8.x,9.x版本均可,理论上Tomcat版本不是太老都可以。 硬件环境: windows 7/8/10 1G内存以上 主要功能说明: 管理员角色包含以下功能:登录页面,管理员首页,会员增删改查,教练增删改查,运动器材管理等功能。 用户角色包含以下功能:用户登录页面,用户首页,选择课程,选择教练等功能。 用了技术框架: HTML+CSS+JavaScript+jsp+mysql+Spring+mybatis 管理员账号/密码:admin/admin 用户账号/密码: 12345/12345
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| List<User> id=userService.findAccount(user.getAccount()); if(id.size()!=0){ return "false"; } userService.registerUser(user); return "true"; } @RequestMapping("/addUser") public String addUser(){ return "sys/addUser"; } @RequestMapping("/addTeach") public String addTeach(){ return "sys/addTeach"; } @RequestMapping("/addApp") public String addApp(){ return "sys/addApp"; } @ResponseBody @RequestMapping("/upUserInfo") public String upUserInfo(Integer id,String account,Integer sex,Integer age,String name,String pwd,String tel,String address){ userService.updateUserInfo(id,account,sex,age,name,pwd,tel,address); return "true"; } @ResponseBody @RequestMapping(value="/upTeachInfo",method=RequestMethod.POST) public String upTeach(Integer id,String tname,Integer cid,String ttel,String taddress){ userService.upTeach(id,tname,cid,ttel,taddress); return "true"; } @ResponseBody @RequestMapping("/addTeachInfo") public String addTeachInfo(Teach teach){ userService.addTeachInfo(teach); return "true"; } @ResponseBody @RequestMapping("/addAppInfo") public String addAppInfo(String aname){ userService.addAppInfo(aname); return "true"; } }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| @Resource private IUserService userService; SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @ResponseBody @RequestMapping("/loginAdmin") public String toIndex(Admin admin,HttpSession session){ admin=userService.adminLogin(admin.getName(),admin.getPwd()); if(admin!=null){ session.setAttribute("lastLoginTime", admin.getLastlogintime()); session.setAttribute("account", "123"); userService.setTime(df.format(new Date())); return "true"; }else{ return "false"; } } @RequestMapping("/ForwardAdmin") public String loginForward(HttpSession session){ List<Map<String, Object>> countUserList=userService.countUser(); session.setAttribute("countUser",countUserList); List<Map<String, Object>> countTeachList=userService.countTeach(); session.setAttribute("countTeach",countTeachList); List<Map<String, Object>> countApparatusList=userService.countApparatus(); session.setAttribute("countApparatus",countApparatusList); return "sys/main"; } @RequestMapping("/userTable") public String userTable(HttpSession session){ List<Map<String, Object>> findUserList=userService.findUser(); session.setAttribute("findUserList",findUserList); return "sys/userTable"; } @RequestMapping("/teachTable") public String teachTable(HttpSession session){ List<Map<String, Object>> findUserList=userService.teachTable(); session.setAttribute("findTeachList",findUserList); return "sys/teachTable"; } @RequestMapping("/apparatusTable") public String apparatusTable(HttpSession session){ List<Map<String, Object>> findUserList=userService.apparatusTable(); session.setAttribute("findApparatusList",findUserList); return "sys/apparatusTable"; } @RequestMapping("/exit") public String exit(HttpSession session){ session.invalidate(); return "login"; } @ResponseBody
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| @RequestMapping("/selectTeach") public String selectTeach(HttpSession session,Integer id){ List<Map<String,Object>> list = userService.findSeTeach(id); session.setAttribute("SelectTeachInfo", JSON.toJSON(list)); return "true"; } @ResponseBody @RequestMapping("/chooseTeach") public String chooseTeach(Integer id,Integer cid,Integer uid){ userService.chooseTeach(id,cid,uid); return "true"; } @ResponseBody @RequestMapping("/updateUserInfo") public String updateUserInfo(Integer id,String account,Integer sex,Integer age,String name,String pwd,String tel,String address){ userService.updateUserInfo(id,account,sex,age,name,pwd,tel,address); return "true"; } } package com.demo.fillter;
public class SecurityServlet extends HttpServlet implements Filter{ private static final long serialVersionUID = 1L;
public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException { HttpServletRequest request=(HttpServletRequest)arg0; HttpServletResponse response =(HttpServletResponse) arg1; String count = (String) request.getSession().getAttribute("account"); String url=request.getRequestURI(); if(url.indexOf("login")<0){ if(count==null || "".equals(count) ) { response.sendRedirect(request.getContextPath()+"/login.jsp"); }else{ arg2.doFilter(arg0, arg1); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| } else{ return "false"; } } @RequestMapping("/Forward") public String loginForward(){ return "user/index"; } @RequestMapping("/exit") public String exit(HttpSession session){ session.invalidate(); return "login"; } @RequestMapping("/myInfo") public String myInfo(HttpSession session){ String account=(String) session.getAttribute("account"); List<Map<String,Object>> list = userService.findUserByAccount(account); session.setAttribute("userInfo", JSON.toJSON(list)); return "user/index"; } @RequestMapping("/classTable") public String classTable(HttpSession session){ List<Map<String,Object>> list = userService.findClass(); session.setAttribute("classInfo", JSON.toJSON(list)); return "user/classTable"; } @RequestMapping("/teachList") public String teachList(HttpSession session){ return "user/teachList"; } @ResponseBody @RequestMapping("/selectTeach") public String selectTeach(HttpSession session,Integer id){ List<Map<String,Object>> list = userService.findSeTeach(id); session.setAttribute("SelectTeachInfo", JSON.toJSON(list)); return "true"; } @ResponseBody @RequestMapping("/chooseTeach") public String chooseTeach(Integer id,Integer cid,Integer uid){ userService.chooseTeach(id,cid,uid); return "true"; } @ResponseBody @RequestMapping("/updateUserInfo") public String updateUserInfo(Integer id,String account,Integer sex,Integer age,String name,String pwd,String tel,String address){ userService.updateUserInfo(id,account,sex,age,name,pwd,tel,address); return "true"; } } package com.demo.fillter;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| return "true"; } @ResponseBody @RequestMapping("/delApp") public String delApp(Integer id){ userService.delApp(id); return "true"; } @RequestMapping("/upUser") public String upUser(Integer id,String account,Integer sex,Integer age,String name,String pwd,String tel,String address,HttpSession session){ List list=new ArrayList(); list.add(id); list.add(account); list.add(sex); list.add(age); list.add(name); list.add(pwd); list.add(tel); list.add(address); session.setAttribute("upList", list); return "sys/upUser"; } @RequestMapping("/upTeach") public String upTeach(Integer id,String tname,Integer cid,String ttel,String taddress,HttpSession session){ List list=new ArrayList(); list.add(id); list.add(tname); list.add(cid); list.add(ttel); list.add(taddress); session.setAttribute("upTeachList", list); return "sys/upTeach"; } @ResponseBody @RequestMapping("/registerUser") public String registerUser(User user){ List<User> id=userService.findAccount(user.getAccount()); if(id.size()!=0){ return "false"; } userService.registerUser(user); return "true"; } @RequestMapping("/addUser") public String addUser(){ return "sys/addUser";
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=461422302105200gw
https://javayms.pages.dev?id=461422302105200gw