学生为学校教研室开发技能大赛评分系统

简介: 开发工具:IDEA /Eclipse数据库:MYSQL5.7+Redis前端开发:Layui+Bootstrap后端开发:SSM开发框架功能需求:总共分为三个阶段第一个阶段是:教研室比赛阶段(同一个教研室的老师比赛),同一学院下多个教研室分别选取该教研室分数高的数人晋级到第二阶段:学院比赛。第二个阶段是:学院比赛阶段:从第一阶段晋级过来的老师中选取分数最高的数名代表学院参加第三阶段(总决赛)比赛第三个阶段是:总决赛:从第二阶段晋级来的选手比赛,排名,选出冠军、亚军、季军。

 作者主页:编程指南针

作者简介:Java领域优质创作者、CSDN博客专家 、掘金特邀作者、多年架构师设计经验、腾讯课堂常驻讲师

主要内容:Java项目、毕业设计、简历模板、学习资料、面试题库、技术互助

文末获取源码

项目编号:BS-GX-009

开发工具:IDEA /Eclipse

数据库:MYSQL5.7+Redis

前端开发:Layui+Bootstrap

后端开发:SSM开发框架

功能需求:

总共分为三个阶段

第一个阶段是:教研室比赛阶段(同一个教研室的老师比赛),同一学院下多个教研室分别选取该教研室分数高的数人晋级到第二阶段:学院比赛。

第二个阶段是:学院比赛阶段:从第一阶段晋级过来的老师中选取分数最高的数名代表学院参加第三阶段(总决赛)比赛

第三个阶段是:总决赛:从第二阶段晋级来的选手比赛,排名,选出冠军、亚军、季军。

该管理系统主要实现以下几个主要功能:

1、教研室比赛(线上比赛)阶段主要内容:

(1)教师注册,登录、退出功能;

(2)教师个人信息管理;

(3)教师报名功能;(不是所有注册过的老师都会报名只有报名之后才是选手)

(4)教师上传参赛视频功能;

(5)评委打分功能;(每个评委给某一场比赛的选手打分 数据库表:比赛ID 选手ID 评委ID 分数)

(6)管理员登录、查看老师信息(包括上传的视频)  修改老师分数(把评委打的分计算得到的值(十个评委去掉最高分和最低分剩下的取平均值)录入)

(7)晋级功能。(第1阶段选取成绩最高的数名选手晋级到第2阶段学院比赛)

2、学院比赛(线下比赛)阶段主要内容:

(1)评委打分(每个评委给某一场比赛的选手打分 数据库表:比赛ID 选手ID 评委ID 分数)

(2)管理员登录、查看老师信息 修改老师分数(把评委打的分计算得到的值(十个评委去掉最高分和最低分剩下的取平均值)录入)

(3)晋级功能。(第2阶段选取成绩最高的数名选手晋级到第3阶段学院比赛)

3、学校决赛(线下比赛)主要内容:

(1)评委打分(每个评委给某一场比赛的选手打分 数据库表:比赛ID 选手ID 评委ID 分数)

(2)管理员登录、查看老师信息 修改老师分数(把评委打的分计算得到的值(十个评委去掉最高分和最低分剩下的取平均值)录入)

(3)排名 选出冠军、亚军、季军

下面展示一下系统的部分实现功能:

image.gif编辑

参赛用户登陆:

image.gif编辑

image.gif编辑

报名参赛:

image.gif编辑

image.gif编辑

报名成功后上传视频:

image.gif编辑

评委登陆系统开始打分:所有评委进入系统为每个作品打分

image.gif编辑

image.gif编辑

image.gif编辑

image.gif编辑

image.gif编辑

管理员登陆:

image.gif编辑

image.gif编辑

晋级管理:可以分阶段管理,依次是教研室,学校,学院决赛。主要根据各评委打分生成平均分进行排名

image.gif编辑

image.gif编辑

前端主页可以查看各阶段比较排名结果:

image.gif编辑

系统核心实现代码:

package controller;
import com.alibaba.fastjson.JSON;
import entity.Response;
import entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.LoginService;
@Controller
@RequestMapping(value = "login")
public class LoginController {
    @Autowired
    private LoginService loginService;
    @ResponseBody
    @RequestMapping(value = "login.do")
    public Response login(String  userName,String password){
        User user = loginService.login(userName,password);
        Response res = new Response();
        if (user != null){
            Integer flag = loginService.loginStatus(user);
            if (flag == 1){
                res.setMessage("登陆成功!");
                user.setIslogin(true);
                res.setTag(true);
                res.setUser(user);
            }
        }else {
            res.setMessage("登录失败,请检查账号或密码是否正确!");
            res.setTag(false);
        }
        return res;
    }
    @ResponseBody
    @RequestMapping(value = "register.do")
    public Response register(User user){
        Response res = new Response();
        System.out.println("data=>"+user+user.getName()+user.getPhonenum());
        Integer flag = loginService.checkUser(user.getUsername(),user.getPhonenum());
        if (flag == 1){
            res.setTag(false);
            res.setMessage("该用户已注册!");
        }else {
            User userInfo = loginService.register(user);
            if (userInfo != null) {
                res.setTag(true);
                res.setMessage("账号注册成功!");
                res.setUser(userInfo);
            }else {
                res.setTag(false);
                res.setMessage("账号注册失败!");
            }
        }
        return res;
    }
    @ResponseBody
    @RequestMapping(value = "logout.do")
    public Response logout(String id){
        Response res =  new Response();
        int flag = loginService.logout(id);
        if (flag == 1){
            res.setTag(true);
            res.setMessage("账号退出登录成功!");
        }else {
            res.setTag(false);
            res.setMessage("退出登录失败!请联系管理员");
        }
        return res;
    }
    @ResponseBody
    @RequestMapping(value = "updateUserInfo.do")
    public Response updateUserInfo(User user){
        Response res = new Response();
        int flag = loginService.updateUser(user);
        if (flag == 1){
            res.setMessage("资料修改成功!");
            res.setUser(loginService.getUserInfo(user.getId()));
            res.setTag(true);
        }else {
            res.setMessage("资料修改失败!");
            res.setTag(false);
        }
        return res;
    }
}

image.gif

package controller;
import entity.Match;
import entity.ResponseJSON;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import service.DateTimeService;
import service.MatchService;
import util.DateUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@Controller
@RequestMapping("file")
public class VideoController {
    String path = "D:\\uploadFiles\\";
    @Autowired
    private MatchService matchService;
    @Autowired
    private DateTimeService dateTimeService;
    @RequestMapping(value="upload.do")
    @ResponseBody
    public ResponseJSON upload(MultipartHttpServletRequest request) {
        String deadLine = dateTimeService.getDeadLine();
        // 获取文件map集合
        Map<String, MultipartFile> fileMap = request.getFileMap();
        MultipartFile file1 = fileMap.get("file");
        String mediaType = file1.getContentType();
        ResponseJSON rsp = new ResponseJSON();
        String[] un = request.getParameterMap().get("id");
        String[] ftl = request.getParameterMap().get("mediaType");
        String playerId = un[0];
        if (file1.isEmpty()) {
            rsp.setTag(false);
            rsp.setMessage("上传文件不能为空");
        } else {
            String originalFilename = file1.getOriginalFilename();
            try {
                // 创建要上传的路
//                File fdir = new File("/home/uploadFiles");
        File fdir = new File(path);
                if (!fdir.exists()) {
                    fdir.mkdirs();
                }
                // 文件上传到路径下
                FileUtils.copyInputStreamToFile(file1.getInputStream(), new File(fdir, originalFilename));
                // coding
                rsp.setTag(true);
                rsp.setMessage("上传文件成功");
            } catch (Exception e) {
                rsp.setTag(false);
                rsp.setMessage("上传文件失败");
            }
        }
        Match req = new Match();
        req.setPlayerid(playerId);
        req.setVideourl(file1.getOriginalFilename());
        req.setMediaType(mediaType);
        if(matchService.fileIsExist(req)>0) {
            File file = new File(matchService.getFileUrl(req).getVideourl());// 读取
            file.delete();
            int flag = matchService.uploadVideo(req);
            if (flag == 1) {
                rsp.setMessage("上传文件成功,已覆盖源文件");
            }
        }else {
            Match match = new Match();
            String filePath = file1.getOriginalFilename();
            match.setVideourl(filePath);
            match.setPlayerid(playerId);
            match.setMediaType(mediaType);
            matchService.uploadVideo(match);
            Date date = new Date();
            SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            matchService.uploadVideo(match);
        }
        return rsp;
    }
    @RequestMapping(value="download",produces = "application/json;charset=UTF-8")
    @ResponseBody
    public ResponseJSON download(HttpServletRequest request, HttpServletResponse response)  {
        String fn = request.getParameter("fileName").toString();
        ResponseJSON rsp = new ResponseJSON();
        //模拟文件,myfile.txt为需要下载的文件
//        String path = "/home/uploadFiles/"+fn;
        String paths = path + fn;
        System.out.println(paths+"下载路径");
        //获取输入流
        InputStream bis;
        try {
            bis = new BufferedInputStream(new FileInputStream(new File(paths)));
            System.out.println("获取file成功");
            String filename = URLEncoder.encode(fn,"UTF-8");
            //设置文件下载头
            response.addHeader("Content-Disposition", "attachment;filename=" + filename);
            //1.设置文件ContentType类型,这样设置,会自动判断下载文件类型
//          response.setContentType("multipart/form-data");
            response.setContentType("application/json;charset=UTF-8");
            BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
            System.out.println("开始转成流");
            int len = 0;
            while((len = bis.read()) != -1){
                out.write(len);
                out.flush();
            }
            out.close();
            rsp.setTag(true);
            rsp.setMessage("下载文件成功");
        } catch (IOException e) {
            rsp.setTag(false);
            rsp.setMessage("下载文件失败");
        }
        return rsp;
    }
}

image.gif

package controller;
import entity.Judges;
import entity.Match;
import entity.Response;
import entity.ResponseJSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.JudgeService;
import java.util.List;
@Controller
@RequestMapping(value = "judge")
public class JudgeController {
    @Autowired
    private JudgeService judgeService;
    @ResponseBody
    @RequestMapping(value = "rateMatch")
    public ResponseJSON rateMatch(Judges match){
        ResponseJSON res = new ResponseJSON();
        int flag = judgeService.getVideoMenu(match);
        if (flag == 0) {
            res.setMessage("打分失败!");
            res.setTag(true);
        }else {
            res.setMessage("打分成功!");
            res.setTag(true);
        }
        return res;
    }
    @ResponseBody
    @RequestMapping(value = "checkScored")
    public ResponseJSON checkScored(Judges match){
        ResponseJSON res = new ResponseJSON();
        return res;
    }
    @ResponseBody
    @RequestMapping(value = "calculationAverage")
    public ResponseJSON calculationAverage(String matchId,String playerId,String adminId){
        ResponseJSON res = new ResponseJSON();
        int flag = judgeService.checkAdmin(adminId);
        int judgeNum =judgeService.checkJudged(matchId,playerId);
        if (flag == 0){
            res.setTag(false);
            res.setMessage("您没有权限录入分数");
        }
        if (judgeNum < 3 ){
            res.setTag(false);
            res.setMessage("评分尚未完成!");
        }else {
            int updated = judgeService.updateTotalScore(matchId,playerId);
            if (updated == 1){
                res.setTag(true);
                res.setMessage("修改分数完成!");
            }else {
                res.setTag(false);
                res.setMessage("更新总分失败!");
            }
            int ended = judgeService.checkMatchEnd(matchId);
            if (ended == 0){
                String level = judgeService.getCurrentLevel(matchId);
                if (level.equals("已结束")){
                    res.setTag(true);
                    res.setMessage("已决出关亚季军!");
                }else {
                    int promote = judgeService.updatePromotion(matchId, level);
                    if (promote == 1) {
                        res.setMessage("所有参赛人员总分已产生,该场比赛结果已产生!");
                        res.setTag(true);
                    } else {
                        res.setMessage("所有参赛人员总分已产生,该场比赛结果产生失败,请联系管理员!");
                        res.setTag(false);
                    }
                }
            }
        }
        return res;
    }
}

image.gif


相关文章
|
4天前
|
运维 监控 前端开发
基于AI大模型的故障诊断与根因分析落地实现
本项目基于Dify平台构建多智能体协作的AIOps故障诊断系统,融合指标、日志、链路等多源数据,通过ReAct模式实现自动化根因分析(RCA),结合MCP工具调用与分层工作流,在钉钉/企业微信中以交互式报告辅助运维,显著降低MTTD/MTTR。
|
5月前
|
SQL 监控 安全
数据库安全审计系统
Next-DBM数据库审计系统助力企业解决数据安全难题,提供统一身份管理、全方位监控、智能风险识别、完整审计追溯及精细化权限管控,有效防范数据泄露与内部威胁,保障企业核心资产安全,满足合规要求,提升运维效率。
|
7月前
|
存储 JSON Java
酷阿鲸森林农场:使用 Java 构建的去中心化区块链电商系统
酷阿鲸森林农场推出基于Java的轻量级区块链电商系统,解决传统农产品电商信任问题。该系统无需以太坊或服务器,通过自研区块链引擎实现去中心化点对点交易,确保数据不可篡改。每个用户节点运行桌面软件参与数据共识,支持订单上链、链同步与验证。项目具备简单轻量、真实可控等优势,适用于农户合作社及小型有机电商,并可扩展签名认证、NFT凭证等功能,推动农业数字主权与数据可信发展。
酷阿鲸森林农场:使用 Java 构建的去中心化区块链电商系统
基于模糊PID控制器的汽车电磁悬架控制系统simulink建模与仿真
本课题基于MATLAB2022a,利用Simulink建模与仿真,研究了基于模糊PID控制器的汽车电磁悬架控制系统。该系统融合了模糊逻辑的非线性处理能力和PID控制器的稳定性与快速响应特性,以提高车辆行驶的舒适性和操控性能。通过动态调整悬架刚度和阻尼系数,适应不同路面条件和驾驶需求。仿真结果显示,模糊PID控制器显著优于无控制器和LQG控制器,在复杂路况下表现出更好的自适应控制能力,提升了车辆平稳性和应对紧急工况的能力。
|
10月前
|
存储 安全 文件存储
剪切未粘贴成功的文件不见了怎么找回来?
你正在移动文件,使用“剪切”命令准备粘贴到新位置,却发现粘贴操作失败,文件却消失了。这个时候,你可能会觉得非常沮丧,因为你以为文件已经消失得无影无踪。然而,不必过于担心,这种情况其实是可以恢复的。在本文中,我们将介绍几种有效的方式,帮助你找回那些“失踪”的文件,让它们重回你的电脑。
|
12月前
|
数据采集 Web App开发 监控
Python爬虫:爱奇艺榜单数据的实时监控
Python爬虫:爱奇艺榜单数据的实时监控
MAGICORE:基于多代理迭代的粗到细精炼框架,提升大语言模型推理质量
MAGICORE是一种多代理迭代框架,旨在改进大语言模型(LLM)的推理能力。该框架通过将问题分类为简单或困难,并分别为其应用粗粒度聚合或细粒度精炼,有效避免了过度精炼、错误定位及精炼不足等问题。MAGICORE包含Solver、Reviewer和Refiner三个角色,结合结果和过程奖励模型,实现有针对性的反馈和迭代精炼。实验结果显示,MAGICORE在多个数据集和模型上显著优于现有的聚合和精炼方法,提升了推理准确性和样本效率。
422 3
MAGICORE:基于多代理迭代的粗到细精炼框架,提升大语言模型推理质量
|
数据库 开发者
EasyCode 自动生成代码
【10月更文挑战第16天】总的来说,EasyCode 自动生成代码是一款非常有价值的工具。它为开发者们带来了便捷、高效和创新,让软件开发变得更加轻松和有趣。随着技术的不断进步,相信 EasyCode 还会不断完善和发展,为开发者们提供更多更好的服务。
220 1
|
安全 网络安全 数据安全/隐私保护
https的原理
https的原理
813 2
|
存储 前端开发 JavaScript
深入Web前端:栈与堆的优缺点全解析,让你大开眼界!
【8月更文挑战第23天】本文以问答形式解析了Web前端开发中至关重要的内存管理概念——栈与堆。栈采用后进先出(LIFO)原则存储执行上下文,适用于函数调用管理;而堆则灵活存储如对象和数组等复杂数据类型。栈操作迅速但访问受限,堆则提供动态空间分配但可能牺牲内存效率。理解两者特性有助于提升JavaScript编程技巧。
276 1