欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-03-03 09:18:17
项目介绍: 基于jsp+mysql+spring+mybatis的ssm健身房管理系统运行环境: jdk 1.8ide环境: eclipse,myeclipse,idea都可以tomcat环境: to...

项目介绍:

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

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

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

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

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

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

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

系统管理控制层:

@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 俱乐部管理系统内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!