• SSM足球联赛管理系统


    作者主页:夜未央5788

     简介:Java领域优质创作者、Java项目、学习资料、技术互助

    文末获取源码

    项目介绍

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

    管理员角色包含以下功能:

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

    用户角色包含以下功能:

    用户登录与注册,联赛积分榜查询,球队战绩查询,比赛结果查询等功能。

    环境需要

    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/

    运行截图

    管理员角色

     

     

     

    用户角色 

     

     

     

     

     相关代码

    GameController

    1. @Controller
    2. public class GameController {
    3. @Resource
    4. private IFootballGameService fgService = null;
    5. @Resource
    6. private IFootballTeamService ftService = null;
    7. @RequestMapping("view/game")
    8. public ModelAndView toFootballGame(HttpServletRequest request,Model model){
    9. request.setAttribute("teamList", ftService.selectFootballTeamList());
    10. ModelAndView mav = new ModelAndView("view/football_game");
    11. return mav;
    12. }
    13. @RequestMapping("view/showgame")
    14. public ModelAndView toShowFootballGame(HttpServletRequest request,Model model){
    15. ModelAndView mav = new ModelAndView("view/football_showgame");
    16. return mav;
    17. }
    18. @ResponseBody
    19. @RequestMapping(value="view/getGameListJson", method = RequestMethod.GET)
    20. public String getGameListJson(Model model){
    21. List<FootballGame> footballGameList = fgService.selectFootballGameList();
    22. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    23. JSONArray json = new JSONArray();
    24. for(FootballGame footballGame : footballGameList){
    25. JSONObject jo = new JSONObject();
    26. jo.put("gameId", footballGame.getGameId());
    27. jo.put("gameTeamIdFirst", footballGame.getGameTeamIdFirst());
    28. jo.put("gameTeamNameFirst", footballGame.getGameTeamNameFirst());
    29. jo.put("gameTeamIdSecond", footballGame.getGameTeamIdSecond());
    30. jo.put("gameTeamNameSecond", footballGame.getGameTeamNameSecond());
    31. jo.put("firstScore", footballGame.getFirstScore());
    32. jo.put("secondScore", footballGame.getSecondScore());
    33. jo.put("gameStartDate", sdf.format(footballGame.getGameStartDate()));
    34. jo.put("createTime", sdf.format(footballGame.getCreateTime()));
    35. json.add(jo);
    36. }
    37. return json.toJSONString();
    38. }
    39. @ResponseBody
    40. @RequestMapping(value="view/saveGame", method = RequestMethod.POST)
    41. public String saveGame(@RequestBody FootballGame footballGame){
    42. if(footballGame.getGameId() == null || "".equals(footballGame.getGameId())){
    43. fgService.insertSelective(footballGame);
    44. }else{
    45. fgService.updateByPrimaryKeySelective(footballGame);
    46. }
    47. return "true";
    48. }
    49. @ResponseBody
    50. @RequestMapping(value="view/deleteGame", method = RequestMethod.POST)
    51. public String deleteGame(@RequestBody FootballGame footballGame){
    52. fgService.deleteByPrimaryKey(footballGame.getGameId());
    53. return "true";
    54. }
    55. }

    TeamController

    1. @Controller
    2. public class TeamController {
    3. @Resource
    4. private IFootballTeamService ftService = null;
    5. @RequestMapping("view/team")
    6. public ModelAndView toModule(Model model){
    7. ModelAndView mav = new ModelAndView("view/football_team");
    8. return mav;
    9. }
    10. @ResponseBody
    11. @RequestMapping(value="view/getTeamListJson", method = RequestMethod.GET)
    12. public String getTeamListJson(Model model){
    13. List<FootballTeam> footballLeagueList = ftService.selectFootballTeamList();
    14. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    15. JSONArray json = new JSONArray();
    16. for(FootballTeam footballTeam : footballLeagueList){
    17. JSONObject jo = new JSONObject();
    18. jo.put("teamId", footballTeam.getTeamId());
    19. jo.put("teamName", footballTeam.getTeamName());
    20. jo.put("teamInfo", footballTeam.getTeamInfo());
    21. jo.put("createTime", sdf.format(footballTeam.getCreateTime()));
    22. json.add(jo);
    23. }
    24. return json.toJSONString();
    25. }
    26. @ResponseBody
    27. @RequestMapping(value="view/getTeamListJsonByLeagueId", method = RequestMethod.GET)
    28. public String getTeamListJsonByLeagueId(HttpServletRequest request,Model model){
    29. List<Integer> leagueTeamIdList = new ArrayList<Integer>();
    30. if(!"".equals(request.getParameter("leagueId"))){
    31. int leagueId = Integer.parseInt(request.getParameter("leagueId"));
    32. List<FootballTeam> footballTeamByLeagueIdList = ftService.selectTeamListByLeagueId(leagueId);
    33. for(FootballTeam footballTeam : footballTeamByLeagueIdList){
    34. leagueTeamIdList.add(footballTeam.getTeamId());
    35. }
    36. }
    37. List<FootballTeam> footballTeamList = ftService.selectFootballTeamList();
    38. JSONArray json = new JSONArray();
    39. for(FootballTeam footballTeam : footballTeamList){
    40. JSONObject jo = new JSONObject();
    41. jo.put("id", footballTeam.getTeamId());
    42. jo.put("pId", "0");
    43. jo.put("name", footballTeam.getTeamName());
    44. jo.put("open", true);
    45. if(leagueTeamIdList.contains(footballTeam.getTeamId())){
    46. jo.put("checked", true);
    47. }
    48. json.add(jo);
    49. }
    50. return json.toJSONString();
    51. }
    52. @ResponseBody
    53. @RequestMapping(value="view/saveTeam", method = RequestMethod.POST)
    54. public String saveLeague(@RequestBody FootballTeam footballTeam){
    55. if(footballTeam.getTeamId() == null || "".equals(footballTeam.getTeamId())){
    56. ftService.insertSelective(footballTeam);
    57. }else{
    58. ftService.updateByPrimaryKeySelective(footballTeam);
    59. }
    60. return "true";
    61. }
    62. @ResponseBody
    63. @RequestMapping(value="view/deleteTeam", method = RequestMethod.POST)
    64. public String deleteTeam(@RequestBody FootballTeam footballTeam){
    65. ftService.deleteByPrimaryKey(footballTeam.getTeamId());
    66. return "true";
    67. }
    68. }

    如果也想学习本系统,下面领取。回复:202ssm

  • 相关阅读:
    苹果图片heic格式怎么转化成jpg?两种方法解决它
    对于L1正则化和L2正则化的理解
    ubuntod安装datasophon问题记录
    ubuntu20.04中安装mysql8.0步骤
    数据库习题
    ik分词器
    C++ 练气期之一文看懂字符串
    linux中的tar打包、压缩多个文件、磁盘查看和分区类、du查看文件和目录占用的磁盘空间
    Leetcode - 112双周赛
    Ps:RGB 直方图
  • 原文地址:https://blog.csdn.net/hanyunlong1989/article/details/125457505