Java项目:123SSM高校运动会信息管理系统

news2025/4/8 23:04:50

博主主页:Java旅途
简介:分享计算机知识、学习路线、系统源码及教程
文末获取源码

一、项目介绍

高校运动会信息管理系统基于Spring+SpringMVC+Mybatis开发,主要用来管理高校运动会信息,系统分为管理员何运动员两种角色。系统主要功能如下:

管理员:

  • 比赛项目管理
  • 比赛成绩管理
  • 院系人员管理
  • 运动会开幕管理
  • 广播管理
  • 器材管理
  • 系统管理

运动员:

  • 项目查看
  • 我的参数
  • 退赛
  • 参赛成绩

二、技术框架

  • 后端:Spring,Springmvc,Mybatis
  • 前端:bootstrap,jquery

三、安装教程

  1. 用idea打开项目
  2. 在idea中配置jdk环境
  3. 配置maven环境并下载依赖
  4. 配置Tomcat8.0
  5. 新建数据库,导入数据库文件
  6. dbconfig.properties文件中将数据库账号密码改成自己本地的
  7. 启动运行, 管理员账号密码 admin/123456,远动员账号密码:201624131201/123456

四、项目截图

image-20230720163703194

image-20230720164308889

image-20230720164822290

image-20230720164841778

五、相关代码

EventController

package com.handy.controller;

import com.handy.domain.Event;
import com.handy.domain.Matches;
import com.handy.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/event")
public class EventController {
    @Autowired
    private EventService eventService;

    /**
     * 查询所有项目信息
     *
     * @return
     */
    @RequestMapping("/findAll.do")
    public ModelAndView findAll() {
        ModelAndView mv = new ModelAndView();
        List<Event> eventList = eventService.findAll();
        mv.addObject("event", eventList);
        mv.setViewName("event-list");
        return mv;
    }


    /**
     * 查询项目详细信息
     *
     * @param eId
     * @return
     */
    @RequestMapping("/findDetailsByeId.do")
    public ModelAndView findDetailsByeId(Integer eId) {
        ModelAndView mv = new ModelAndView();
        Map<String, Object> map = eventService.findDetailsByeId(eId);
        Event event = (Event) map.get("event");
        List<Matches> matchesList = (List<Matches>) map.get("matchesList");
        mv.addObject("matchesList", matchesList);
        mv.addObject("event", event);
        mv.setViewName("event-details");
        return mv;
    }

    /**
     * 项目详细信息和该项目下参赛情况
     *
     * @param eId
     * @return
     */
    @RequestMapping("/manageFindDetailsByeId.do")
    public ModelAndView manageFindDetailsBysId(Integer eId) {
        ModelAndView mv = new ModelAndView();
        Map<String, Object> map = eventService.findDetailsByeId(eId);
        Event event = (Event) map.get("event");
        List<Matches> matchesList = (List<Matches>) map.get("matchesList");
        mv.addObject("matchesList", matchesList);
        mv.addObject("event", event);
        mv.setViewName("event-manage-details");
        return mv;
    }

    /**
     * 成绩录入
     *
     * @param eId
     * @return
     */
    @RequestMapping("/matchesInput.do")
    public ModelAndView matchesInput(Integer eId) {
        ModelAndView mv = new ModelAndView();
        Map<String, Object> map = eventService.findDetailsByeId(eId);
        Event event = (Event) map.get("event");
        List<Matches> matchesList = (List<Matches>) map.get("matchesList2");
        mv.addObject("matchesList", matchesList);
        mv.addObject("event", event);
        mv.setViewName("matches-manage-input");
        return mv;
    }

    /**
     * 学生参赛项目列表
     *
     * @param uId
     * @return
     */
    @RequestMapping("/participateEvent.do")
    public ModelAndView participateEvent(String uId) {
        ModelAndView mv = new ModelAndView();
        List<Event> eventList = eventService.findNewAll(uId);
        mv.addObject("event", eventList);
        mv.setViewName("participateEvent-list");
        return mv;
    }

    /**
     * 参加比赛
     *
     * @param eId
     * @param No
     */
    @RequestMapping("/participate.do")
    public void participate(Integer eId, String No) {
        eventService.participate(eId, No);
    }

    /**
     * 项目管理页面
     *
     * @return
     */
    @RequestMapping("/manage.do")
    public ModelAndView manage() {
        ModelAndView mv = new ModelAndView();
        List<Event> eventList = eventService.findAll();
        mv.addObject("event", eventList);
        mv.setViewName("event-manage");
        return mv;
    }

    /**
     * 项目录入
     *
     * @param event
     * @return
     */
    @RequestMapping(value = "/insert.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String insert(@RequestBody Event event) {
        try {
            eventService.insert(event);
        } catch (Exception e) {
            return "新增失败!";
        }
        return "200";
    }

    /**
     * 项目修改
     *
     * @param event
     * @return
     */
    @RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String update(@RequestBody Event event) {
        try {
            eventService.update(event);
        } catch (Exception e) {
            return "修改失败!";
        }
        return "200";
    }

    /**
     * 根据id获取项目信息到模态框
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/findById.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    @ResponseBody
    public Event findById(@RequestParam(name = "id") Integer id) {
        return eventService.findById(id);
    }

    /**
     * 删除项目
     *
     * @param id
     * @return
     */
    @RequestMapping("/deleteById.do")
    public String deleteByIds(Integer[] id) {
        eventService.deleteById(id);
        return "redirect:manage.do";
    }

    /**
     * 将该项目下的参赛人员进行成绩排名
     *
     * @param id
     */
    @RequestMapping(value = "/rank.do")
    public void rank(Integer id) {
        eventService.rank(id);
    }

    /**
     * 随机分道
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/random.do")
    public String random(Integer id) {
        try {
            eventService.random(id);
        } catch (Exception e) {
            return "生成失败!";
        }
        return "200";
    }

}

SportmeetingController

package com.handy.controller;

import com.handy.domain.Broadcast;
import com.handy.domain.Event;
import com.handy.domain.Matches;
import com.handy.domain.Sportmeeting;
import com.handy.service.SportmeetingService;
import com.handy.utils.Excel.ExcelExportUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/sportmeeting")
public class SportmeetingController {

    @Autowired
    private SportmeetingService sportmeetingService;

    /**
     * 查询所有运动会开幕信息
     *
     * @return
     */
    @RequestMapping("/findAll.do")
    public ModelAndView findAll() {
        ModelAndView mv = new ModelAndView();
        List<Sportmeeting> sportmeetingList = sportmeetingService.findAll();
        mv.addObject("sportmeeting", sportmeetingList);
        mv.setViewName("sportmeeting-list");
        return mv;
    }

    /**
     * 删除运动会信息
     *
     * @param sId
     * @return
     */
    @RequestMapping("/deleteByPK.do")
    public void deleteByIds(Integer[] sId) {
        sportmeetingService.deleteByPK(sId);
    }

    /**
     * 查询运动会详细信息
     *
     * @param sId
     * @return
     */
    @RequestMapping("/findDetailsBysId.do")
    public ModelAndView findDetailsBysId(Integer sId) {
        ModelAndView mv = new ModelAndView();
        Map<String, Object> map = sportmeetingService.findDetailsBysId(sId);
        Sportmeeting sportmeeting = (Sportmeeting) map.get("sportmeeting");
        List<Broadcast> broadcastList = (List<Broadcast>) map.get("broadcastList");
        List<Event> eventList = (List<Event>) map.get("eventList");
        List<Matches> matchesList = (List<Matches>) map.get("matchesList");
        mv.addObject("event", eventList);
        mv.addObject("matches", matchesList);
        mv.addObject("broadcast", broadcastList);
        mv.addObject("sportmeeting", sportmeeting);
        mv.setViewName("sportmeeting-details");
        return mv;
    }

    /**
     * 根据id查询项目
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/findBysId.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    @ResponseBody
    public Sportmeeting findProjectById(@RequestParam(name = "id") Integer id) {
        return sportmeetingService.findBysId(id);
    }


    /**
     * 新建一场运动会
     *
     * @param sportmeeting
     * @return
     */
    @RequestMapping(value = "/insert.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String insert(@RequestBody Sportmeeting sportmeeting) {
        try {
            sportmeetingService.insert(sportmeeting);
        } catch (Exception e) {
            return "新增失败!";
        }
        return "200";
    }

    /**
     * 修改运动会开幕信息
     *
     * @param sportmeeting
     * @return
     */
    @RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String update(@RequestBody Sportmeeting sportmeeting) {
        System.out.println(sportmeeting);
        try {
            sportmeetingService.update(sportmeeting);
        } catch (Exception e) {
            return "修改失败!";
        }
        return "200";
    }

    /**
     * 运动会开幕信息管理页面
     *
     * @return
     */
    @RequestMapping("/manage.do")
    public ModelAndView add() {
        ModelAndView mv = new ModelAndView();
        List<Sportmeeting> sportmeetingList = sportmeetingService.findAll();
        mv.addObject("sportmeeting", sportmeetingList);
        mv.setViewName("sportmeeting-manage");
        return mv;
    }

    /**
     * 运动会开幕信息导出
     *
     * @param response
     * @throws Exception
     */
    @RequestMapping("/export.do")
    public void exportExcelStyle(HttpServletResponse response) throws Exception {
        List<Sportmeeting> sportmeetings = sportmeetingService.exportExcel();
        ExcelExportUtil excelExportUtil = new ExcelExportUtil();
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("classFilePath", "/excel/template.xlsx");
        params.put("styleIndex", 2);
        params.put("rowIndex", 2);
        params.put("objs", sportmeetings);
        params.put("fileName", "s.xlsx");
        excelExportUtil.export(response, params);
    }

    /**
     * 修改运动会的状态
     *
     * @param Id
     * @param Status
     * @return
     */
    @RequestMapping("updateStatus.do")
    public String updateStatus(Integer Id, Boolean Status) {
        sportmeetingService.updateStatus(Id, Status);
        return "redirect:manage.do";
    }

    /**
     * 本届运动会的信息管理
     *
     * @param sId
     * @return
     */
    @RequestMapping("/manageFindDetailsBysId.do")
    public ModelAndView manageFindDetailsBysId(Integer sId) {
        ModelAndView mv = new ModelAndView();
        Map<String, Object> map = sportmeetingService.findDetailsBysId(sId);
        Sportmeeting sportmeeting = (Sportmeeting) map.get("sportmeeting");
        List<Broadcast> broadcastList = (List<Broadcast>) map.get("broadcastList");
        List<Event> eventList = (List<Event>) map.get("eventList");
        List<Matches> matchesList = (List<Matches>) map.get("matchesList");
        mv.addObject("event", eventList);
        mv.addObject("matches", matchesList);
        mv.addObject("broadcast", broadcastList);
        mv.addObject("sportmeeting", sportmeeting);
        mv.setViewName("sportmeeting-manage-details");
        return mv;
    }

    /**
     * 遍历所有运动会到选择框上
     *
     * @return
     */
    @RequestMapping(value = "/findAllSportmeetings.do", produces = "application/json; charset=utf-8")
    @ResponseBody
    public List<Sportmeeting> findAllSportmeetings() {
        return sportmeetingService.findAllSportmeetings();
    }

}

大家点赞、收藏、关注、评论啦 、👇🏻点开下方卡片👇🏻关注后回复 105

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1392114.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

AI在广告中的应用——预测性定位和调整

营销人员的工作就是在恰当的时间将适合的产品呈现在消费者面前&#xff0c;从而增加他们购买的可能性。随着时间的推移&#xff0c;营销人员能够深入挖掘越来越精准的客户细分市场&#xff0c;他们不仅具备了实现上述目标的能力&#xff0c;而且这种能力还在呈指数级提升。在AI…

如何将github copilot当gpt4用

现在写代码已经离不开ai辅助了我用的是github copilot&#xff0c;一方面是因为它和vscode结合得比较好&#xff0c;另一方面就是copilot chat了。可以在不切换工具的情况下&#xff0c;问它问题&#xff0c;在copilot chat还在内测阶段的时候我就申请使用了&#xff08;现在已…

【现代密码学】笔记9-10.3-- 公钥(非对称加密)、混合加密理论《introduction to modern cryphtography》

【现代密码学】笔记9-10.3-- 公钥&#xff08;非对称加密&#xff09;、混合加密理论《introduction to modern cryphtography》 写在最前面8.1 公钥加密理论随机预言机模型&#xff08;Random Oracle Model&#xff0c;ROM&#xff09; 写在最前面 主要在 哈工大密码学课程 张…

Python多线程爬虫——数据分析项目实现详解

前言 「作者主页」&#xff1a;雪碧有白泡泡 「个人网站」&#xff1a;雪碧的个人网站 ChatGPT体验地址 文章目录 前言爬虫获取cookie网站爬取与启动CSDN爬虫爬虫启动将爬取内容存到文件中 多线程爬虫选择要爬取的用户 线程池 爬虫 爬虫是指一种自动化程序&#xff0c;能够模…

Java基础知识整理,驼峰规则、流程控制、自增自减

写在开头 本文接着上一篇文章续写哈。Java基础知识整理&#xff0c;注释、关键字、运算符 在这一篇文章中我们总结了包括注释、关键字、运算符的Java基础知识点&#xff0c;今天继续来聊一聊命名规则&#xff08;驼峰&#xff09;、流程控制、自增自减。 一、命名规则 上一…

pygame学习(三)——支持多种类型的事件

大家好&#xff01;我是码银&#x1f970; 欢迎关注&#x1f970;&#xff1a; CSDN&#xff1a;码银 公众号&#xff1a;码银学编程 实时事件循环 为了保证程序的持续刷新、保持打开的状态&#xff0c;我们会创建一个无限循环&#xff0c;通常使用的是while语句&#xff0c;w…

第二百六十九回

文章目录 概念介绍设置方法示例代码内容总结 我们在上一章回中介绍了Card Widget相关的内容&#xff0c;本章回中将介绍国际化设置.闲话休提&#xff0c;让我们一起Talk Flutter吧。 概念介绍 我们在这里说的国际化设置是指在App设置相关操作&#xff0c;这样可以让不同国家的…

关于VScode的这个ssh的配置的经验

1.首先&#xff0c;我是因为重装了ubantu系统&#xff0c;不得不重新配置ssh 2.第一步&#xff0c;在本机的终端安装ssh插件&#xff1a; &#xff08;1&#xff09; &#xff08;2&#xff09;restart开启这个ssh端口 3.然后&#xff0c;就在vscode里面&#xff0c;安装哪个…

【Rust学习】安装Rust环境

本笔记为了记录学习Rust过程&#xff0c;内容如有错误请大佬指教 使用IDE&#xff1a;vs code 参考教程&#xff1a;菜鸟教程链接: 菜鸟教程链接: Rust学习 Rust入门安装Rust编译环境Rust 编译工具 构建Rust 工程目录 Rust入门 安装Rust编译环境 因为我已经安装过VSCode了&am…

【ArcGIS遇上Python】ArcGIS Python批量筛选多个shp中指定字段值的图斑(以土地利用数据为例)

文章目录 一、案例分析二、提取效果二、代码运行效果三、Python代码四、数据及代码下载一、案例分析 以土地利用数据为例,提取多个shp数据中的旱地。 二、提取效果 原始土地利用数据: 属性表: 提取的旱地:(以图层名称+地类名称命名)

mysql — 生产环境发布DDL之避坑操作onlineDDL

一、Mysql onLineDDL特性 1、Mysql 5.6 DDL MySQL 的 DDL(Data Definition Language) 包括增减字段、增减索引等操作。MySQL Online DDL 功能从 5.6 版本开始正式引入&#xff0c;发展到现在的 8.0 版本&#xff0c;那么在 MySQL 5.6 之前&#xff0c;MySQL 的 DDL 操作会按照…

Vue高级(二)

3.搭建vuex环境 创建文件&#xff1a;src/store/index.js //引入Vue核心库import Vue from vue//引入Vueximport Vuex from vuex//应用Vuex插件Vue.use(Vuex)//准备actions对象——响应组件中用户的动作const actions {}//准备mutations对象——修改state中的数据const mutat…

近4w字吐血整理!只要你认真看完【C++编程核心知识】分分钟吊打面试官(包含:内存、函数、引用、类与对象、文件操作)

&#x1f308;个人主页&#xff1a;godspeed_lucip &#x1f525; 系列专栏&#xff1a;C从基础到进阶 &#x1f3c6;&#x1f3c6;关注博主&#xff0c;随时获取更多关于C的优质内容&#xff01;&#x1f3c6;&#x1f3c6; C核心编程&#x1f30f;1 内存分区模型&#x1f384…

mac查看maven版本报错:The JAVA_HOME environment variable is not defined correctly

终端输入mvn -version报错: The JAVA_HOME environment variable is not defined correctly, this environment variable is needed to run this program. Java环境变量的问题,打开bash_profile查看 open ~/.bash_profile export JAVA_8_HOME/Library/Java/JavaVirtualMachine…

HCIA——12题目-1章选择

学习目标&#xff1a; 计算机网络 1.掌握计算机网络的基本概念、基本原理和基本方法。 2.掌握计算机网络的体系结构和典型网络协议&#xff0c;了解典型网络设备的组成和特点&#xff0c;理解典型网络设备的工作原理。 3.能够运用计算机网络的基本概念、基本原理和基本方法进行…

GaussDB(DWS)查询优化技术大揭秘

GaussDB(DWS)查询优化技术大揭秘 大数据时代&#xff0c;数据量呈爆发式增长&#xff0c;经常面临百亿、千亿数据查询场景&#xff0c;当数据仓库数据量较大、SQL语句执行效率低时&#xff0c;数据仓库性能会受到影响。本文将深入讲解在GaussDB(DWS)中如何进行表结构设计&#…

解密IP代理池:匿名访问与反爬虫的利器

当今互联网环境中&#xff0c;为了应对反爬虫、匿名访问或绕过某些地域限制等需求&#xff0c;IP代理池成为了一种常用的解决方案。IP代理池是一个包含多个可用代理IP地址的集合&#xff0c;可以通过该代理池随机选择可用IP地址来进行网络请求。 IP代理池是一组可用的代理IP地址…

实验八 排序算法的实现与分析

实验八 排序算法的实现与分析 一&#xff0e;实验目的 1.掌握常用的排序方法&#xff0c;并掌握用高级语言实现排序算法的方法&#xff1b; 2.深刻理解排序的定义和各种排序方法的特点&#xff0c;并能加以灵活应用&#xff1b; 3.了解各种方法的排序过程及其时间复杂度的分析方…

10- OpenCV:基本阈值操作(Threshold)

目录 1、图像阈值 2、阈值类型 3、代码演示 1、图像阈值 &#xff08;1&#xff09;图像阈值&#xff08;threshold&#xff09;含义&#xff1a;是将图像中的像素值划分为不同类别的一种处理方法。通过设定一个特定的阈值&#xff0c;将像素值与阈值进行比较&#xff0c;根…

单片机I/O口驱动MOS管

自记录&#xff1a; 看完本章&#xff0c;串起来看&#xff0c;看mos驱动电路这篇&#xff1a;MOS管驱动电流计算以及分立器件驱动电路-CSDN博客 使用单片机做一个PLC,输出可如下两种情况&#xff1a; 单片机I/O口驱动&#xff0c;为什么一般都选用三极管而不是MOS管&#xf…