当前位置: 首页 > news >正文

springboo冬奥会科普平台源码和论文

随着信息技术和网络技术的飞速发展,人类已进入全新信息化时代,传统管理技术已无法高效,便捷地管理信息。为了迎合时代需求,优化管理效率,各种各样的管理平台应运而生,各行各业相继进入信息管理时代,冬奥会科普平台就是信息时代变革中的产物之一。

任何平台都要遵循平台设计的基本流程,本平台也不例外,同样需要经过市场调研,需求分析,概要设计,详细设计,编码,测试这些步骤,基于java语言设计并实现了冬奥会科普平台。该平台基于B/S即所谓浏览器/服务器模式,应用java技术,选择MySQL作为后台数据库。平台主要包括平台首页,个人中心,用户管理,项目类型管理,冬奥会项目管理,精彩视频管理,冬奥论坛,系统管理等功能模块。

本文首先介绍了冬奥会科普管理的技术发展背景与发展现状,然后遵循软件常规开发流程,首先针对平台选取适用的语言和开发平台,根据需求分析制定模块并设计数据库结构,再根据平台总体功能模块的设计绘制平台的功能模块图,流程图以及E-R图。然后,设计框架并根据设计的框架编写代码以实现平台的各个功能模块。最后,对初步完成的平台进行测试,主要是功能测试、单元测试和性能测试。测试结果表明,该平台能够实现所需的功能,运行状况尚可并无明显缺点

关键词:冬奥会科普;java;MySQL数据库

springboo冬奥会科普平台源码和论文362

演示视频:

springboo冬奥会科普平台源码和论文


Abstract

With the rapid development of information technology and network technology, human beings have entered a new information age, traditional management technology has been unable to efficiently and conveniently manage information. In order to meet the needs of The Times and optimize management efficiency, a variety of management platforms have emerged, and all walks of life have entered the information management era. The Popular science platform of the Winter Olympics is one of the products in the information era.

Any platform should follow the basic process of platform design, and this platform is no exception. It also needs to go through the steps of market research, demand analysis, outline design, detailed design, coding and testing. Based on Java language, the Popular science platform of winter Olympics is designed and implemented. The platform is based on THE B/S browser/server mode, the application of Java technology, MySQL as the background database. The platform mainly includes the platform home page, personal center, user management, project type management, Winter Olympics project management, highlight video management, Winter Olympics forum, system management and other functional modules.

This article first introduces the winter Olympics technology development background and current situation of the development of science management, and then follow the routine software development process, the first platform for the selection of suitable language and development platform, according to the requirement analysis module and database structure design, and according to the overall function module design rendering platform platform function module chart, flow diagram and e-r diagram. Then, the framework is designed and the code is written according to the designed framework to realize the various functional modules of the platform. Finally, the preliminarily completed platform is tested, mainly functional test, unit test and performance test. The test results show that the platform can achieve the required functions, the operating condition is fair and there are no obvious shortcomings.

Key words: Winter Olympics science popularization; Java; The MySQL database

本平台采用的是MySQL数据库存储数据,平台中使用到的主要数据表的具体展示部分如下所示。

表4-1token表

字段名称

类型

长度

字段说明

主键

默认值

id

bigint

主键

主键

userid

bigint

用户id

username

varchar

100

用户名

tablename

varchar

100

表名

role

varchar

100

角色

token

varchar

200

密码

addtime

timestamp

新增时间

CURRENT_TIMESTAMP

expiratedtime

timestamp

过期时间

CURRENT_TIMESTAMP

表4-2收藏表

字段名称

类型

长度

字段说明

主键

默认值

id

bigint

主键

主键

addtime

timestamp

创建时间

CURRENT_TIMESTAMP

userid

bigint

用户id

refid

bigint

收藏id

tablename

varchar

200

表名

name

varchar

200

收藏名称

picture

varchar

200

收藏图片

type

varchar

200

类型(1:收藏,21:赞,22:踩)

1

inteltype

varchar

200

推荐类型

表4-3冬奥新闻

字段名称

类型

长度

字段说明

主键

默认值

id

bigint

主键

主键

addtime

timestamp

创建时间

CURRENT_TIMESTAMP

title

varchar

200

标题

introduction

longtext

4294967295

简介

picture

varchar

200

图片

content

longtext

4294967295

内容

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

相关文章:

springboo冬奥会科普平台源码和论文

随着信息技术和网络技术的飞速发展&#xff0c;人类已进入全新信息化时代&#xff0c;传统管理技术已无法高效&#xff0c;便捷地管理信息。为了迎合时代需求&#xff0c;优化管理效率&#xff0c;各种各样的管理平台应运而生&#xff0c;各行各业相继进入信息管理时代&#xf…...

改进神经网络

Improve NN 文章目录 Improve NNtrain/dev/test setBias/Variancebasic recipeRegularizationLogistic RegressionNeural networkother ways optimization problemNormalizing inputsvanishing/exploding gradientsweight initializegradient checkNumerical approximationgrad…...

HarmonyOS 开发学习笔记

HarmonyOS 开发学习笔记 一、开发准备1.1、了解ArkTs语言1.2、TypeScript语法1.2.1、变量声明1.2.2、条件控制1.2.3、函数1.2.4、类和接口1.2.5、模块开发 1.3、快速入门 二、ArkUI组件2.1、Image组件2.2、Text文本显示组件2.3、TextInput文本输入框组件2.4、Button按钮组件2.5…...

maven java 如何打纯源码zip包

一、背景 打纯源码包给第三方进行安全漏洞扫描 二、maven插件 项目中加入下面的maven 插件 <!-- 要将源码放上去&#xff0c;需要加入这个插件 --><plugin><artifactId>maven-source-plugin</artifactId><version>2.4</version><con…...

Altium Designer(AD)原理图库添加阵列管脚图文教程及视频演示

🏡《专栏目录》 目录 视频演示1,概述2,添加方法3,总结视频演示 Altium Designer(AD24)原理图库添加阵列管脚 欢迎点击浏览更多高清视频演示 1,概述...

P3647 题解

文章目录 P3647 题解OverviewDescriptionSolutionLemmaProof Main Code P3647 题解 Overview 很好的题&#xff0c;但是难度较大。 模拟小数据&#xff01;——【数据删除】 Description 给定一颗树&#xff0c;有边权&#xff0c;已知这棵树是由这两个操作得到的&#xff1…...

Vivado Tri-MAC IP的例化配置(三速以太网IP)

目录 1 Tri-MAC IP使用RGMII接口的例化配置1.1 Data Rate1.2 interface配置1.3 Shared Logic配置1.4 Features 2 配置完成IP例化视图 1 Tri-MAC IP使用RGMII接口的例化配置 在网络设计中&#xff0c;使用的IP核一般为三速以太网IP核&#xff0c;使用时在大多数场景下为配置为三…...

交友系统---让陌生人变成熟悉人的过程。APP小程序H5三端源码交付,支持二开。

随着社交网络的发展和普及&#xff0c;人们之间的社交模式正在发生着深刻的变革。传统的线下交友方式已经逐渐被线上交友取而代之。而同城交友正是这一趋势的产物&#xff0c;它利用移动互联网的便利性&#xff0c;将同城内的人们连接在一起&#xff0c;打破了时空的限制&#…...

uni-app 经验分享,从入门到离职(三)——关于 uni-app 生命周期快速了解上手

文章目录 &#x1f4cb;前言⏬关于专栏 &#x1f3af;什么是生命周期&#x1f9e9;应用生命周期&#x1f4cc; 关于 App.vue/App.uvue &#x1f9e9;页面生命周期&#x1f4cc;关于 onShow 与 onLoad 的区别 &#x1f9e9;组件生命周期 &#x1f4dd;最后 &#x1f4cb;前言 这…...

PostgreSQL 与 MySQL 相比,优势何在?

我们将通过一张对比表格详细列出 PostgreSQL 与 MySQL 在不同方面的对比&#xff1a; 对比表格 特性/数据库PostgreSQLMySQL数据类型支持支持JSON/JSONB、数组、区间等高级数据类型基本数据类型支持&#xff0c;JSON支持较普通遵循SQL标准更严格遵循&#xff0c;支持复杂查询…...

Linux(三)--文件系统

Linux命令简介 [rootlocalhost ~]# 表示 Linux 系统的命令提示符。 []&#xff1a;这是提示符的分隔符号&#xff0c;没有特殊含义。 root&#xff1a;显示的是当前的登录用户&#xff0c;笔者现在使用的是 root 用户登录。 &#xff1a;分隔符号&#xff0c;没有特殊含义。 l…...

DC-8靶机渗透详细流程

信息收集&#xff1a; 1.存活扫描&#xff1a; arp-scan -I eth0 -l └─# arp-scan -I eth0 -l Interface: eth0, type: EN10MB, MAC: 00:0c:29:dd:ee:6a, IPv4: 192.168.10.129 Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan) 192.168.10…...

SolidWorks学习笔记——入门知识2

目录 建出第一个模型 1、建立草图 2、选取中心线 3、草图绘制 4、拉伸 特征的显示与隐藏 改变特征名称 5、外观 6、渲染 建出第一个模型 1、建立草图 图1 建立草图 按需要选择基准面。 2、选取中心线 图2 选取中心线 3、草图绘制 以对称图形举例&#xff0c;先画出…...

Elasticsearch:通过 ingest pipeline 对大型文档进行分块

在我之前的文章 “Elasticsearch&#xff1a;使用 LangChain 文档拆分器进行文档分块” 中&#xff0c;我详述了如何通过 LangChain 对大的文档进行分块。那个分块的动作是通过 LangChain 在 Python 中进行实现的。对于使用版权的开发者来说&#xff0c;我们实际上是可以通过 i…...

数据库管理-第148期 最强Oracle监控EMCC深入使用-05(20240208)

数据库管理148期 2024-02-08 数据库管理-第148期 最强Oracle监控EMCC深入使用-05&#xff08;20240208&#xff09;1 性能主页2 ADDM Spotlight3 实时ADDM4 数据库的其他5 主机总结 数据库管理-第148期 最强Oracle监控EMCC深入使用-05&#xff08;20240208&#xff09; 作者&am…...

Bug2- Hive元数据启动报错:主机被阻止因连接错误次数过多

错误代码&#xff1a; 在启动Hive元数据时&#xff0c;遇到了以下错误信息&#xff1a; Caused by: java.sql.SQLException: null, message from server: "Host 192.168.252.101 is blocked because of many connection errors, unblock with mysqladmin flush-hosts&qu…...

HarmonyOS 鸿蒙应用开发(十、第三方开源js库移植适配指南)

在前端和nodejs的世界里&#xff0c;有很多开源的js库&#xff0c;通过npm(NodeJS包管理和分发工具)可以安装使用众多的开源软件包。但是由于OpenHarmony开发框架中的API不完全兼容V8运行时的Build-In API&#xff0c;因此三方js库大都需要适配下才能用。 移植前准备 建议在适…...

Docker- chapter 1

note 1: docker 利用 volume 进行 presist data。 eg : compose.yaml&#xff1a; volumes:database: //# named db by self list golbal volumes&#xff1a; docker volume ls # the volumes on the disk inpect someone volume&#xff1a; docker volume inspect m…...

解决IntellIJ Idea内存不足

突然有一天我在IDEA打开两个项目时&#xff0c;发生了报错&#xff0c;说我内存不足&#xff0c;我这电脑内存16G怎么会内存不足。下面是我的解决方案。 IntelliJ IDEA 报告内存不足的原因通常与以下几个因素有关&#xff1a; 项目规模较大&#xff1a;如果您正在开发的项目非…...

【网络技术】【Kali Linux】Nmap嗅探(二)多设备扫描

上期实验博文&#xff1a;&#xff08;一&#xff09;简单扫描 一、实验环境 本次实验进行Nmap多设备扫描&#xff0c;实验使用 Kali Linux 虚拟机&#xff08;扫描端&#xff09;、Ubuntu 22.04虚拟机&#xff08;被扫描端1&#xff09;、Ubuntu 18.04虚拟机&#xff08;被扫…...

简化版SpringMVC

简化版SpringMVC web.xml xml version"1.0" encoding"UTF-8"?> <web-app version"2.5" xmlns"http://java.sun.com/xml/ns/javaee" xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation&quo…...

Java密码校验(正则表达式):密码由这四种元素组成(数字、大写字母、小写字母、特殊字符),且必须包含全部四种元素;密码长度大于等于8个字符。

1. 需求 对用户密码的强度进行校验&#xff0c;要求用户密码达到一定的强度&#xff0c;符合安全性要求。 1.1. 基础版需求 密码必须由字母和数字组成&#xff08;同时包括数字和数字&#xff09;&#xff1b;密码长度大于等于8个字符。 1.2. 进阶版需求 密码由这四种元素…...

【AMI】2400 环境安装步骤

2400 环境安装步骤 ----------Ubuntu14.4 MDS4.0 加载代码需要勾上Update Installing SPX related packages sudo apt install gcc-multilib mtd-utils:i386 subversion patch patchutils bison sudo apt install libc6-dev libxml-dom-perl zlib1g zlib1g-dev libcurl4-ope…...

AI:124-基于深度学习的人体遮挡物体重建技术

🚀点击这里跳转到本专栏,可查阅专栏顶置最新的指南宝典~ 🎉🎊🎉 你的技术旅程将在这里启航! 从基础到实践,深入学习。无论你是初学者还是经验丰富的老手,对于本专栏案例和项目实践都有参考学习意义。 ✨✨✨ 每一个案例都附带有在本地跑过的关键代码,详细讲解供…...

23种设计模式之单例模式

目录 什么是单例模式 单例模式的优点 创建单例模式的三大要点 单例模式的实现方式 饿汉模式 懒汉模式 使用场景 什么是单例模式 单例模式是一种创建型设计模式&#xff0c;它的核心思想是保证一个类只有一个实例&#xff0c;并提供一个全局访问点来访问这个实例。 什…...

leetCode 30天

题太难了&#xff0c;就来一个N皇后吧 51. N 皇后 class Solution { private:vector<vector<string>> res;void backtracking(int n, int row, vector<string>& chessboard){if (row n){res.push_back(chessboard);return;}for (int col 0; col<n;…...

vue3+vite+ts 配置commit强制码提交规范配置 commitlint

配置 git 提交时的 commit 信息&#xff0c;统一提交 git 提交规范 安装命令: npm install -g commitizen npm i cz-customizable npm i commitlint/config-conventional commitlint/cli -D 文件配置 根路径创建文件 commitlint.config.js module.exports {// 继承的规…...

PlateUML绘制UML图教程

UML&#xff08;Unified Modeling Language&#xff09;是一种通用的建模语言&#xff0c;广泛用于软件开发中对系统进行可视化建模。PlantUML是一款强大的工具&#xff0c;通过简单的文本描述&#xff0c;能够生成UML图&#xff0c;包括类图、时序图、用例图等。PlantUML是一款…...

自然语言处理(NLP)——使用Rasa创建聊天机器人

1 基本概念 1.1 自然语言处理的分类 IR-BOT&#xff1a;检索型问答系统 Task-bot&#xff1a;任务型对话系统 Chitchat-bot:闲聊系统 1.2 任务型对话Task-Bot:task-oriented bot 这张图展示了一个语音对话系统&#xff08;或聊天机器人&#xff09;的基本组成部分和它们之间的…...

使用虚拟主机部署多站点

网站目录权限的管理和虚拟主机的配置。 目录权限控制...

Openresty+Lua+Redis实现高性能缓存

一、背景 当我们的程序需要提供较高的并发访问时&#xff0c;往往需要在程序中引入缓存技术&#xff0c;通常都是使用Redis作为缓存&#xff0c;但是要再更进一步提升性能的话&#xff0c;就需要尽可能的减少请求的链路长度&#xff0c;比如可以将访问Redis缓存从Tomcat服务器…...

基于Vue2用keydown、keyup事件实现长按键盘任意键(或组合键)3秒触发自定义事件(以F1键为例)

核心代码 <template></template> <script> export default {created() {//监听长按快捷键addEventListener("keydown", this.keydown);addEventListener("keyup", this.keyup);},destroyed(d) {//移除长按快捷键removeEventListener(&…...

【C#】.net core 6.0 设置根目录下某个文件夹可访问,访问创建的图片等资源

欢迎来到《小5讲堂》 大家好&#xff0c;我是全栈小5。 这是《C#》系列文章&#xff0c;每篇文章将以博主理解的角度展开讲解&#xff0c; 特别是针对知识点的概念进行叙说&#xff0c;大部分文章将会对这些概念进行实际例子验证&#xff0c;以此达到加深对知识点的理解和掌握。…...

报错ValueError: Unknown CUDA arch (8.6) or GPU not supported

文章目录 问题描述解决方案参考文献 问题描述 报错 ValueError: Unknown CUDA arch (8.6) or GPU not supported 本人显卡为 RTX 3060&#xff0c;CUDA 为 10.2&#xff0c;PyTorch 为 1.5 解决方案 修改 C:\Users\Administrator\Envs\test\Lib\site-packages\torch\utils\c…...

Golang 并发 Cond条件变量

Golang 并发 Cond条件变量 背景 编写代码过程中&#xff0c; 通常有主协程和多个子协程进行协作的过程&#xff0c;比如通过 WaitGroup 可以实现当所有子协程完成之后&#xff0c; 主协程再继续执行。 如上的场景是主协程等待子协程达到某个状态再继续运行。 但是反过来怎么…...

linux 下 chrome 无法在设置里面配置代理的解决方法

文章目录 [toc]解决方法查找 chrome 命令路径查看 chrome 启动文件方式一方法二 在 linux 环境下&#xff0c;使用 chrome 没办法像 firefox 一样在设置里面配置代理&#xff0c;打开 chrome 的设置会有下面的内容显示 When running Google Chrome under a supported desktop e…...

C#上位机与三菱PLC的通信03--MC协议之A-1E报文解析

1、MC协议帧 MC协议可以在串口通信&#xff0c;也可以在以太网通信&#xff0c;有A-1E和Qna-3E两种模式&#xff0c;这两种都是三菱PLC通信协议中比较常用的两种&#xff0c;一般我们使用比较多的是以太网通信&#xff0c;对于FX5U系列/Q系列/Qna系列/L系列的PLC&#xff0c;…...

nodeJS 的 npm 设置国内高速镜像之淘宝镜像的方法

1、我们知道 nodeJS 是老外搞出来的&#xff0c;服务器放在了国外&#xff0c;国内的小朋友访问起来会比较慢&#xff0c;阿里巴巴的淘宝给出了有力支持&#xff0c;现在我们就将 nodeJS 的镜像地址切换为国内的淘宝镜像。 2、查看当前的镜像地址&#xff1a; npm get registr…...

Nginx方向代理和负载均衡配置

1. Nginx介绍 2.Nginx常用命令 cd /usr/local/nginx/sbin/ ./nginx 启动 ./nginx -s stop 停止 ./nginx -s quit 安全退出 ./nginx -s reload 重新加载配置文件 如果我们修改了配置文件&#xff0c;就需要重新加载。 ps aux|grep nginx 查看nginx进程3.nginx配置文件 …...

贪心算法篇

“靠漫步&#xff0c;将生趣填饱~” 贪心算法简介&#xff1f; 贪心算法&#xff08;Greedy Algorithm&#xff09;&#xff0c;也称为贪婪算法&#xff0c;是一种在解决问题时采取贪心策略的方法。其基本原理是很简单的&#xff1a; “在每个决策点上都选择当下看似最好的选项…...

springboot/ssm大学生就业服务平台就业招聘宣传管理系统Java系统

springboot(ssm大学生就业服务平台 就业招聘宣传管理系统Java系统 开发语言&#xff1a;Java 框架&#xff1a;springboot&#xff08;可改ssm&#xff09; vue JDK版本&#xff1a;JDK1.8&#xff08;或11&#xff09; 服务器&#xff1a;tomcat 数据库&#xff1a;mysql…...

上下固定中间自适应布局

实现上下固定中间自适应布局 1.通过position&#xff1a;absolute实现 定义如下结构 <body> <div class"container"> <div class"top"></div> <div class"center"></div> <div class"bottom&…...

3分钟部署完成Docker Registry及可视化管理工具Docker-UI

安装docker-registry 由于镜像文件会非常占用空间&#xff0c;因此需要选择一个磁盘充裕的位置来存放镜像数据。 这里设置为&#xff1a;-v /data/registry:/var/lib/registry&#xff0c;其中/data/registry是宿主机存放数据的位置。 docker run -d -p 5000:5000 --restart…...

【npm】修改npm全局安装包的位置路径

问题 全局安装的默认安装路径为&#xff1a;C:\Users\admin\AppData\Roaming\npm&#xff0c;缓存路径为&#xff1a;C:\Users\admin\AppData\Roaming\npm_cache&#xff08;其中admin为自己的用户名&#xff09;。 由于默认的安装路径在C盘&#xff0c;太浪费C盘内存啦&#…...

数据库切片大对决:ShardingSphere与Mycat技术解析

欢迎来到我的博客&#xff0c;代码的世界里&#xff0c;每一行都是一个故事 数据库切片大对决&#xff1a;ShardingSphere与Mycat技术解析 前言ShardingSphere与Mycat简介工作原理对比功能特性对比 前言 在数据库的舞台上&#xff0c;有两位颇受欢迎的明星&#xff0c;它们分别…...

macbook电脑如何永久删除app软件?

在使用MacBook的过程中&#xff0c;我们经常会下载各种App来满足日常的工作和娱乐需求。然而&#xff0c;随着时间的积累&#xff0c;这些App不仅占据了宝贵的硬盘空间&#xff0c;还可能拖慢电脑的运行速度。那么&#xff0c;如何有效地管理和删除这些不再需要的App呢&#xf…...

安卓——计算器应用(Java)

步骤 1: 设置Android Studio项目 创建一个新的Android项目&#xff0c;选择Java作为编程语言。 步骤 2: 设计用户界面 打开activity_main.xml文件&#xff0c;在res/layout目录下&#xff0c;设计你的计算器用户界面。这个例子使用了LinearLayout来排列两个EditText输入框和…...

【笔记】Helm-5 Chart模板指南-8 命名模板

命名模板 此时需要越过模板&#xff0c;开始创建其他内容了。该部分我们会看到如何在一个文件中定义 命名模板&#xff0c;并在其他地方使用。命名模板&#xff08;有时称作一个部分或一个子模板&#xff09;仅仅是在文件内部定义的模板&#xff0c;并使用了一个名字。有两种创…...

Github 2024-02-08 开源项目日报 Top9

根据Github Trendings的统计&#xff0c;今日(2024-02-08统计)共有9个项目上榜。根据开发语言中项目的数量&#xff0c;汇总情况如下&#xff1a; 开发语言项目数量Ruby项目1HTML项目1Python项目1Scala项目1PLpgSQL项目1Rust项目1NASL项目1C项目1TypeScript项目1非开发语言项目…...

c语言贪食蛇游戏

演示视频 目录 一.概述 二.游戏开始前 修改控制台程序标题和大小 Win32 API GetStdHandle函数 GetConsoleCursorInfo函数和SetConsoleCursorInfo函数 SetConsoleCursorPosition函数 游戏开篇界面处理 创建地图 蛇身节点以及食物节点初始化 蛇身的初始化 整体蛇节点…...