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);}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:
http://www.pswp.cn/news/696293.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/696293.shtml
英文地址,請注明出處:http://en.pswp.cn/news/696293.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

圖像分類入門:使用Python和Keras實現卷積神經網絡

文章標題&#xff1a;圖像分類入門&#xff1a;使用Python和Keras實現卷積神經網絡 簡介 圖像分類是計算機視覺領域的一個重要任務&#xff0c;它涉及將圖像分成不同的類別或標簽。卷積神經網絡&#xff08;CNN&#xff09;是圖像分類任務中的一種常用模型&#xff0c;它能夠…

rust實戰系列十四:復合數據類型

復合數據類型可以在其他類型的基礎上形成更復雜的組合關系。 本章介紹tuple、struct、enum等幾種復合數據類型。數組留到第6章介紹。 2.3.1 tuple tuple指的是“元組”類型&#xff0c;它通過圓括號包含一組表達式構成。tuple內的元素沒 有名字。tuple是把幾個類型組合到一起的…

第三十九天| 62.不同路徑、63. 不同路徑 II

Leetcode 62.不同路徑 題目鏈接&#xff1a;62 不同路徑 題干&#xff1a;一個機器人位于一個 m x n 網格的左上角 &#xff08;起始點在下圖中標記為 “Start” &#xff09;。 機器人每次只能向下或者向右移動一步。機器人試圖達到網格的右下角&#xff08;在下圖中標記為 “…

c#之列表

// List<int> scoreList new List<int>();//創建空列表var scoreListnew List<int>();//匿名方式創建scoreList.Add(912);//插入數據scoreList.Add(45);scoreList.Add(415);scoreList.Add(452);scoreList.Add(4451);scoreList.Add(245);scoreList.Add(445);…

十六、多邊形填充和繪制

項目功能實現&#xff1a;對多邊形進行輪廓繪制和填充 按照之前的博文結構來&#xff0c;這里就不在贅述了 一、頭文件 mult-drawing.h #pragma once#include<opencv2/opencv.hpp>using namespace cv;class Mult_Drawing { public:void mult_drawing(); };#pragma onc…

vue如何動態加載顯示本地圖片資源

在實際開發中&#xff0c;根據某一個變量動態展示圖片的情況有很多。實現方法分打包構建工具的差異而不同。 1、webpack的項目 require引入圖片資源 2、vite的項目 new URL(url,base).href 疑問解答&#xff1a;為什么vite項目不可以用require&#xff1f; 原因在于&#xf…

Elastic Stack--01--簡介、安裝

提示&#xff1a;文章寫完后&#xff0c;目錄可以自動生成&#xff0c;如何生成可參考右邊的幫助文檔 文章目錄 1. Elastic Stack 簡介為什么要學習ESDB-Engines搜索引擎類數據庫排名常年霸榜![在這里插入圖片描述](https://img-blog.csdnimg.cn/direct/051342a83f574c8c910cda…

微信小程序獨立分包與分包預下載

官網鏈接 獨立分包配置方法 獨立分包使用限制 獨立分包中不能依賴主包和其他分包中的內容&#xff0c;包括 js 文件、模板、wxss、自定義組件等&#xff1b;App 只能在主包內定義&#xff0c;獨立分包中不能定義 App&#xff0c;會造成無法預期的行為獨立分包中暫時不支持使用…

cocos creator3.x項目打包成aar 加入到已有的Android工程

Cocos crearor版本&#xff1a; 3.4.2 Android Studio Flamingo | 2022.2.1 Patch 2 1、配置構建安卓項目 2、 運行編譯無報錯 出現問題可嘗試修改Gradle版本 修改jdk版本 3、對libservice打包成aar 打包完后 再build/outputs找到aar 如果看不到Tasks模塊&#xff0c;在Fil…

sqlserver觸發器

在SQL Server中&#xff0c;觸發器是一種特殊的數據庫對象&#xff0c;它們會在表上執行特定的操作時自動觸發。觸發器可以用于在表上插入、更新或刪除數據時執行自定義的邏輯。觸發器通常用于實施數據完整性約束、審計和日志記錄等操作。 觸發器有三種主要類型&#xff1a; 插…

人機交互新研究:MIT開發了結合腦電和眼電的新式眼鏡,與機器狗交互

還記得之前的AI讀心術嗎&#xff1f;最近&#xff0c;「心想事成」的能力再次進化&#xff0c; ——人類可以通過自己的想法直接控制機器人了&#xff01; 來自麻省理工的研究人員發表了Ddog項目&#xff0c;通過自己開發的腦機接口&#xff08;BCI&#xff09;設備&#xff…

面試答疑03

1、登錄鑒權怎么做的&#xff1f;為什么采用jwt的方式&#xff1f;有什么好處&#xff1f; Java登錄鑒權常見的實現方式包括**CookieSession、HTTP Basic Authentication、ServletJDBC**等。 在Java的Web應用中&#xff0c;登錄鑒權是確認用戶身份的關鍵環節。一個常用的傳統…

【Linux內核模塊加新功能 DAY6-8】

一、向內核添加新功能 1.1 靜態加載法&#xff1a; 即新功能源碼與內核其它代碼一起編譯進uImage文件內 新功能源碼與Linux內核源碼在同一目錄結構下在linux-3.14/driver/char/目錄下編寫myhello.c&#xff0c;文件內容如下&#xff1a;#include <linux/module.h> #inc…

Vue項目啟動過程全記錄(node.js運行環境搭建)

一、安裝node.js并配置環境變量 1、安裝node.js 從Node.js官網下載安裝包并安裝。然后在安裝后的目錄&#xff08;如果是下載的壓縮文件&#xff0c;則是解壓縮的目錄&#xff09;下新建node_global和node_cache這兩個文件夾。 node_global&#xff1a;npm全局安裝位置 node_…

Golang 中 NATS JetStream 的高級特性有哪些?

NATS JetStream 是 NATS 消息系統的一個高級功能模塊&#xff0c;提供了許多高級特性&#xff0c;使得它在處理消息時更加靈活、可靠和高效。以下是 NATS JetStream 的一些高級特性&#xff1a; 持久化消息存儲&#xff1a;NATS JetStream 使用持久化存儲引擎&#xff0c;可以確…

代碼隨想錄三刷day06

提示&#xff1a;文章寫完后&#xff0c;目錄可以自動生成&#xff0c;如何生成可參考右邊的幫助文檔 文章目錄 前言一、力扣203. 移除鏈表元素二、力扣707. 設計鏈表三、力扣 前言 遞歸法相對抽象一些&#xff0c;但是其實和雙指針法是一樣的邏輯&#xff0c;同樣是當cur為空的…

機器學習面試:邏輯回歸與樸素貝葉斯區別

邏輯回歸與樸素貝葉斯區別有以下幾個方面: (1)邏輯回歸是判別模型&#xff0c;樸素貝葉斯是生成模型&#xff0c;所以生成和判別的所有區別它們都有。 (2)樸素貝葉斯屬于貝葉斯&#xff0c;邏輯回歸是最大似然&#xff0c;兩種概率哲學間的區別。 (3)樸素貝葉斯需要條件獨立假設…

【刷題】牛客 JZ64 求1+2+3+...+n

刷題 題目描述思路一 &#xff08;暴力遞歸版&#xff09;思路二 &#xff08;妙用內存版&#xff09;思路三 &#xff08;快速乘法版&#xff09;思路四 &#xff08;構造巧解版&#xff09;Thanks?(&#xff65;ω&#xff65;)&#xff89;謝謝閱讀&#xff01;&#xff01…

力扣49.字母異位詞分組

題目描述&#xff1a; 49. 字母異位詞分組 難度 中等 給你一個字符串數組&#xff0c;請你將 字母異位詞 組合在一起。可以按任意順序返回結果列表。 字母異位詞 是由重新排列源單詞的所有字母得到的一個新單詞。 示例 1: 輸入: strs ["eat", "tea"…

在Linux中查找大文件

在Linux中查找大文件&#xff0c;你可以使用find命令結合其他工具&#xff08;如sort和du&#xff09;來實現。以下是一些常見的方法&#xff1a; 1. 使用find命令查找大文件 你可以使用find命令來查找特定大小以上的文件。例如&#xff0c;要查找當前目錄及其子目錄中大小超…