基于springboot篮球竞赛预约平台源码和论文

随着信息化时代的到来,管理系统都趋向于智能化、系统化,篮球竞赛预约平台也不例外,但目前国内仍都使用人工管理,市场规模越来越大,同时信息量也越来越庞大,人工管理显然已无法应对时代的变化,而篮球竞赛预约平台能很好地解决这一问题,轻松应对篮球竞赛预约平时的工作,既能提高人力物力财力,又能加快工作的效率,取代人工管理是必然趋势。

本篮球竞赛预约平台以springboot作为框架,b/s模式以及MySql作为后台运行的数据库,同时使用Tomcat用为系统的服务器。本系统主要包括首页,个人中心,用户管理,项目分类管理,竞赛项目管理,赛事预约管理,系统管理等功能,通过这些功能的实现基本能够满足日常篮球竞赛预约管理的操作。

本文着重阐述了篮球竞赛预约平台的分析、设计与实现,首先介绍开发系统和环境配置、数据库的设计,接着说明功能模块的详细实现,最后进行了总结。

关键词:篮球竞赛预约; springboot;MySql数据库;Tomcat;

基于springboot篮球竞赛预约平台源码和论文357


Abstract

With the advent of the era of information technology, management systems tend to be intelligent, systematic, basketball competition platform an appointment is not exceptional also, but at present domestic still use manual management, the size of the market is more and more big, at the same time, the amount of information is becoming more and more big, artificial management has clearly unable to cope with the changes of The Times, and basketball competition booking platform can well solve the problem, It is an inevitable trend to easily cope with the usual work of basketball game appointment, which can not only improve human and material resources and financial resources, but also speed up the efficiency of work, replacing manual management.

This basketball game booking platform uses Springboot as the framework, B/S mode and MySql as the background database, and Tomcat as the server of the system. This system mainly includes home page, personal center, user management, project classification management, competition project management, event reservation management, system management and other functions, through the realization of these functions can basically meet the operation of daily basketball competition reservation management.

This paper focuses on the analysis, design and implementation of basketball game booking platform, first introduces the development system and environment configuration, database design, then explains the detailed implementation of functional modules, and finally summarizes.

Key words: Basketball competition reservation; springboot; MySql database; Tomcat;


package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 公告资讯* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/news")
public class NewsController {private static final Logger logger = LoggerFactory.getLogger(NewsController.class);private static final String TABLE_NAME = "news";@Autowiredprivate NewsService newsService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//字典@Autowiredprivate ForumService forumService;//论坛@Autowiredprivate HuodongService huodongService;//活动@Autowiredprivate HuodongCollectionService huodongCollectionService;//活动收藏@Autowiredprivate HuodongLiuyanService huodongLiuyanService;//活动留言@Autowiredprivate HuodongYuyueService huodongYuyueService;//活动报名@Autowiredprivate SucaiService sucaiService;//图片素材@Autowiredprivate SucaiCollectionService sucaiCollectionService;//图片素材收藏@Autowiredprivate SucaiLiuyanService sucaiLiuyanService;//图片素材留言@Autowiredprivate SucaishipinService sucaishipinService;//视频素材@Autowiredprivate SucaishipinCollectionService sucaishipinCollectionService;//视频素材收藏@Autowiredprivate SucaishipinLiuyanService sucaishipinLiuyanService;//视频素材留言@Autowiredprivate YonghuService yonghuService;//用户@Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永不会进入");else if("用户".equals(role))params.put("yonghuId",request.getSession().getAttribute("userId"));CommonUtil.checkMap(params);PageUtils page = newsService.queryPage(params);//字典表数据转换List<NewsView> list =(List<NewsView>)page.getList();for(NewsView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put("data", page);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);NewsEntity news = newsService.selectById(id);if(news !=null){//entity转viewNewsView view = new NewsView();BeanUtils.copyProperties( news , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody NewsEntity news, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>().eq("news_name", news.getNewsName()).eq("news_types", news.getNewsTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());NewsEntity newsEntity = newsService.selectOne(queryWrapper);if(newsEntity==null){news.setInsertTime(new Date());news.setCreateTime(new Date());newsService.insert(news);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody NewsEntity news, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug("update方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());NewsEntity oldNewsEntity = newsService.selectById(news.getId());//查询原先数据String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");if("".equals(news.getNewsPhoto()) || "null".equals(news.getNewsPhoto())){news.setNewsPhoto(null);}newsService.updateById(news);//根据id更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids, HttpServletRequest request){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());List<NewsEntity> oldNewsList =newsService.selectBatchIds(Arrays.asList(ids));//要删除的数据newsService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");try {List<NewsEntity> newsList = new ArrayList<>();//上传的东西Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段Date date = new Date();int lastIndexOf = fileName.lastIndexOf(".");if(lastIndexOf == -1){return R.error(511,"该文件没有后缀");}else{String suffix = fileName.substring(lastIndexOf);if(!".xls".equals(suffix)){return R.error(511,"只支持后缀为xls的excel文件");}else{URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径File file = new File(resource.getFile());if(!file.exists()){return R.error(511,"找不到上传文件,请联系管理员");}else{List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行,因为第一行是提示for(List<String> data:dataList){//循环NewsEntity newsEntity = new NewsEntity();
//                            newsEntity.setNewsName(data.get(0));                    //公告标题 要改的
//                            newsEntity.setNewsTypes(Integer.valueOf(data.get(0)));   //公告类型 要改的
//                            newsEntity.setNewsPhoto("");//详情和图片
//                            newsEntity.setInsertTime(date);//时间
//                            newsEntity.setNewsContent("");//详情和图片
//                            newsEntity.setCreateTime(date);//时间newsList.add(newsEntity);//把要查询是否重复的字段放入map中}//查询是否重复newsService.insertBatch(newsList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));CommonUtil.checkMap(params);PageUtils page = newsService.queryPage(params);//字典表数据转换List<NewsView> list =(List<NewsView>)page.getList();for(NewsView c:list)dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段return R.ok().put("data", page);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);NewsEntity news = newsService.selectById(id);if(news !=null){//entity转viewNewsView view = new NewsView();BeanUtils.copyProperties( news , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody NewsEntity news, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>().eq("news_name", news.getNewsName()).eq("news_types", news.getNewsTypes())
//            .notIn("news_types", new Integer[]{102});logger.info("sql语句:"+queryWrapper.getSqlSegment());NewsEntity newsEntity = newsService.selectOne(queryWrapper);if(newsEntity==null){news.setInsertTime(new Date());news.setCreateTime(new Date());newsService.insert(news);return R.ok();}else {return R.error(511,"表中有相同数据");}}}

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
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 org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上传文件不能为空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);/*** 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开* 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径,* 并且项目路径不能存在中文、空格等特殊字符*/
//		FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下载文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    headers.setContentDispositionFormData("attachment", fileName);    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/451829.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

gif怎么压缩文件大小?这个方法一学就会

一些媒体和广告公司使用GIF表情包来吸引用户的注意力&#xff0c;并在广告或宣传活动中增加趣味性和互动性&#xff0c;这些表情包可以用来传达品牌的个性、情感或概念&#xff0c;那么当遇到gif图片过大的时候&#xff0c;就需要gif压缩了&#xff0c;怎么压缩gif动图呢&#…

力扣144 二叉树的前序遍历 Java版本

文章目录 题目描述递归方法代码 非递归方法代码 题目描述 给你二叉树的根节点 root &#xff0c;返回它节点值的 前序 遍历。 示例 1&#xff1a; 输入&#xff1a;root [1,null,2,3] 输出&#xff1a;[1,2,3] 示例 2&#xff1a; 输入&#xff1a;root [] 输出&#xf…

解锁MyBatis Plus的强大功能:学习高级操作与DML技巧!

MyBatisPlus 1&#xff0c;DML编程控制1.1 id生成策略控制知识点1&#xff1a;TableId1.1.1 环境构建1.1.2 代码演示AUTO策略步骤1:设置生成策略为AUTO步骤3:运行新增方法 INPUT策略步骤1:设置生成策略为INPUT步骤2:添加数据手动设置ID步骤3:运行新增方法 ASSIGN_ID策略步骤1:设…

MyBatis一些常见知识点!

什么是 ORM 框架&#xff1f; MyBatis 有哪些优缺点&#xff1f; 典型回答&#xff1a; ORM&#xff08;Object-Relational Mapping&#xff0c;对象关系映射&#xff09;框架是一种将关系型数据库中的数据 与 应用程序中的对象进行映射的技术。它通过在程序代码中定义的类和属…

代码混淆技术综述与优化方法

代码混淆技术综述与优化方法 摘要 本文介绍了代码混淆的概念和目的&#xff0c;并提供了Python代码混淆的宏观思路。同时&#xff0c;还介绍了一种在线网站混淆Python代码的方法&#xff0c;并给出了混淆前后的示例代码。 引言 在当今信息时代&#xff0c;软件代码的保护显…

java的热部署/热更新(2)类加载机制

类加载机制 类加载机制最困难的就是类的状态性。更直白的说&#xff0c;就是类的static的字段。 常见的类加载方案 tomcat 我们看tomcat&#xff0c;是一个简单的顶层类优先方案。 这个类加载方案看起来很完美。但是不可避免的有一个问题&#xff0c;就是部分底层类是共用…

机器学习-3降低损失(Reducing Loss)

机器学习-3降低损失(Reducing Loss) 学习内容来自&#xff1a;谷歌ai学习 https://developers.google.cn/machine-learning/crash-course/framing/check-your-understanding?hlzh-cn 本文作为学习记录1.降低损失&#xff1a;迭代方法 迭代学习 下图展示了机器学习算法用于训…

论文阅读:Learning Lens Blur Fields

这篇文章是对镜头模糊场进行表征学习的研究&#xff0c;镜头的模糊场也就是镜头的 PSF 分布&#xff0c;镜头的 PSF 与物距&#xff0c;焦距&#xff0c;光学系统本身的像差都有关系&#xff0c;实际的 PSF 分布是非常复杂而且数量也很多&#xff0c;这篇文章提出用一个神经网络…

猫发腮的黄金期是几个月大?推荐几款发腮效果好的生骨肉冻干

猫发腮的黄金期是几个月大是许多猫主人关心的问题。在猫咪的成长过程中&#xff0c;发腮是其成熟的重要标志。发腮的脸型看起来非常可爱&#xff0c;不少铲屎官都想给自家猫咪养发腮。因此&#xff0c;在猫咪适合的年龄段&#xff0c;主人需要为其提供充足的营养补给&#xff0…

npm ERR! code CERT_HAS_EXPIRED

执行npm i报错&#xff1a; npm ERR! code ETIMEDOUT npm ERR! syscall connect npm ERR! errno ETIMEDOUT npm ERR! network request to https://registry.npmjs.org/react-redux failed, reason: connect ETIMEDOUT 104.16.2.35:443 npm ERR! network This is a problem rel…

1802907-91-0,Methyltetrazine-PEG4-COOH,可以与多种不同的化学基团反应

您好&#xff0c;欢迎来到新研之家 文章关键词&#xff1a;Methyltetrazine-PEG4-COOH&#xff0c;Methyltetrazine-PEG4-acid&#xff0c;甲基四嗪-四聚乙二醇-羧基&#xff0c;甲基四嗪-四聚乙二醇-羧酸&#xff0c;甲基四嗪PEG4羧酸&#xff0c;甲基四嗪-PEG4-羧酸 一、基…

Java 使用 ant.jar 执行 SQL 脚本文件

Java 使用 ant.jar 执行 SQL 脚本文件&#xff0c;很简单。 在 pom.xml 中导入 ant 依赖 <dependency><groupId>org.apache.ant</groupId><artifactId>ant</artifactId><version>1.10.11</version> </dependency>sql 脚本文件…