一、项目简述
功能包括: 前台+后台健身房管理系统,用户预订,教练选择。课程选 择,登录,后台管理等等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
@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";
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("/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
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);
if(user!=null){
List<Map<String,Object>> 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){
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")
return "sys/apparatusTable";
}
@RequestMapping("/exit")
public String exit(HttpSession session){
session.invalidate();
return "login";
}
@ResponseBody
@RequestMapping("/getSex")
public List<User> getSex(){
List<User> list=userService.getSex();
return list;
}
@ResponseBody
@RequestMapping("/delUser")
public String delUser(Integer id){
userService.delUser(id);
return "true";
}
@ResponseBody
}
用户信息控制层:
@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(user!=null){
List<Map<String,Object>> list = userService.findUserByAccount(account);
session.setAttribute("userInfo", JSON.toJSON(list));
session.setAttribute("account", account);
return "true";
}
else{
return "false";
}
}
@RequestMapping("/Forward")
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);
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();
String account=user.getAccount();
user=userService.userLogin(user.getAccount(),user.getPwd());
if(user!=null){
List<Map<String,Object>> 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")
userService.addTeachInfo(teach);
return "true";
}
@ResponseBody
@RequestMapping("/addAppInfo")
public String addAppInfo(String aname){
userService.addAppInfo(aname);
return "true";
}
}
用户信息控制层:
@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());