基于SSM框架的体育比赛管理系统源码和论文

摘要

【539】基于SSM框架的体育比赛管理系统源码和论文

伴随网络技术的发展,高校学生规模的迅速增长,运动会举办的规模也在逐 渐扩大。运动会的传统管理方式对各类数据进行报送处理,数据处理统计的过程, 容易出现效率低的状况,管理过程中越来越费时费力,并且很容易出错。在繁琐、 低下的效率背景下,有必要通过计算机辅助运动会管理,以全新模式设计与实现 基于B/S结构的运动会管理系统。

首先,分析当前运动会管理的现状,提出需要设计与实现一套基于B/S结构 的运动会管理系统。分析当前国内对运动会管理系统的发展现状,总结当前系统 存在的不足之处。然后,对运动会管理需求进行划分。技术路线方面,系统开发 语言选用J2EE编程,设计模式是MVC模式,通过SSM的框架整合技术来设计与实现。运动会管理系统系统主要分为jsp, model,通 过MVC模式进行控制类的转发调用。功能模块通过类图、时序图进行类及 方法的详细设计,完成数据库表ER关系和表结构的设计。最后实现运动会管理的 核心操作,对核心功能进行测试分析。

系统功能上实现了设计与系统模块、参赛模块、成绩模块、开幕模块、信息查询模块和项目选择模块。系统设计与实现后能够为运动会管理者节约财力和人力,减少由于人工处理 产生的错误,进而高效、规范的管理运动会中的各种事务,提高操作效率、管理 质量与管理水平。

关键字:运动会管理;SPRINGMVC;MYSQL;JAVA

                              abstract

With the development of network technology, the scale of college students is growing rapidly, and the scale of the Games is also gradually expanding. The traditional management method of the sports meeting is to submit and process all kinds of data. The process of data processing and statistics is prone to low efficiency. The management process is more and more time-consuming and laborious, and it is easy to make mistakes. Under the background of tedious and low efficiency, it is necessary to design and implement a sports meeting management system based on b/s structure in a new mode through computer-aided sports meeting management.

Firstly, the current situation of sports meeting management is analyzed, and the need to design and implement a sports meeting management system based on b/s structure is proposed. Analyze the current domestic development status of the sports meeting management system, and summarize the shortcomings of the current system. Then, the needs of sports meeting management are divided. In terms of technical route, the system development language is J2EE programming, and the design mode is MVC mode, which is designed and implemented through the framework integration technology of SSM. The sports meeting management system is mainly divided into JSP and model, which forward and call the control class through MVC mode. The function module designs classes and methods in detail through class diagram and sequence diagram, and completes the design of database table Er relationship and table structure. Finally, the core operation of sports meeting management is realized, and the core functions are tested and analyzed.

The function of the system includes design and system module, competition module, score module, opening module, information query module and item selection module. After the design and implementation of the system, it can save money and manpower for the Games managers, reduce the errors caused by manual processing, and then manage various affairs in the Games in an efficient and standardized way, so as to improve the operation efficiency, management quality and management level.

Key words: Games management; SPRINGMVC; MYSQL; JAVA

package com.demo.controller;


import com.alibaba.fastjson.JSONObject;

import com.demo.util.Util;
import com.demo.service.ChengjiService;
import com.demo.vo.Chengji;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping
public class ChengjiController {

    @Autowired
    private ChengjiService chengjiService;

    /**
     * 增加成绩
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("chengjiAdd")
    public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Chengji vo = new Chengji();
        //取出页面传进来的参数
        String chengjiName = Util.decode(request, "chengjiName");
        if (chengjiName != null && !chengjiName.equals("")) {
            vo.setChengjiName(chengjiName);
        }
        String chengjiSex = Util.decode(request, "chengjiSex");
        if (chengjiSex != null && !chengjiSex.equals("")) {
            vo.setChengjiSex(Boolean.valueOf(chengjiSex));
        }
        String chengjiXuehao = Util.decode(request, "chengjiXuehao");
        if (chengjiXuehao != null && !chengjiXuehao.equals("")) {
            vo.setChengjiXuehao(chengjiXuehao);
        }
        String chengjiXiangmu = Util.decode(request, "chengjiXiangmu");
        if (chengjiXiangmu != null && !chengjiXiangmu.equals("")) {
            vo.setChengjiXiangmu(chengjiXiangmu);
        }
        String chengjiDidian = Util.decode(request, "chengjiDidian");
        if (chengjiDidian != null && !chengjiDidian.equals("")) {
            vo.setChengjiDidian(chengjiDidian);
        }
        String chengjiPaiming = Util.decode(request, "chengjiPaiming");
        if (chengjiPaiming != null && !chengjiPaiming.equals("")) {
            vo.setChengjiPaiming(chengjiPaiming);
        }
        String chengjiText = Util.decode(request, "chengjiText");
        if (chengjiText != null && !chengjiText.equals("")) {
            vo.setChengjiText(chengjiText);
        }

        //调用Service层的增加(insert)方法
        chengjiService.insert(vo);
        this.redirectList(request, response);
    }

    /**
     * 删除成绩
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("chengjiDelete")
    public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");
        chengjiService.delete(Arrays.asList(id));
        this.redirectList(request, response);
    }

    /**
     * 编辑成绩
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("chengjiEdit")
    public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Chengji vo = new Chengji();
        String id = Util.decode(request, "id");
        if (id != null && !id.equals("")) {
            vo.setId(Long.valueOf(id));
        }
        String chengjiName = Util.decode(request, "chengjiName");
        if (chengjiName != null && !chengjiName.equals("")) {
            vo.setChengjiName(chengjiName);
        }
        String chengjiSex = Util.decode(request, "chengjiSex");
        if (chengjiSex != null && !chengjiSex.equals("")) {
            vo.setChengjiSex(Boolean.valueOf(chengjiSex));
        }
        String chengjiXuehao = Util.decode(request, "chengjiXuehao");
        if (chengjiXuehao != null && !chengjiXuehao.equals("")) {
            vo.setChengjiXuehao(chengjiXuehao);
        }
        String chengjiXiangmu = Util.decode(request, "chengjiXiangmu");
        if (chengjiXiangmu != null && !chengjiXiangmu.equals("")) {
            vo.setChengjiXiangmu(chengjiXiangmu);
        }
        String chengjiDidian = Util.decode(request, "chengjiDidian");
        if (chengjiDidian != null && !chengjiDidian.equals("")) {
            vo.setChengjiDidian(chengjiDidian);
        }
        String chengjiPaiming = Util.decode(request, "chengjiPaiming");
        if (chengjiPaiming != null && !chengjiPaiming.equals("")) {
            vo.setChengjiPaiming(chengjiPaiming);
        }
        String chengjiText = Util.decode(request, "chengjiText");
        if (chengjiText != null && !chengjiText.equals("")) {
            vo.setChengjiText(chengjiText);
        }
        chengjiService.update(vo);
        this.redirectList(request, response);
    }

    /**
     * 获取成绩的详细信息(详情页面与编辑页面要显示该成绩的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping({"chengjiGet", "chengjiEditPre"})
    public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectInfo(request, response);
    }

    /**
     * 根据条件查询成绩的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("chengjiList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到详情页面
     *
     * @param request
     * @param response
     */
    private void redirectInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
        Serializable id = Util.decode(request, "id");//取出主键id

        Chengji vo = chengjiService.get(id);
        String ajaxFlag = Util.decode(request, "ajaxFlag");
        //如果页面采用的是ajax方式请求的,则只需要将查询出的对象返回就好,如果不是ajax,则需要跳转
        if (ajaxFlag != null && Boolean.valueOf(ajaxFlag.trim())) {
            response.getWriter().println(JSONObject.toJSONString(vo));
        } else {
            request.getSession().setAttribute("vo", vo);
            String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
            response.sendRedirect("chengji_" + to + ".jsp");
        }
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字


        Integer totalRecord = (Integer) chengjiService.list(params).get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        //封装分页参数
        Boolean ajaxFlag = Util.decode(request, "ajaxFlag") != null;//如果页面是以ajax的形式进来的,则需要全量返回
        String pageNum = Util.decode(request, "pageNum");
        com.demo.common.PageBean<Object> pb = new com.demo.common.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", ajaxFlag ? Integer.MAX_VALUE : pb.getPageSize());
        List list = (List) chengjiService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        pb.setServlet("chengjiList");
        pb.setSearchColumn(searchColumn);
        pb.setKeyword(keyword);
        pb.setList(list);
        request.getSession().setAttribute("pageBean", pb);//pageBean.list
        
        request.getSession().setAttribute("list", chengjiService.list(params).get("list"));
        if (ajaxFlag) {//如果页面采用的是ajax方式请求的,则只需要将查询出的对象返回就好,如果不是ajax,则需要跳转
            response.getWriter().println(JSONObject.toJSONString(list));
        } else {
            response.sendRedirect("chengji_list.jsp");
        }
    }
}

package com.demo.controller;


import com.alibaba.fastjson.JSONObject;

import com.demo.util.Util;
import com.demo.service.XiangmuService;
import com.demo.vo.Xiangmu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping
public class XiangmuController {

    @Autowired
    private XiangmuService xiangmuService;

    /**
     * 增加项目
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("xiangmuAdd")
    public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Xiangmu vo = new Xiangmu();
        //取出页面传进来的参数
        String xiangmuName = Util.decode(request, "xiangmuName");
        if (xiangmuName != null && !xiangmuName.equals("")) {
            vo.setXiangmuName(xiangmuName);
        }
        String xiangmuSex = Util.decode(request, "xiangmuSex");
        if (xiangmuSex != null && !xiangmuSex.equals("")) {
            vo.setXiangmuSex(Boolean.valueOf(xiangmuSex));
        }
        String xiangmuDidian = Util.decode(request, "xiangmuDidian");
        if (xiangmuDidian != null && !xiangmuDidian.equals("")) {
            vo.setXiangmuDidian(xiangmuDidian);
        }
        String xiangmuSijian = Util.decode(request, "xiangmuSijian");
        if (xiangmuSijian != null && !xiangmuSijian.equals("")) {
            vo.setXiangmuSijian(xiangmuSijian);
        }
        String xiangmuText = Util.decode(request, "xiangmuText");
        if (xiangmuText != null && !xiangmuText.equals("")) {
            vo.setXiangmuText(xiangmuText);
        }

        //调用Service层的增加(insert)方法
        xiangmuService.insert(vo);
        this.redirectList(request, response);
    }

    /**
     * 删除项目
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("xiangmuDelete")
    public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");
        xiangmuService.delete(Arrays.asList(id));
        this.redirectList(request, response);
    }

    /**
     * 编辑项目
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("xiangmuEdit")
    public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Xiangmu vo = new Xiangmu();
        String id = Util.decode(request, "id");
        if (id != null && !id.equals("")) {
            vo.setId(Long.valueOf(id));
        }
        String xiangmuName = Util.decode(request, "xiangmuName");
        if (xiangmuName != null && !xiangmuName.equals("")) {
            vo.setXiangmuName(xiangmuName);
        }
        String xiangmuSex = Util.decode(request, "xiangmuSex");
        if (xiangmuSex != null && !xiangmuSex.equals("")) {
            vo.setXiangmuSex(Boolean.valueOf(xiangmuSex));
        }
        String xiangmuDidian = Util.decode(request, "xiangmuDidian");
        if (xiangmuDidian != null && !xiangmuDidian.equals("")) {
            vo.setXiangmuDidian(xiangmuDidian);
        }
        String xiangmuSijian = Util.decode(request, "xiangmuSijian");
        if (xiangmuSijian != null && !xiangmuSijian.equals("")) {
            vo.setXiangmuSijian(xiangmuSijian);
        }
        String xiangmuText = Util.decode(request, "xiangmuText");
        if (xiangmuText != null && !xiangmuText.equals("")) {
            vo.setXiangmuText(xiangmuText);
        }
        xiangmuService.update(vo);
        this.redirectList(request, response);
    }

    /**
     * 获取项目的详细信息(详情页面与编辑页面要显示该项目的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping({"xiangmuGet", "xiangmuEditPre"})
    public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectInfo(request, response);
    }

    /**
     * 根据条件查询项目的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("xiangmuList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到详情页面
     *
     * @param request
     * @param response
     */
    private void redirectInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
        Serializable id = Util.decode(request, "id");//取出主键id

        Xiangmu vo = xiangmuService.get(id);
        String ajaxFlag = Util.decode(request, "ajaxFlag");
        //如果页面采用的是ajax方式请求的,则只需要将查询出的对象返回就好,如果不是ajax,则需要跳转
        if (ajaxFlag != null && Boolean.valueOf(ajaxFlag.trim())) {
            response.getWriter().println(JSONObject.toJSONString(vo));
        } else {
            request.getSession().setAttribute("vo", vo);
            String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
            response.sendRedirect("xiangmu_" + to + ".jsp");
        }
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字


        Integer totalRecord = (Integer) xiangmuService.list(params).get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        //封装分页参数
        Boolean ajaxFlag = Util.decode(request, "ajaxFlag") != null;//如果页面是以ajax的形式进来的,则需要全量返回
        String pageNum = Util.decode(request, "pageNum");
        com.demo.common.PageBean<Object> pb = new com.demo.common.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", ajaxFlag ? Integer.MAX_VALUE : pb.getPageSize());
        List list = (List) xiangmuService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        pb.setServlet("xiangmuList");
        pb.setSearchColumn(searchColumn);
        pb.setKeyword(keyword);
        pb.setList(list);
        request.getSession().setAttribute("pageBean", pb);//pageBean.list
        
        request.getSession().setAttribute("list", xiangmuService.list(params).get("list"));
        if (ajaxFlag) {//如果页面采用的是ajax方式请求的,则只需要将查询出的对象返回就好,如果不是ajax,则需要跳转
            response.getWriter().println(JSONObject.toJSONString(list));
        } else {
            response.sendRedirect("xiangmu_list.jsp");
        }
    }
}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

程序猿毕业分享网

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

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

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

打赏作者

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

抵扣说明:

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

余额充值