——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven赛事打分系统(java+ssm+layui+maven+mysql+jsp)
项目介绍
赛事评分系统,SSM框架。该项目分管理员、裁判、选手三个用户角色。
管理员主要功能: 首页、选手管理、裁判管理、赛事管理 裁判主要功能: 首页、评分; 选手主要功能: 首页、报名赛事、查看成绩;
环境需要
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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7版本; 7.lombok插件 注:必须安装,否则会报错
技术栈
后端:Spring SpringMVC MyBatis 2. 前端:Layui
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 将项目中database.properties配置文件中的数据库配置改为自己的配置; 3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行; 4. 运行项目,输入localhost:8080/xxx 登录
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 public class JudgeController { @Autowired JudgeServiceImpl judgeService; @Autowired LoginServiceImpl loginService; @RequestMapping("/toJudgePage") public String toJudgePage () { return "/pages/judge" ; } @RequestMapping("/toMark") public String toMark () { return "/pages/judgeMarkPlayer" ; } @RequestMapping(value = "/getAllJudge", produces = "application/json;charset=UTF-8") @ResponseBody public String getAllJudge () { JSONObject object = new JSONObject(); object.put("code" , 200 ); object.put("msg" , "" ); object.put("data" , judgeService.getAllJudge()); object.put("count" , judgeService.getAllJudge().size()); System.out.println("数据库数据:" + judgeService.getAllJudge().toString()); return object.toJSONString(); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 object.put("code" , 200 ); object.put("msg" , "" ); object.put("data" , resultList); object.put("count" , resultList.size()); System.out.println("前端数据:" + resultList); return object.toJSONString(); } public static List RangeScore (List list) { System.out.println("是否为空:" + list.isEmpty()); if (!list.isEmpty()) { System.out.println("*********************************" ); System.out.println("之前:" + list); list.remove(list.get(0 )); list.remove(list.size() - 1 ); System.out.println("之后:" + list); return list; } else { return new ArrayList(); } } public static Double getAverage (List list) { double total = 0 ; double average = 0 ; for (int i = 0 ; i < list.size(); i++) { total += new Double((String) list.get(i)); } average = total / list.size(); Double result = Double.valueOf(String.format("%.1f" , average)); logger.debug("最后得分:" + result); return result; } @RequestMapping("/getALLScore") public String getALLScore () { String ALL[] = {"p101" , "P102" , "P103" , "P104" , "P105" };
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 for (int i = 0 ; i < ALL.length; i++) { Range(ALL[i]); } return "kong" ; } public void Range (String pid) { List<Mark> playerScore = playService.getPlayerScore(pid); logger.error(playerScore.toString()); for (int i = 0 ; i < playerScore.size(); i++) { if (playerScore.get(i).getItem().equals("体操" )) { String tiCaoScore = playerScore.get(i).getScore(); TiCaoTotal.add(tiCaoScore); } else if (playerScore.get(i).getItem().equals("跳水" )) { String tiCaoScore = playerScore.get(i).getScore(); TiaoShuiTotal.add(tiCaoScore); } else if (playerScore.get(i).getItem().equals("武术" )) { String tiCaoScore = playerScore.get(i).getScore(); WuShuTotal.add(tiCaoScore); } } Collections.sort(TiCaoTotal); Collections.sort(TiaoShuiTotal); Collections.sort(WuShuTotal); List<Mark> ResultScore = new ArrayList(); ResultScore.add(new Mark("体操" , getAverage(RangeScore(TiCaoTotal))));
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 return object.toJSONString(); } @RequestMapping(value = "/getAllMatchAjax", produces = "application/json;charset=UTF-8") @ResponseBody public String getAllMatchAjax () { List<Match> allMatch = matchService.getAllMatch(); JSONArray array = JSONArray.parseArray(JSON.toJSONString(allMatch)); System.out.println(array.toJSONString()); return array.toJSONString(); } @RequestMapping("/deleteMatchById") @ResponseBody public String deleteMatchById (@RequestParam Map map) { int currentMatchId = Integer.parseInt((String) map.get("index" )); int result = matchService.deleteMatchById(currentMatchId); if (result > 0 ) { return "1" ; } else { return "error" ; } } @RequestMapping(value = "/addMatchAjax", produces = "application/json;charset=UTF-8") @ResponseBody public String addMatchAjax (@RequestParam Map map) { String mid = (String) map.get("mid" ); String mname = (String) map.get("mname" ); String mtime = (String) map.get("mtime" ); DateTime parseDate = DateUtil.parse(mtime, "yyyy-MM-dd" ); java.sql.Date mtimeDate = new java.sql.Date(parseDate.getTime()); System.out.println("类型" + mtimeDate.getClass().getName()); System.out.println("mid=" + mid + "mname=" + mname + "mtime=" + mtimeDate); int result = matchService.addMatchAjax(new Match(mid, mname, mtimeDate)); if (result > 0 ) { return "1" ; } else { return "error" ; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 @Controller @RequestMapping("/judge") public class JudgeController { @Autowired JudgeServiceImpl judgeService; @Autowired LoginServiceImpl loginService; @RequestMapping("/toJudgePage") public String toJudgePage () { return "/pages/judge" ; } @RequestMapping("/toMark") public String toMark () { return "/pages/judgeMarkPlayer" ; } @RequestMapping(value = "/getAllJudge", produces = "application/json;charset=UTF-8") @ResponseBody public String getAllJudge () { JSONObject object = new JSONObject(); object.put("code" , 200 ); object.put("msg" , "" );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 System.out.println("是否为空:" + list.isEmpty()); if (!list.isEmpty()) { System.out.println("*********************************" ); System.out.println("之前:" + list); list.remove(list.get(0 )); list.remove(list.size() - 1 ); System.out.println("之后:" + list); return list; } else { return new ArrayList(); } } public static Double getAverage (List list) { double total = 0 ; double average = 0 ; for (int i = 0 ; i < list.size(); i++) { total += new Double((String) list.get(i)); } average = total / list.size(); Double result = Double.valueOf(String.format("%.1f" , average)); logger.debug("最后得分:" + result); return result; } @RequestMapping("/getALLScore") public String getALLScore () { String ALL[] = {"p101" , "P102" , "P103" , "P104" , "P105" }; for (int i = 0 ; i < ALL.length; i++) { Range(ALL[i]); } return "kong" ; } public void Range (String pid) { List<Mark> playerScore = playService.getPlayerScore(pid); logger.error(playerScore.toString()); for (int i = 0 ; i < playerScore.size(); i++) {
——————————PayStart——————————
项目链接: https://javayms.github.io?id=471422292105200fs https://javayms.pages.dev?id=471422292105200fs