——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot在线健身房管理系统(java+springboot+thymeleaf+html+maven+mysql)
用户类型:管理员、会员(会员可以报名课程)
一、项目运行 环境配置:
Jdk1.8 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
JSP +SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + maven等等。
——————————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 return "userMain" ; } model.addAttribute("msg" , "您输入的账号或密码有误,请重新输入!" ); return "userLogin" ; } @RequestMapping("/toAdminMain") public String toAdminMain (Model model, HttpSession session) { Integer memberTotal = (Integer) session.getAttribute("memberTotal" ); Integer employeeTotal = (Integer) session.getAttribute("employeeTotal" ); Integer humanTotal = (Integer) session.getAttribute("humanTotal" ); Integer equipmentTotal = (Integer) session.getAttribute("equipmentTotal" ); model.addAttribute("memberTotal" , memberTotal); model.addAttribute("employeeTotal" , employeeTotal); model.addAttribute("humanTotal" , humanTotal); model.addAttribute("equipmentTotal" , equipmentTotal); return "adminMain" ; } @RequestMapping("/toUserMain") public String toUserMain (Model model, HttpSession session) { Member member = (Member) session.getAttribute("user" ); model.addAttribute("member" , member); return "userMain" ; } } package com.milotnt.controller;@Controller @RequestMapping("/member") public class MemberController { @Autowired
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 @Controller @RequestMapping("/employee") public class EmployeeController { @Autowired private EmployeeService employeeService; @RequestMapping("/selEmployee") public String selectEmployee (Model model) { List<Employee> employeeList = employeeService.findAll(); model.addAttribute("employeeList" , employeeList); return "selectEmployee" ; } @RequestMapping("/toAddEmployee") public String toAddEmployee () { return "addEmployee" ; } @RequestMapping("/addEmployee") public String addEmployee (Employee employee) { Random random = new Random(); String account1 = "1010" ; for (int i = 0 ; i < 5 ; i++) { account1 += random.nextInt(10 ); } Integer account = Integer.parseInt(account1); Date date = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd" ); String nowDay = simpleDateFormat.format(date);
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("/toSelByCard") public String toSelectByCardId () { return "selectByMemberAccount" ; } @RequestMapping("/selByCard") public String selectByCardId (Model model, Integer memberAccount) { List<Member> memberList = memberService.selectByMemberAccount(memberAccount); if (memberList != null ) { model.addAttribute("memberList" , memberList); } else { String message = "会员卡号不存在!" ; model.addAttribute("noMessage" , message); } return "selectByMemberAccount" ; } } package com.milotnt.controller;@Controller @RequestMapping("/employee") public class EmployeeController { @Autowired private EmployeeService employeeService; @RequestMapping("/selEmployee")
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("/updateEquipment") public String updateEquipment (Equipment equipment) { equipmentService.updateEquipmentByEquipmentId(equipment); return "redirect:selEquipment" ; } @RequestMapping("/toAddEquipment") public String toAddEquipment () { return "addEquipment" ; } @RequestMapping("/addEquipment") public String addEquipment (Equipment equipment) { equipmentService.insertEquipment(equipment); return "redirect:selEquipment" ; } } package com.milotnt.controller;@Controller @RequestMapping("/class") public class ClassController { @Autowired private ClassTableService classTableService; @Autowired private ClassOrderService classOrderService;
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 if (admin1 != null ) { Integer memberTotal = memberService.selectTotalCount(); model.addAttribute("memberTotal" , memberTotal); session.setAttribute("memberTotal" , memberTotal); Integer employeeTotal = employeeService.selectTotalCount(); model.addAttribute("employeeTotal" , employeeTotal); session.setAttribute("employeeTotal" , employeeTotal); Integer humanTotal = memberTotal + employeeTotal; model.addAttribute("humanTotal" , humanTotal); session.setAttribute("humanTotal" , humanTotal); Integer equipmentTotal = equipmentService.selectTotalCount(); model.addAttribute("equipmentTotal" , equipmentTotal); session.setAttribute("equipmentTotal" , equipmentTotal); return "adminMain" ; } model.addAttribute("msg" , "您输入的账号或密码有误,请重新输入!" ); return "adminLogin" ; } @RequestMapping("/userLogin") public String userLogin (Member member, Model model, HttpSession session) { Member member1 = memberService.userLogin(member); if (member1 != null ) { model.addAttribute("member" , member1); session.setAttribute("user" , member1); return "userMain" ; } model.addAttribute("msg" , "您输入的账号或密码有误,请重新输入!" ); return "userLogin" ; }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=461422272105200bp https://javayms.pages.dev?id=461422272105200bp