springboot大学生体质测试管理系统源码和论文

本文主要是介绍springboot大学生体质测试管理系统源码和论文,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

大学生体质测试管理系统提供给用户一个简单方便体质测试管理信息,通过留言区互动更方便。本系统采用了B/S体系的结构,使用了java技术以及MYSQL作为后台数据库进行开发。系统主要分为系统管理员、教师和用户三个部分,系统管理员主要功能包括首页、个人中心、用户管理、教师管理、体质测试管理、测试报告管理、测试成绩管理、留言板、系统管理;基本上实现了整个大学生体质测试管理系统信息管理的过程。

关键词:大学生体质测试管理系统; java技术;MYSQL数据库;

springboot大学生体质测试管理系统源码和论文386

演示视频:

springboot大学生体质测试管理系统源码和论文


Abstract

College students physique test management system provides users with a simple and convenient physique test management information, more convenient interaction through the message area. This system adopts the STRUCTURE of B/S system, using Java technology and MYSQL as the background database for development. The system is mainly divided into three parts: system administrator, teacher and user. The main functions of system administrator include home page, personal center, user management, teacher management, physical test management, test report management, test result management, message board, system management; Basically realized the entire college students physical test management system information management process.

Key words: college students physical test management system; Java technology; MYSQL database;

1 绪 论

1.1系统背景介绍

近几年来,网络事业,特别是Internet发展速度之快是任何人都始料不及的。目前,由于Internet表现出来的便捷,快速等诸多优势,已经使它成为社会各行各业,甚至是平民大众工作,生活不可缺少的一个重要组成部分。

随着社会的发展线下管理的方式已经不可避免的显示出它在时间与空间等方面的局限性,广大的人民群众迫切的需要打破这种局限性。在这种要求下,大学生体质测试管理系统产生了。它的出现不但解决了传统管理方式的缺点,而且给了广大用户更大的选择空间,促进了大学生体质测试信息的优化管理,有效的避免了大学生体质测试的管理缭乱的局面。所以像大学生体质测试管理系统这种电子商务的发展壮大也是不可避免的。

大学生体质测试管理系统作为一种典型的办公系统也迅速的发展并深入人们的日常生活中,它使用户足不出户就可以管理自己的大学生体质测试的测试信息等,最大化减缩了用户的管理时间,提高了管理效率。

1.2课题研究的目的和意义

人们现在的生活方式因为网络的普及发生了巨大变化,由于网络管理在人们的视野中出现,人们对网络管理额外的关注。人们只要在有网络的地方足不出户查看到世界各地的各类。目前的挑战是前台界面的设计,要把顾客的眼球吸引住,选则比较人性化的界面设计,要更直观的表现,让用户能更多的了解大学生体质测试管理系统的作用和功效。

本系统的主要意义在于,全力以赴为用户提供一个操作方便,界面简洁,信息直观的大学生体质测试管理系统。使用该系统的用户,可以先浏览到公司介绍,产品信息,并可以注册成为本网站的用户。

1.3系统的研究现状

现如今用户大多也改用网站平台的形式来管理信息动态,传统的信息交流时代正慢慢离我们远去。大学生体质测试管理系统采用了一些平台软件来管理公司,但是如何让我们的管理效率更高呢?

网络时代成为大学生体质测试管理系统的大势所趋,因为我们国家的互联网相比外国的起步晚了一点,因此我们国家的大学生体质测试的办公管理网站做的也不早。但是在现实的需求与IT人才辛苦的设计后,网站类大学生体质测试管理系统发展的速度很快,各种功能也做的尽善尽美。

1.4系统实现的功能

本次设计任务是要设计一个大学生体质测试管理系统,通过这个系统能够满足大学生体质测试管理系统功能。系统的主要功能包括首页、个人中心、用户管理、教师管理、体质测试管理、测试报告管理、测试成绩管理、留言板、系统管理等功能。

管理员可以根据系统给定的账号进行登录,登录后可以进入大学生体质测试管理系统对大学生体质测试所有模块进行管理。包括查看和修改自己的个人信息以及登录密码,用户信息等。

该系统为每一个用户都分配了一个用户账号,用户通过账号的登录可以在系统中查看大学生体质测试信息及对个人信息进行修改等功能。

1.5系统的特点

大学生体质测试管理系统充分利用网络技术和网络信息资源,提高阅读效率,和平常的一些网络系统比较,更注重大学生体质测试的办公动态这一个重要环节。大学生体质测试管理系统研究与设计主要表现出内容方式丰富、方便用户互动交流功能齐全等方面的特点。

package com.controller;import java.io.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.*;import javax.servlet.http.HttpServletRequest;import com.alibaba.fastjson.JSON;
import com.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;/*** 通用接口*/
@RestController
public class CommonController {private static final Logger logger = LoggerFactory.getLogger(CommonController.class);@Autowiredprivate CommonService commonService;/*** Java代码实现MySQL数据库导出** @param mysqlUrl     MySQL安装路径* @param hostIP       MySQL数据库所在服务器地址IP* @param userName     进入数据库所需要的用户名* @param hostPort     数据库端口* @param password     进入数据库所需要的密码* @param savePath     数据库文件保存路径* @param fileName     数据库导出文件文件名* @param databaseName 要导出的数据库名* @return 返回true表示导出成功,否则返回false。*/@IgnoreAuth@RequestMapping("/beifen")public R beifen(String mysqlUrl, String hostIP, String userName, String hostPort, String password, String savePath, String fileName, String databaseName) {File saveFile = new File(savePath);if (!saveFile.exists()) {// 如果目录不存在 saveFile.mkdirs();// 创建文件夹 }if (!savePath.endsWith(File.separator)) {savePath = savePath + File.separator;}PrintWriter printWriter = null;BufferedReader bufferedReader = null;try {Runtime runtime = Runtime.getRuntime();String cmd = mysqlUrl + "mysqldump -h" + hostIP + " -u" + userName + " -P" + hostPort + " -p" + password + " " + databaseName;runtime.exec(cmd);Process process = runtime.exec(cmd);InputStreamReader inputStreamReader = new InputStreamReader(process.getInputStream(), "utf8");bufferedReader = new BufferedReader(inputStreamReader);printWriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(savePath + fileName), "utf8"));String line;while ((line = bufferedReader.readLine()) != null) {printWriter.println(line);}printWriter.flush();} catch (Exception e) {e.printStackTrace();return R.error("备份数据出错");} finally {try {if (bufferedReader != null) {bufferedReader.close();}if (printWriter != null) {printWriter.close();}} catch (Exception e) {e.printStackTrace();}}return R.ok();}/*** Java实现MySQL数据库导入** @param mysqlUrl     MySQL安装路径* @param hostIP       MySQL数据库所在服务器地址IP* @param userName     进入数据库所需要的用户名* @param hostPort     数据库端口* @param password     进入数据库所需要的密码* @param savePath     数据库文件保存路径* @param fileName     数据库导出文件文件名* @param databaseName 要导出的数据库名*/@IgnoreAuth@RequestMapping("/huanyuan")public R huanyuan(String mysqlUrl, String hostIP, String userName, String hostPort, String password, String savePath, String fileName, String databaseName) {try {Runtime rt = Runtime.getRuntime();Process child1 = rt.exec(mysqlUrl+"mysql.exe  -h" + hostIP + " -u" + userName + " -P" + hostPort + " -p" + password + " " + databaseName);OutputStream out = child1.getOutputStream();//控制台的输入信息作为输出流String inStr;StringBuffer sb = new StringBuffer("");String outStr;BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(savePath+"/"+fileName), "utf-8"));while ((inStr = br.readLine()) != null) {sb.append(inStr + "\r\n");}outStr = sb.toString();OutputStreamWriter writer = new OutputStreamWriter(out, "utf8");writer.write(outStr);
// 注:这里如果用缓冲方式写入文件的话,会导致中文乱码,用flush()方法则可以避免writer.flush();out.close();br.close();writer.close();} catch (Exception e) {e.printStackTrace();return R.error("数据导入出错");}return R.ok();}/*** 饼状图求和* @return*/@RequestMapping("/pieSum")public R pieSum(@RequestParam Map<String,Object> params) {logger.debug("饼状图求和:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.pieSum(params);return R.ok().put("data", result);}/*** 饼状图统计* @return*/@RequestMapping("/pieCount")public R pieCount(@RequestParam Map<String,Object> params) {logger.debug("饼状图统计:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.pieCount(params);return R.ok().put("data", result);}/*** 柱状图求和单列* @return*/@RequestMapping("/barSumOne")public R barSumOne(@RequestParam Map<String,Object> params) {logger.debug("柱状图求和单列:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.barSumOne(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题List<String> yAxis0 = new ArrayList<>();yAxis.add(yAxis0);legend.add("");for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get("name"));String value = String.valueOf(map.get("value"));xAxis.add(oneValue);yAxis0.add(value);}Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}/*** 柱状图统计单列* @return*/@RequestMapping("/barCountOne")public R barCountOne(@RequestParam Map<String,Object> params) {logger.debug("柱状图统计单列:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.barCountOne(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题List<String> yAxis0 = new ArrayList<>();yAxis.add(yAxis0);legend.add("");for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get("name"));String value = String.valueOf(map.get("value"));xAxis.add(oneValue);yAxis0.add(value);}Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}/*** 柱状图统计双列* @return*/@RequestMapping("/barSumTwo")public R barSumTwo(@RequestParam Map<String,Object> params) {logger.debug("柱状图统计双列:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.barSumTwo(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();for(Map<String, Object> map :result){String name1Value = String.valueOf(map.get("name1"));String name2Value = String.valueOf(map.get("name2"));String value = String.valueOf(map.get("value"));if(!legend.contains(name2Value)){legend.add(name2Value);//添加完成后 就是最全的第二列的类型}if(dataMap.containsKey(name1Value)){dataMap.get(name1Value).put(name2Value,value);}else{HashMap<String, String> name1Data = new HashMap<>();name1Data.put(name2Value,value);dataMap.put(name1Value,name1Data);}}for(int i =0; i<legend.size(); i++){yAxis.add(new ArrayList<String>());}Set<String> keys = dataMap.keySet();for(String key:keys){xAxis.add(key);HashMap<String, String> map = dataMap.get(key);for(int i =0; i<legend.size(); i++){List<String> data = yAxis.get(i);if(StringUtil.isNotEmpty(map.get(legend.get(i)))){data.add(map.get(legend.get(i)));}else{data.add("0");}}}System.out.println();Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}/*** 柱状图统计双列* @return*/@RequestMapping("/barCountTwo")public R barCountTwo(@RequestParam Map<String,Object> params) {logger.debug("柱状图统计双列:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.barCountTwo(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();for(Map<String, Object> map :result){String name1Value = String.valueOf(map.get("name1"));String name2Value = String.valueOf(map.get("name2"));String value = String.valueOf(map.get("value"));if(!legend.contains(name2Value)){legend.add(name2Value);//添加完成后 就是最全的第二列的类型}if(dataMap.containsKey(name1Value)){dataMap.get(name1Value).put(name2Value,value);}else{HashMap<String, String> name1Data = new HashMap<>();name1Data.put(name2Value,value);dataMap.put(name1Value,name1Data);}}for(int i =0; i<legend.size(); i++){yAxis.add(new ArrayList<String>());}Set<String> keys = dataMap.keySet();for(String key:keys){xAxis.add(key);HashMap<String, String> map = dataMap.get(key);for(int i =0; i<legend.size(); i++){List<String> data = yAxis.get(i);if(StringUtil.isNotEmpty(map.get(legend.get(i)))){data.add(map.get(legend.get(i)));}else{data.add("0");}}}System.out.println();Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}/**tableName 查询表condition1 条件1condition1Value 条件1值average 计算平均评分取值有值 Number(res.data.value.toFixed(1))无值 if(res.data){}* */@IgnoreAuth@RequestMapping("/queryScore")public R queryScore(@RequestParam Map<String, Object> params) {logger.debug("queryScore:,,Controller:{},,params:{}",this.getClass().getName(),params);Map<String, Object> queryScore = commonService.queryScore(params);return R.ok().put("data", queryScore);}/*** 查询字典表的分组统计总条数*  tableName  		表名*	groupColumn  	分组字段* @return*/@RequestMapping("/newSelectGroupCount")public R newSelectGroupCount(@RequestParam Map<String,Object> params) {logger.debug("newSelectGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.newSelectGroupCount(params);return R.ok().put("data", result);}/*** 查询字典表的分组求和* tableName  		表名* groupColumn  		分组字段* sumCloum			统计字段* @return*/@RequestMapping("/newSelectGroupSum")public R newSelectGroupSum(@RequestParam Map<String,Object> params) {logger.debug("newSelectGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.newSelectGroupSum(params);return R.ok().put("data", result);}/*** 柱状图求和 老的*/@RequestMapping("/barSum")public R barSum(@RequestParam Map<String,Object> params) {logger.debug("barSum方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));Boolean isJoinTableFlag =  false;//是否有级联表相关String one =  "";//第一优先String two =  "";//第二优先//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组//当前表Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);params.put("thisTable",thisTable);//级联表String joinTableString = String.valueOf(params.get("joinTable"));if(StringUtil.isNotEmpty(joinTableString)) {Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);params.put("joinTable", joinTable);isJoinTableFlag = true;}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));one = "thisDate0";}if(isJoinTableFlag){//级联表日期Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));if(StringUtil.isEmpty(one)){one ="joinDate0";}else{if(StringUtil.isEmpty(two)){two ="joinDate0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="thisString0";}else{if(StringUtil.isEmpty(two)){two ="thisString0";}}}if(isJoinTableFlag){//级联表字符串Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="joinString0";}else{if(StringUtil.isEmpty(two)){two ="joinString0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="thisTypes0";}else{if(StringUtil.isEmpty(two)){two ="thisTypes0";}}}if(isJoinTableFlag){//级联表类型Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="joinTypes0";}else{if(StringUtil.isEmpty(two)){two ="joinTypes0";}}}}List<Map<String, Object>> result = commonService.barSum(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题if(StringUtil.isEmpty(two)){//不包含第二列List<String> yAxis0 = new ArrayList<>();yAxis.add(yAxis0);legend.add("");for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String value = String.valueOf(map.get("value"));xAxis.add(oneValue);yAxis0.add(value);}}else{//包含第二列Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();if(StringUtil.isNotEmpty(two)){for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String twoValue = String.valueOf(map.get(two));String value = String.valueOf(map.get("value"));if(!legend.contains(twoValue)){legend.add(twoValue);//添加完成后 就是最全的第二列的类型}if(dataMap.containsKey(oneValue)){dataMap.get(oneValue).put(twoValue,value);}else{HashMap<String, String> oneData = new HashMap<>();oneData.put(twoValue,value);dataMap.put(oneValue,oneData);}}}for(int i =0; i<legend.size(); i++){yAxis.add(new ArrayList<String>());}Set<String> keys = dataMap.keySet();for(String key:keys){xAxis.add(key);HashMap<String, String> map = dataMap.get(key);for(int i =0; i<legend.size(); i++){List<String> data = yAxis.get(i);if(StringUtil.isNotEmpty(map.get(legend.get(i)))){data.add(map.get(legend.get(i)));}else{data.add("0");}}}System.out.println();}Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}/*** 柱状图统计 老的*/@RequestMapping("/barCount")public R barCount(@RequestParam Map<String,Object> params) {logger.debug("barCount方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));Boolean isJoinTableFlag =  false;//是否有级联表相关String one =  "";//第一优先String two =  "";//第二优先//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组//当前表Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);params.put("thisTable",thisTable);//级联表String joinTableString = String.valueOf(params.get("joinTable"));if(StringUtil.isNotEmpty(joinTableString)) {Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);params.put("joinTable", joinTable);isJoinTableFlag = true;}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));one = "thisDate0";}if(isJoinTableFlag){//级联表日期Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));if(StringUtil.isEmpty(one)){one ="joinDate0";}else{if(StringUtil.isEmpty(two)){two ="joinDate0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="thisString0";}else{if(StringUtil.isEmpty(two)){two ="thisString0";}}}if(isJoinTableFlag){//级联表字符串Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="joinString0";}else{if(StringUtil.isEmpty(two)){two ="joinString0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="thisTypes0";}else{if(StringUtil.isEmpty(two)){two ="thisTypes0";}}}if(isJoinTableFlag){//级联表类型Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="joinTypes0";}else{if(StringUtil.isEmpty(two)){two ="joinTypes0";}}}}List<Map<String, Object>> result = commonService.barCount(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题if(StringUtil.isEmpty(two)){//不包含第二列List<String> yAxis0 = new ArrayList<>();yAxis.add(yAxis0);legend.add("");for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String value = String.valueOf(map.get("value"));xAxis.add(oneValue);yAxis0.add(value);}}else{//包含第二列Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();if(StringUtil.isNotEmpty(two)){for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String twoValue = String.valueOf(map.get(two));String value = String.valueOf(map.get("value"));if(!legend.contains(twoValue)){legend.add(twoValue);//添加完成后 就是最全的第二列的类型}if(dataMap.containsKey(oneValue)){dataMap.get(oneValue).put(twoValue,value);}else{HashMap<String, String> oneData = new HashMap<>();oneData.put(twoValue,value);dataMap.put(oneValue,oneData);}}}for(int i =0; i<legend.size(); i++){yAxis.add(new ArrayList<String>());}Set<String> keys = dataMap.keySet();for(String key:keys){xAxis.add(key);HashMap<String, String> map = dataMap.get(key);for(int i =0; i<legend.size(); i++){List<String> data = yAxis.get(i);if(StringUtil.isNotEmpty(map.get(legend.get(i)))){data.add(map.get(legend.get(i)));}else{data.add("0");}}}System.out.println();}Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}
}

这篇关于springboot大学生体质测试管理系统源码和论文的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/737844

相关文章

JVM 的类初始化机制

前言 当你在 Java 程序中new对象时,有没有考虑过 JVM 是如何把静态的字节码(byte code)转化为运行时对象的呢,这个问题看似简单,但清楚的同学相信也不会太多,这篇文章首先介绍 JVM 类初始化的机制,然后给出几个易出错的实例来分析,帮助大家更好理解这个知识点。 JVM 将字节码转化为运行时对象分为三个阶段,分别是:loading 、Linking、initialization

Spring Security 基于表达式的权限控制

前言 spring security 3.0已经可以使用spring el表达式来控制授权,允许在表达式中使用复杂的布尔逻辑来控制访问的权限。 常见的表达式 Spring Security可用表达式对象的基类是SecurityExpressionRoot。 表达式描述hasRole([role])用户拥有制定的角色时返回true (Spring security默认会带有ROLE_前缀),去

浅析Spring Security认证过程

类图 为了方便理解Spring Security认证流程,特意画了如下的类图,包含相关的核心认证类 概述 核心验证器 AuthenticationManager 该对象提供了认证方法的入口,接收一个Authentiaton对象作为参数; public interface AuthenticationManager {Authentication authenticate(Authenti

Spring Security--Architecture Overview

1 核心组件 这一节主要介绍一些在Spring Security中常见且核心的Java类,它们之间的依赖,构建起了整个框架。想要理解整个架构,最起码得对这些类眼熟。 1.1 SecurityContextHolder SecurityContextHolder用于存储安全上下文(security context)的信息。当前操作的用户是谁,该用户是否已经被认证,他拥有哪些角色权限…这些都被保

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

Java架构师知识体认识

源码分析 常用设计模式 Proxy代理模式Factory工厂模式Singleton单例模式Delegate委派模式Strategy策略模式Prototype原型模式Template模板模式 Spring5 beans 接口实例化代理Bean操作 Context Ioc容器设计原理及高级特性Aop设计原理Factorybean与Beanfactory Transaction 声明式事物

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

Java进阶13讲__第12讲_1/2

多线程、线程池 1.  线程概念 1.1  什么是线程 1.2  线程的好处 2.   创建线程的三种方式 注意事项 2.1  继承Thread类 2.1.1 认识  2.1.2  编码实现  package cn.hdc.oop10.Thread;import org.slf4j.Logger;import org.slf4j.LoggerFactory

字节面试 | 如何测试RocketMQ、RocketMQ?

字节面试:RocketMQ是怎么测试的呢? 答: 首先保证消息的消费正确、设计逆向用例,在验证消息内容为空等情况时的消费正确性; 推送大批量MQ,通过Admin控制台查看MQ消费的情况,是否出现消费假死、TPS是否正常等等问题。(上述都是临场发挥,但是RocketMQ真正的测试点,还真的需要探讨) 01 先了解RocketMQ 作为测试也是要简单了解RocketMQ。简单来说,就是一个分