——————————DescriptionStart——————————
运行环境
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项目:是;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jQuery+bootstrap+layui
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入 http://localhost:8080/
——————————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
| } @RequestMapping("view/index") public String toIndex(HttpServletRequest request,Model model){ HttpSession session = request.getSession(); if(session == null){ return "view/login"; }else{ SystemUser systemUser = (SystemUser)session.getAttribute("user"); if(systemUser == null){ return "view/login"; } else{ int roleId = systemUser.getRoleId(); request.setAttribute("moduleList", smService.selectSystemModuleListByRoleId(roleId)); return "view/index"; } } }
} package com.web.controller.football;
@Controller public class TeamLeagueController {
|
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
| jo.put("dictInfo", systemDict.getDictInfo()); json.add(jo); } return json.toJSONString(); }
@ResponseBody @RequestMapping(value="view/saveDict", method = RequestMethod.POST) public ModelAndView saveDict(@RequestBody SystemDict systemDict){ if(systemDict.getDictId() == null){ sdService.insert(systemDict); }else{ sdService.updateByPrimaryKeySelective(systemDict); } ModelAndView mav = new ModelAndView("view/system_dict"); return mav; }
@ResponseBody @RequestMapping(value="view/deleteDict", method = RequestMethod.POST) public ModelAndView deleteDict(@RequestBody SystemDict systemDict){ sdService.deleteByPrimaryKey(systemDict.getDictId()); ModelAndView mav = new ModelAndView("view/system_dict"); return mav; }
} package com.web.controller.football;
|
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
| 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; }
} package com.web.controller.football;
@Controller public class TeamController {
@Resource private IFootballTeamService ftService = null;
|
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
|
@Controller public class UserController { @Resource private ISystemUserService suService = null; @Resource private ISystemRoleService srService = null;
@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());
|
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
|
@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(); }
|
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 42 43 44 45
|
@Controller
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){ SystemUser curSystemUser = suService.selectUserByUserName(systemUser.getUserName()); if(curSystemUser!= null){ return "true"; }else{ return "false";
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=221122582008200vg
https://javayms.pages.dev?id=221122582008200vg