Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Management system of Fitness Club by Java

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to achieve Java fitness club management system, I hope you will learn something after reading this article, let's discuss it together!

Project description:

SSM Gym Management system based on jsp+mysql+Spring+mybatis

Operating environment: jdk 1.8

IDE environment: Eclipse,Myeclipse,IDEA is fine.

Tomcat environment: Tomcat 7.x Magi 8.x Magi 9.x version is OK, theoretically, Tomcat version is not too old.

Hardware environment: windows 7-8-10 more than 1G memory

Main function description: administrator role includes the following functions: login page, administrator home page, member addition, deletion, change and search, coach addition, deletion, change and search, sports equipment management and other functions.

The user role includes the following functions: user login page, user home page, selection of courses, selection of coaches and other functions.

Using the technical framework: HTML+CSS+JavaScript+jsp+mysql+Spring+mybatis

Administrator account / password: admin/admin

User account number / password: 12345tic12345

System management control layer:

@ Controller @ RequestMapping ("/ sys") public class SysController {@ 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 (adminstration 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 countUserList=userService.countUser (); session.setAttribute ("countUser", countUserList); List countTeachList=userService.countTeach () Session.setAttribute ("countTeach", countTeachList); List countApparatusList=userService.countApparatus (); session.setAttribute ("countApparatus", countApparatusList); return "sys/main";} @ RequestMapping ("/ userTable") public String userTable (HttpSession session) {List findUserList=userService.findUser () Session.setAttribute ("findUserList", findUserList); return "sys/userTable";} @ RequestMapping ("/ teachTable") public String teachTable (HttpSession session) {List findUserList=userService.teachTable (); session.setAttribute ("findTeachList", findUserList); return "sys/teachTable" } @ RequestMapping ("/ apparatusTable") public String apparatusTable (HttpSession session) {List findUserList=userService.apparatusTable (); session.setAttribute ("findApparatusList", findUserList); return "sys/apparatusTable";} @ RequestMapping ("/ exit") public String exit (HttpSession session) {session.invalidate () Return "login"; @ ResponseBody @ RequestMapping ("/ getSex") public List getSex () {List list=userService.getSex (); return list;} @ ResponseBody @ RequestMapping ("/ delUser") public String delUser (Integer id) {userService.delUser (id); return "true" @ ResponseBody @ RequestMapping ("/ delTeach") public String delTeach (Integer id) {userService.delTeach (id); 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 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";}}

User management control layer:

@ Controller @ RequestMapping ("/ user") public class UserController {@ Resource private IUserService userService; @ ResponseBody @ RequestMapping ("/ login") public String toIndex (User user,HttpSession session) {String account=user.getAccount (); user=userService.userLogin (user.getAccount (), user.getPwd ()) If (username null) {List list = userService.findUserByAccount (account); session.setAttribute ("userInfo", JSON.toJSON (list)); session.setAttribute ("account", account); return "true" } 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 list = userService.findUserByAccount (account); session.setAttribute ("userInfo", JSON.toJSON (list)); return "user/index" } @ RequestMapping ("/ classTable") public String classTable (HttpSession session) {List 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 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";}}

User management service class:

@ Service ("userService") public class UserServiceImpl implements IUserService {@ Resource private IUserDao userDao; @ Override public User userLogin (String account, String pwd) {return userDao.userLogin (account,pwd);} @ Override public List findUserByAccount (String account) {return userDao.findUserByAccount (account) @ Override public List findClass () {return userDao.findClass ();} @ Override public List findSeTeach (Integer id) {return userDao.findSeTeach (id);} @ Override public void chooseTeach (Integer id,Integer cid,Integer uid) {userDao.chooseTeach (id,cid,uid) } @ Override public void updateUserInfo (Integer id,String account, Integer sex, Integer age, String name, String pwd, String tel, String address) {userDao.updateUserInfo (id,account,sex,age,name,pwd,tel,address);} @ Override public Admin adminLogin (String name, String pwd) {return userDao.adminLogin (name,pwd) } @ Override public void setTime (String format) {userDao.setTime (format);} @ Override public List countUser () {return userDao.countUser ();} @ Override public List countTeach () {return userDao.countTeach () } @ Override public List getSex () {return userDao.getSex ();} @ Override public List findUser () {return userDao.findUser ();} @ Override public List teachTable () {return userDao.teachTable () @ Override public List apparatusTable () {return userDao.apparatusTable ();} @ Override public List countApparatus () {return userDao.countApparatus ();} @ Override public List findAccount (String account) {return userDao.findAccount (account) @ Override public void registerUser (User user) {userDao.registerUser (user);} @ Override public void delUser (Integer id) {userDao.delUser (id);} @ Override public void addTeachInfo (Teach teach) {userDao.addTeachInfo (teach) } @ Override public void delTeach (Integer id) {userDao.delTeach (id);} @ Override public void upTeach (Integer id, String tname,Integer cid, String ttel, String taddress) {userDao.upTeach (id,tname,cid,ttel,taddress) } @ Override public void addAppInfo (String aname) {userDao.addAppInfo (aname);} @ Override public void delApp (Integer id) {userDao.delApp (id) }} after reading this article, I believe you have a certain understanding of "how to implement the fitness club management system in Java". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report