文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Java毕业设计实战之健身俱乐部管理系统的实现

2024-04-02 19:55

关注

项目介绍:

基于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

系统管理控制层:


@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(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
    @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
    @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<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";  
    }   
}

用户管理控制层:


@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")  
    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";
    }  
}

用户管理服务类:


@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<Map<String, Object>> findUserByAccount(String account) {
		return userDao.findUserByAccount(account);
	}
 
	@Override
	public List<Map<String, Object>> findClass() {
		return userDao.findClass();
	}
 
	@Override
	public List<Map<String, Object>> 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<Map<String, Object>> countUser() {
		return userDao.countUser();
	}
 
	@Override
	public List<Map<String, Object>> countTeach() {
		return userDao.countTeach();
	}
 
	@Override
	public List<User> getSex() {
		return userDao.getSex();
	}
 
	@Override
	public List<Map<String, Object>> findUser() {
		return userDao.findUser();
	}
	@Override
	public List<Map<String, Object>> teachTable() {
		return userDao.teachTable();
	}
	@Override
	public List<Map<String, Object>> apparatusTable() {
		return userDao.apparatusTable();
	}
 
	@Override
	public List<Map<String, Object>> countApparatus() {
		return userDao.countApparatus();
	}
 
	@Override
	public List<User> 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);
	}
 
 
 
}

到此这篇关于Java毕业设计实战之健身俱乐部管理系统的实现的文章就介绍到这了,更多相关Java 俱乐部管理系统内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯