基于javaweb+mysql的ssm+maven足球联赛管理系统(java+ssm+jsp+bootstrap+layui+mysql)

基于javaweb+mysql的ssm+maven足球联赛管理系统(java+ssm+jsp+bootstrap+layui+mysql)

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb的SSM+Maven足球联赛管理系统(java+ssm+jsp+bootstrap+layui+mysql)

项目介绍

本项目包含管理员与用户两种角色;

管理员角色包含以下功能: 管理员登录,联赛积分榜查询,联赛管理,联赛计分管理,球队战绩查询,球队信息管理,比赛结果管理,比赛结果查询,基础数据管理,用户管理,角色管理,模块管理等功能。

用户角色包含以下功能: 用户登录与注册,联赛积分榜查询,球队战绩查询,比赛结果查询等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:是;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jQuery+bootstrap+layui

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入 http://localhost:8080/
	public ModelAndView deleteDict(@RequestBody SystemDict systemDict){
		sdService.deleteByPrimaryKey(systemDict.getDictId());
		ModelAndView mav = new ModelAndView("view/system_dict");
		return mav;
		
	}

}

@Controller
public class GameController {
	
	@Resource
	private IFootballGameService fgService = null;
	@Resource
	private IFootballTeamService ftService = null;

	@RequestMapping("view/game")
	public ModelAndView toFootballGame(HttpServletRequest request,Model model){
		request.setAttribute("teamList", ftService.selectFootballTeamList());
		ModelAndView mav = new ModelAndView("view/football_game");
		return mav;
	}
	

	@RequestMapping("view/showgame")
	public ModelAndView toShowFootballGame(HttpServletRequest request,Model model){
		return mav;
	}

	@ResponseBody 
	@RequestMapping(value="view/getRoleListJson", method = RequestMethod.GET)
	public String getRoleListJson(Model model){		
		List<SystemRole> systemModuleList =  srService.selectSystemRoleList();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		JSONArray json = new JSONArray();
        for(SystemRole systemRole : systemModuleList){ 	
            JSONObject jo = new JSONObject();
            jo.put("roleId", systemRole.getRoleId());
            jo.put("roleName", systemRole.getRoleName());
            jo.put("roleInfo", systemRole.getRoleInfo());
            jo.put("isEnable", systemRole.getIsEnable());
            jo.put("createTime", sdf.format(systemRole.getCreateTime()));
            json.add(jo);
        }
        return json.toJSONString();
	}
	

	@ResponseBody 
	@RequestMapping(value="view/saveRole", method = RequestMethod.POST)
	public ModelAndView saveRole(@RequestBody SystemRole systemRole){
		//System.out.println("接收到提交的保存角色的信息!" + systemRole.getRoleId());
		if(systemRole.getRoleId() == null){
			srService.insert(systemRole);
		}else{
			srService.updateByPrimaryKey(systemRole);
		}		
		ModelAndView mav = new ModelAndView("view/system_role");
		return mav;
		
	}
	

	@ResponseBody 
	@RequestMapping(value="view/deleteRole", method = RequestMethod.POST)
	public ModelAndView deleteRole(@RequestBody SystemRole systemRole){
		
		srService.updateByPrimaryKey(systemRole);
		ModelAndView mav = new ModelAndView("view/system_role");
		return mav;
		
	}

	}
	

	@ResponseBody 
	@RequestMapping(value="view/saveUser", method = RequestMethod.POST)
	public ModelAndView saveRole(@RequestBody SystemUser systemUser){
		//System.out.println("接收到提交的保存角色的信息!" + systemRole.getRoleId());
		if(systemUser.getUserId() == null){
			systemUser.setPassword("123456");
			suService.insert(systemUser);
		}else{
			suService.updateByPrimaryKeySelective(systemUser);
		}		
		ModelAndView mav = new ModelAndView("view/system_user");
		return mav;
		
	}
	
	@ResponseBody 
	@RequestMapping(value="view/deleteUser", method = RequestMethod.POST)
	public ModelAndView deleteUser(@RequestBody SystemUser systemUser){
		
		suService.updateByPrimaryKeySelective(systemUser);
		ModelAndView mav = new ModelAndView("view/system_user");
		return mav;
		
	}

}

	}
	

	@ResponseBody 
	@RequestMapping(value="view/deleteGame", method = RequestMethod.POST)
	public String deleteGame(@RequestBody FootballGame footballGame){
		
		fgService.deleteByPrimaryKey(footballGame.getGameId());
		return "true";
		
	}
	

}

@Controller
public class UserController {
	
	@Resource
	private ISystemUserService suService = null;
	
}

@Controller
public class RoleController {
	
	@Resource
	private ISystemRoleService srService;
	
	@RequestMapping("view/role")
	public ModelAndView toRole(Model model){
		ModelAndView mav = new ModelAndView("view/system_role");
		return mav;
	}

	@ResponseBody 
	@RequestMapping(value="view/getRoleListJson", method = RequestMethod.GET)
	public String getRoleListJson(Model model){		
		List<SystemRole> systemModuleList =  srService.selectSystemRoleList();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		JSONArray json = new JSONArray();
        for(SystemRole systemRole : systemModuleList){ 	
            JSONObject jo = new JSONObject();
            jo.put("roleId", systemRole.getRoleId());
            jo.put("roleName", systemRole.getRoleName());
            jo.put("roleInfo", systemRole.getRoleInfo());
            jo.put("isEnable", systemRole.getIsEnable());

	@RequestMapping("view/user")
	public String toUser(HttpServletRequest request,Model model){
		request.setAttribute("roleList", srService.selectSystemRoleList());
		return "view/system_user";
	}
	

	@ResponseBody 
	@RequestMapping(value="view/getUserListJson", method = RequestMethod.GET)
	public String getUserListJson(Model model){		
		List<SystemUser> systemUserList =  suService.selectUserList();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		JSONArray json = new JSONArray();
        for(SystemUser systemUser : systemUserList){ 	
            JSONObject jo = new JSONObject();
            jo.put("userId", systemUser.getUserId());
            jo.put("userName", systemUser.getUserName());
            jo.put("realName", systemUser.getRealName());
            jo.put("roleId", systemUser.getRoleId());
            jo.put("roleName", systemUser.getRoleName());
            jo.put("contactTel", systemUser.getContactTel());
            jo.put("email", systemUser.getEmail());
            jo.put("isEnable", systemUser.getIsEnable());
            jo.put("createTime", sdf.format(systemUser.getCreateTime()));
            json.add(jo);
        }
        return json.toJSONString();
	}
	

	@ResponseBody 
	@RequestMapping(value="view/saveUser", method = RequestMethod.POST)
	public ModelAndView saveRole(@RequestBody SystemUser systemUser){
		//System.out.println("接收到提交的保存角色的信息!" + systemRole.getRoleId());
		if(systemUser.getUserId() == null){
			systemUser.setPassword("123456");
			suService.insert(systemUser);
		}else{
			suService.updateByPrimaryKeySelective(systemUser);
		}		
		ModelAndView mav = new ModelAndView("view/system_user");
		return mav;
		
	}
	
	@ResponseBody 
		return mav;
	}
	

	@ResponseBody 
	@RequestMapping(value="view/getTeamListJson", method = RequestMethod.GET)
	public String getTeamListJson(Model model){		
		List<FootballTeam> footballLeagueList =  ftService.selectFootballTeamList();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		JSONArray json = new JSONArray();
        for(FootballTeam footballTeam : footballLeagueList){ 	
            JSONObject jo = new JSONObject();
            jo.put("teamId", footballTeam.getTeamId());
            jo.put("teamName", footballTeam.getTeamName());
            jo.put("teamInfo", footballTeam.getTeamInfo());
            jo.put("createTime", sdf.format(footballTeam.getCreateTime()));
            json.add(jo);
        }
        return json.toJSONString();
	}

	@ResponseBody 
	@RequestMapping(value="view/getTeamListJsonByLeagueId", method = RequestMethod.GET)
	public String getTeamListJsonByLeagueId(HttpServletRequest request,Model model){	
		
		List<Integer> leagueTeamIdList = new ArrayList<Integer>();
		if(!"".equals(request.getParameter("leagueId"))){
			int leagueId = Integer.parseInt(request.getParameter("leagueId"));
			List<FootballTeam> footballTeamByLeagueIdList = ftService.selectTeamListByLeagueId(leagueId);
						
			for(FootballTeam footballTeam : footballTeamByLeagueIdList){
				leagueTeamIdList.add(footballTeam.getTeamId());
			}
		}		
		List<FootballTeam> footballTeamList = ftService.selectFootballTeamList();		
		
		JSONArray json = new JSONArray();
        for(FootballTeam footballTeam : footballTeamList){
        	
            JSONObject jo = new JSONObject();
            jo.put("id", footballTeam.getTeamId());
            jo.put("pId", "0");
            jo.put("name", footballTeam.getTeamName());
            jo.put("open", true);
            if(leagueTeamIdList.contains(footballTeam.getTeamId())){
            	jo.put("checked", true);

@Controller
//@RequestMapping("/login")
public class LoginController {
	@Resource
	private ISystemModuleService smService = null;

	@Resource
	private ISystemUserService suService = null;
	
	@RequestMapping("view/login")
	public String login(Model model){
		
		return "view/login";
	}
	
	@ResponseBody 
	@RequestMapping("view/loginUser")
	public String loginUser(HttpServletRequest request,@RequestBody SystemUser systemUser){
		
		SystemUser curSystemUser = suService.selectByNameAndPassword(systemUser);
		
		if(curSystemUser!= null){
			HttpSession session = request.getSession();
			session.setMaxInactiveInterval(3600);
			session.setAttribute("user", curSystemUser);
			return "true";
		}else{
			return "false";
		}
		
	}
	

	@ResponseBody 
	@RequestMapping("view/selectUserName")
	public String selectUserName(HttpServletRequest request,@RequestBody SystemUser systemUser){

@Controller
public class TeamController {

	@Resource
	private IFootballTeamService ftService = null;
	

	@RequestMapping("view/team")
	public ModelAndView toModule(Model model){
		ModelAndView mav = new ModelAndView("view/football_team");
		return mav;
	}
	

	@ResponseBody 
	@RequestMapping(value="view/getTeamListJson", method = RequestMethod.GET)
	public String getTeamListJson(Model model){		
		List<FootballTeam> footballLeagueList =  ftService.selectFootballTeamList();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		JSONArray json = new JSONArray();
        for(FootballTeam footballTeam : footballLeagueList){ 	
            JSONObject jo = new JSONObject();
            jo.put("teamId", footballTeam.getTeamId());
            jo.put("teamName", footballTeam.getTeamName());
            jo.put("teamInfo", footballTeam.getTeamInfo());
            jo.put("createTime", sdf.format(footballTeam.getCreateTime()));
            json.add(jo);
        }
        return json.toJSONString();
	}

	@ResponseBody 
	@RequestMapping(value="view/getTeamListJsonByLeagueId", method = RequestMethod.GET)
	public String getTeamListJsonByLeagueId(HttpServletRequest request,Model model){	
		
		List<Integer> leagueTeamIdList = new ArrayList<Integer>();
		if(!"".equals(request.getParameter("leagueId"))){
			int leagueId = Integer.parseInt(request.getParameter("leagueId"));
			List<FootballTeam> footballTeamByLeagueIdList = ftService.selectTeamListByLeagueId(leagueId);

@Controller
public class RoleController {
	
	@Resource
	private ISystemRoleService srService;
	
	@RequestMapping("view/role")
	public ModelAndView toRole(Model model){
		ModelAndView mav = new ModelAndView("view/system_role");
		return mav;
	}

	@ResponseBody 
	@RequestMapping(value="view/getRoleListJson", method = RequestMethod.GET)
	public String getRoleListJson(Model model){		
		List<SystemRole> systemModuleList =  srService.selectSystemRoleList();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		JSONArray json = new JSONArray();
        for(SystemRole systemRole : systemModuleList){ 	
            JSONObject jo = new JSONObject();
            jo.put("roleId", systemRole.getRoleId());
            jo.put("roleName", systemRole.getRoleName());
            jo.put("roleInfo", systemRole.getRoleInfo());
            jo.put("isEnable", systemRole.getIsEnable());
            jo.put("createTime", sdf.format(systemRole.getCreateTime()));
            json.add(jo);
        }
        return json.toJSONString();
	}
	

	@ResponseBody 
	@RequestMapping(value="view/saveRole", method = RequestMethod.POST)
	public ModelAndView saveRole(@RequestBody SystemRole systemRole){
		//System.out.println("接收到提交的保存角色的信息!" + systemRole.getRoleId());
	}
	

}

@Controller
public class TeamLeagueController {
	
	@Resource
	private IFootballTeamLeagueService ftlService = null;
	

	@RequestMapping("view/showscore")
	public ModelAndView toShowScore(Model model){
		ModelAndView mav = new ModelAndView("view/football_showscore");
		return mav;
	}

	@RequestMapping("view/score")
	public ModelAndView toScore(Model model){
		ModelAndView mav = new ModelAndView("view/football_score");
		return mav;
	}
	
	@ResponseBody 
	@RequestMapping(value="view/saveLeagueTeamList", method = RequestMethod.POST)
	public String saveLeagueTeamList(@RequestBody List<FootballTeamLeague> footballTeamLeagueList){
		
		ftlService.deleteByLeagueId(footballTeamLeagueList.get(0).getLeagueId());
		
		for(FootballTeamLeague footballTeamLeague: footballTeamLeagueList){
			ftlService.insertSelective(footballTeamLeague);
		}
		
		for(FootballTeamLeague footballTeamLeague: footballTeamLeagueList){
			ftlService.insertSelective(footballTeamLeague);
		}
		return "true";
	}
	

	@ResponseBody 
	@RequestMapping(value="view/getTeamLeagueListJson", method = RequestMethod.GET)
	public List<FootballTeamLeague> getTeamLeagueListJson(Model model){
		
		List<FootballTeamLeague> footballTeamLeagueList =  ftlService.selectFootballTeamLeagueList();		
        return footballTeamLeagueList;
	}
	

	@ResponseBody 
	@RequestMapping(value="view/saveScore", method = RequestMethod.POST)
	public String saveScore(@RequestBody FootballTeamLeague footballTeamLeague){
		ftlService.updateByPrimaryKeySelective(footballTeamLeague);
		return "true";
		
	}
	
}

@Controller
public class RoleModuleController {
	
	@Resource
	private ISystemRoleModuleService smrService = null;

	@ResponseBody 
	@RequestMapping(value="view/saveRoleModule", method = RequestMethod.POST)
	public ModelAndView saveRoleModule(@RequestBody List<SystemRoleModuleKey> systemRoleModuleKeyList){
	 * @param model
	 * @return
	 */
	@ResponseBody 
	@RequestMapping(value="view/getModuleListJsonByRoleId", method = RequestMethod.GET)
	public String getModuleListJsonByRoleId(HttpServletRequest request,Model model){	
		
		List<Integer> roleModuleIdList = new ArrayList<Integer>();
		if(!"".equals(request.getParameter("roleId"))){
			int roleId = Integer.parseInt(request.getParameter("roleId"));
			List<SystemModule> systemRoleIdModuleList = smService.selectSystemModuleListByRoleId(roleId);
						
			for(SystemModule systemModule : systemRoleIdModuleList){
				roleModuleIdList.add(systemModule.getModuleId());
			}
		}		
		List<SystemModule> systemModuleList = smService.selectSystemModuleList();		
		
		JSONArray json = new JSONArray();
        for(SystemModule systemModule : systemModuleList){
        	SystemModule pModule = null;
        	String pName = "根节点";
        	if(systemModule.getParentId() != 1){
        		pModule = smService.selectByPrimaryKey(systemModule.getParentId());
        		pName = pModule.getModuleName();
        	}        	
            JSONObject jo = new JSONObject();
            jo.put("id", systemModule.getModuleId());
            jo.put("pId", systemModule.getParentId());
            jo.put("name", systemModule.getModuleName());
            jo.put("curUrl", systemModule.getModuleUrl());
            jo.put("isEnable", systemModule.getIsEnable());
            jo.put("pName", pName);
            jo.put("open", true);
            if(roleModuleIdList.contains(systemModule.getModuleId())){
            	jo.put("checked", true);
            }
            json.add(jo);
        }
        return json.toJSONString();
	}
	
	@ResponseBody 
	@RequestMapping(value="view/saveModule", method = RequestMethod.POST)
	public ModelAndView saveModule(@RequestBody SystemModule systemModule){
		
		smService.updateByPrimaryKey(systemModule);
		return "view/login";
	}
	
	@ResponseBody 
	@RequestMapping("view/loginUser")
	public String loginUser(HttpServletRequest request,@RequestBody SystemUser systemUser){
		
		SystemUser curSystemUser = suService.selectByNameAndPassword(systemUser);
		
		if(curSystemUser!= null){
			HttpSession session = request.getSession();
			session.setMaxInactiveInterval(3600);
			session.setAttribute("user", curSystemUser);
			return "true";
		}else{
			return "false";
		}
		
	}
	

	@ResponseBody 
	@RequestMapping("view/selectUserName")
	public String selectUserName(HttpServletRequest request,@RequestBody SystemUser systemUser){
		
		SystemUser curSystemUser = suService.selectUserByUserName(systemUser.getUserName());
		
		if(curSystemUser!= null){
			return "true";
		}else{
			return "false";
		}
		
	}
	

	@ResponseBody 
	@RequestMapping("view/signUser")
	public String signUser(HttpServletRequest request,@RequestBody SystemUser systemUser){
		
		if(systemUser != null){
			systemUser.setRoleId(14);
			suService.insertSelective(systemUser);			
			HttpSession session = request.getSession();
			session.setMaxInactiveInterval(3600);
			session.setAttribute("user", systemUser);
			return "true";
		}else{
			return "false";
		}
		
	}
	
            jo.put("id", systemModule.getModuleId());
            jo.put("pId", systemModule.getParentId());
            jo.put("name", systemModule.getModuleName());
            jo.put("curUrl", systemModule.getModuleUrl());
            jo.put("isEnable", systemModule.getIsEnable());
            jo.put("pName", pName);
            jo.put("open", true);
            if(roleModuleIdList.contains(systemModule.getModuleId())){
            	jo.put("checked", true);
            }
            json.add(jo);
        }
        return json.toJSONString();
	}
	
	@ResponseBody 
	@RequestMapping(value="view/saveModule", method = RequestMethod.POST)
	public ModelAndView saveModule(@RequestBody SystemModule systemModule){
		
		smService.updateByPrimaryKey(systemModule);
		ModelAndView mav = new ModelAndView("view/system_module");
		return mav;
		
	}

}

@Controller
public class TeamController {

	@Resource
	@RequestMapping(value="view/deleteUser", method = RequestMethod.POST)
	public ModelAndView deleteUser(@RequestBody SystemUser systemUser){
		
		suService.updateByPrimaryKeySelective(systemUser);
		ModelAndView mav = new ModelAndView("view/system_user");
		return mav;
		
	}

}

@Controller
public class LeagueController {
	
	@Resource
	private IFootballLeagueService flService;
	
	@RequestMapping("view/league")
	public ModelAndView toModule(Model model){
		ModelAndView mav = new ModelAndView("view/football_league");
		ModelAndView mav = new ModelAndView("view/football_game");
		return mav;
	}
	

	@RequestMapping("view/showgame")
	public ModelAndView toShowFootballGame(HttpServletRequest request,Model model){
		ModelAndView mav = new ModelAndView("view/football_showgame");
		return mav;
	}
	

	@ResponseBody 
	@RequestMapping(value="view/getGameListJson", method = RequestMethod.GET)
	public String getGameListJson(Model model){		
		List<FootballGame> footballGameList =  fgService.selectFootballGameList();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		JSONArray json = new JSONArray();
        for(FootballGame footballGame : footballGameList){ 	
            JSONObject jo = new JSONObject();
            jo.put("gameId", footballGame.getGameId());
            jo.put("gameTeamIdFirst", footballGame.getGameTeamIdFirst());
            jo.put("gameTeamNameFirst", footballGame.getGameTeamNameFirst());
            jo.put("gameTeamIdSecond", footballGame.getGameTeamIdSecond());
            jo.put("gameTeamNameSecond", footballGame.getGameTeamNameSecond());
            jo.put("firstScore", footballGame.getFirstScore());
            jo.put("secondScore", footballGame.getSecondScore());
            jo.put("gameStartDate", sdf.format(footballGame.getGameStartDate()));
            jo.put("createTime", sdf.format(footballGame.getCreateTime()));
            json.add(jo);
        }
        return json.toJSONString();
	}
	

	@ResponseBody 
	@RequestMapping(value="view/saveGame", method = RequestMethod.POST)
	public String saveGame(@RequestBody FootballGame footballGame){
		if(footballGame.getGameId() == null || "".equals(footballGame.getGameId())){
			fgService.insertSelective(footballGame);

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 11
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

java毕业

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值