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

博主主页: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

四、项目截图

Java项目:123SSM高校运动会信息管理系统_第1张图片

Java项目:123SSM高校运动会信息管理系统_第2张图片

Java项目:123SSM高校运动会信息管理系统_第3张图片

五、相关代码

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

你可能感兴趣的:(毕设源码,java,开发语言,毕业设计,课程设计,spring,boot)