• SpringBoot+Vue项目大学生体质测试管理系统


    文末获取源码

    开发语言:Java

    框架:springboot

    JDK版本:JDK1.8

    服务器:tomcat7

    数据库:mysql 5.7/8.0

    数据库工具:Navicat11

    开发软件:eclipse/myeclipse/idea

    Maven包:Maven3.3.9

    浏览器:谷歌浏览器

    前言介绍 

    大学生体质测试管理系统提供给用户一个简单方便体质测试管理信息,通过留言区互动更方便。本系统采用了B/S体系的结构,使用了java技术以及MYSQL作为后台数据库进行开发

    本系统主要包括管理员,学生和教师三个角色组成,主要包括以下功能: 

    (1)前台:首页、体质测试、公告资讯、留言板、个人中心、后台管理 。

    (2)管理员:首页、个人中心、用户管理、教师管理、体质测试管理、测试报告管理、测试成绩管理、请假信息管理、申请信息管理、留言板、系统管理等功能。

    (3)用户:首页、个人中心、测试报告管理、测试成绩管理、请假信息管理、申请信息管理等功能。

    (4)教师:首页、个人中心、体质测试管理、测试报告管理、测试成绩管理、请假信息管理、申请信息管理等功能。

    系统功能结构图 

    系统功能模块

    大学生体质测试管理系统,在系统首页可以查看首页、体质测试、公告资讯、留言板、个人中心、后台管理等内容进行详细操作,如图

    体质测试

    在体质测试页面可以查看测试名称、测试编号、测试说明、测试文件、发布日期、教师工号等内容进行测试等操作,如图 

    用户注册

    通过填写用户账号、密码、确认密码、用户姓名、班级、联系方式等内容进行注册等操作,如图

    个人中心

    在个人中心页面通过填写用户账号、密码、用户姓名、性别、班级、联系方式、图片等内容进行更新信息等操作;如图 

    管理员功能模块

    管理员登录,管理员通过输入用户,密码,选择角色等信息进行系统登录,如图 

    管理员登录进入大学生体质测试管理系统可以查看首页、个人中心、用户管理、教师管理、体质测试管理、测试报告管理、测试成绩管理、留言板、系统管理等内容进行详细操作,如图

    用户管理

    在用户管理页面可以对索引、用户账号、用户姓名、性别、班级、联系方式、头像等内容详情、修改或删除等操作,如图

    教师管理

    在教师管理页面可以对教师工号、教师姓名、性别、职称、联系电话、头像等内容进行详情、修改或删除等操作,如图

    体质测试管理

    在体质测试管理页面可以对索引、测试编号、测试名称、测试文件、图片、发布日期、教师工号、教师姓名等内容进行详情、修改或删除等操作,如图

    测试报告管理

    在测试报告管理页面可以对索引、测试编号、测试名称、教师工号、教师姓名、报告文件、提交日期、用户账号、用户姓名、班级等内容进行详情、修改或删除等详细的操作,如图

    测试成绩管理

    在测试成绩管理页面可以对索引、测试编号、、测试名称、教师工号、教师姓名、测试评分、测试评级、评分时间、用户账号、用户姓名、班级等内容进行详情、修改或删除等详细的操作,如图 

    留言板

    在留言板页面可以对索引、用户名、留言内容、留言图片、回复内容、回复图片等内容进行详情、修改、回复或删除等操作,如图 

    系统管理

    在公告资讯页面中可以对索引、标题、图片等内容进行详情、修改或删除等操作,也可以对轮播图管理进行相应的操作,如图 

    用户功能模块

    用户进入大学生体质测试管理系统可以查看首页、个人中心、测试报告管理、测试成绩管理等内容进行详细操作,如图 

    测试报告管理

    在测试报告管理页面中可以对索引、测试编号、测试名称、教师工号、教师姓名、报告文件、提交日期、用户账号、用户姓名、班级等内容进行详情或删除等详细的操作,如图 

    教师功能模块

    教师注册,通过填写教师工号、密码、确认密码、教师姓名、职称、联系电话等内容进行注册,如图 

    进入教师页面中可以查看首页、个人中心、体质测试管理、测试报告管理、测试成绩管理等内容进行相应的操作,如图

    体质测试管理

    在体质测试管理页面中可以对索引、测试编号、测试名称、测试文件、图片、发布日期、教师工号、教师姓名等内容进行详细等操作,如图 

    测试报告管理

    在测试报告管理页面中可以对索引、测试编号、测试名称、教师工号、教师姓名、报告文件、提交日期、用户账号、用户姓名、班级等内容进行详细等操作,如图 

    部分核心代码

    1. /**
    2. * 测试成绩
    3. * 后端接口
    4. * @author
    5. * @email
    6. * @date 2022-04-18 19:20:01
    7. */
    8. @RestController
    9. @RequestMapping("/ceshichengji")
    10. public class CeshichengjiController {
    11. @Autowired
    12. private CeshichengjiService ceshichengjiService;
    13. /**
    14. * 后端列表
    15. */
    16. @RequestMapping("/page")
    17. public R page(@RequestParam Map<String, Object> params,CeshichengjiEntity ceshichengji,
    18. HttpServletRequest request){
    19. String tableName = request.getSession().getAttribute("tableName").toString();
    20. if(tableName.equals("jiaoshi")) {
    21. ceshichengji.setJiaoshigonghao((String)request.getSession().getAttribute("username"));
    22. }
    23. if(tableName.equals("yonghu")) {
    24. ceshichengji.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
    25. }
    26. EntityWrapper<CeshichengjiEntity> ew = new EntityWrapper<CeshichengjiEntity>();
    27. PageUtils page = ceshichengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ceshichengji), params), params));
    28. return R.ok().put("data", page);
    29. }
    30. /**
    31. * 前端列表
    32. */
    33. @IgnoreAuth
    34. @RequestMapping("/list")
    35. public R list(@RequestParam Map<String, Object> params,CeshichengjiEntity ceshichengji,
    36. HttpServletRequest request){
    37. EntityWrapper<CeshichengjiEntity> ew = new EntityWrapper<CeshichengjiEntity>();
    38. PageUtils page = ceshichengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ceshichengji), params), params));
    39. return R.ok().put("data", page);
    40. }
    41. /**
    42. * 列表
    43. */
    44. @RequestMapping("/lists")
    45. public R list( CeshichengjiEntity ceshichengji){
    46. EntityWrapper<CeshichengjiEntity> ew = new EntityWrapper<CeshichengjiEntity>();
    47. ew.allEq(MPUtil.allEQMapPre( ceshichengji, "ceshichengji"));
    48. return R.ok().put("data", ceshichengjiService.selectListView(ew));
    49. }
    50. /**
    51. * 查询
    52. */
    53. @RequestMapping("/query")
    54. public R query(CeshichengjiEntity ceshichengji){
    55. EntityWrapper< CeshichengjiEntity> ew = new EntityWrapper< CeshichengjiEntity>();
    56. ew.allEq(MPUtil.allEQMapPre( ceshichengji, "ceshichengji"));
    57. CeshichengjiView ceshichengjiView = ceshichengjiService.selectView(ew);
    58. return R.ok("查询测试成绩成功").put("data", ceshichengjiView);
    59. }
    60. /**
    61. * 后端详情
    62. */
    63. @RequestMapping("/info/{id}")
    64. public R info(@PathVariable("id") Long id){
    65. CeshichengjiEntity ceshichengji = ceshichengjiService.selectById(id);
    66. return R.ok().put("data", ceshichengji);
    67. }
    68. /**
    69. * 前端详情
    70. */
    71. @IgnoreAuth
    72. @RequestMapping("/detail/{id}")
    73. public R detail(@PathVariable("id") Long id){
    74. CeshichengjiEntity ceshichengji = ceshichengjiService.selectById(id);
    75. return R.ok().put("data", ceshichengji);
    76. }
    77. /**
    78. * 后端保存
    79. */
    80. @RequestMapping("/save")
    81. public R save(@RequestBody CeshichengjiEntity ceshichengji, HttpServletRequest request){
    82. ceshichengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    83. //ValidatorUtils.validateEntity(ceshichengji);
    84. ceshichengjiService.insert(ceshichengji);
    85. return R.ok();
    86. }
    87. /**
    88. * 前端保存
    89. */
    90. @RequestMapping("/add")
    91. public R add(@RequestBody CeshichengjiEntity ceshichengji, HttpServletRequest request){
    92. ceshichengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    93. //ValidatorUtils.validateEntity(ceshichengji);
    94. ceshichengjiService.insert(ceshichengji);
    95. return R.ok();
    96. }
    97. /**
    98. * 修改
    99. */
    100. @RequestMapping("/update")
    101. public R update(@RequestBody CeshichengjiEntity ceshichengji, HttpServletRequest request){
    102. //ValidatorUtils.validateEntity(ceshichengji);
    103. ceshichengjiService.updateById(ceshichengji);//全部更新
    104. return R.ok();
    105. }
    106. /**
    107. * 删除
    108. */
    109. @RequestMapping("/delete")
    110. public R delete(@RequestBody Long[] ids){
    111. ceshichengjiService.deleteBatchIds(Arrays.asList(ids));
    112. return R.ok();
    113. }
    114. /**
    115. * 提醒接口
    116. */
    117. @RequestMapping("/remind/{columnName}/{type}")
    118. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
    119. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    120. map.put("column", columnName);
    121. map.put("type", type);
    122. if(type.equals("2")) {
    123. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    124. Calendar c = Calendar.getInstance();
    125. Date remindStartDate = null;
    126. Date remindEndDate = null;
    127. if(map.get("remindstart")!=null) {
    128. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    129. c.setTime(new Date());
    130. c.add(Calendar.DAY_OF_MONTH,remindStart);
    131. remindStartDate = c.getTime();
    132. map.put("remindstart", sdf.format(remindStartDate));
    133. }
    134. if(map.get("remindend")!=null) {
    135. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    136. c.setTime(new Date());
    137. c.add(Calendar.DAY_OF_MONTH,remindEnd);
    138. remindEndDate = c.getTime();
    139. map.put("remindend", sdf.format(remindEndDate));
    140. }
    141. }
    142. Wrapper<CeshichengjiEntity> wrapper = new EntityWrapper<CeshichengjiEntity>();
    143. if(map.get("remindstart")!=null) {
    144. wrapper.ge(columnName, map.get("remindstart"));
    145. }
    146. if(map.get("remindend")!=null) {
    147. wrapper.le(columnName, map.get("remindend"));
    148. }
    149. String tableName = request.getSession().getAttribute("tableName").toString();
    150. if(tableName.equals("jiaoshi")) {
    151. wrapper.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
    152. }
    153. if(tableName.equals("yonghu")) {
    154. wrapper.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
    155. }
    156. int count = ceshichengjiService.selectCount(wrapper);
    157. return R.ok().put("count", count);
    158. }
    159. /**
    160. * (按值统计)
    161. */
    162. @RequestMapping("/value/{xColumnName}/{yColumnName}")
    163. public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
    164. Map<String, Object> params = new HashMap<String, Object>();
    165. params.put("xColumn", xColumnName);
    166. params.put("yColumn", yColumnName);
    167. EntityWrapper<CeshichengjiEntity> ew = new EntityWrapper<CeshichengjiEntity>();
    168. String tableName = request.getSession().getAttribute("tableName").toString();
    169. if(tableName.equals("jiaoshi")) {
    170. ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
    171. }
    172. if(tableName.equals("yonghu")) {
    173. ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
    174. }
    175. List<Map<String, Object>> result = ceshichengjiService.selectValue(params, ew);
    176. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    177. for(Map<String, Object> m : result) {
    178. for(String k : m.keySet()) {
    179. if(m.get(k) instanceof Date) {
    180. m.put(k, sdf.format((Date)m.get(k)));
    181. }
    182. }
    183. }
    184. return R.ok().put("data", result);
    185. }
    186. /**
    187. * (按值统计)时间统计类型
    188. */
    189. @RequestMapping("/value/{xColumnName}/{yColumnName}/{timeStatType}")
    190. public R valueDay(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,HttpServletRequest request) {
    191. Map<String, Object> params = new HashMap<String, Object>();
    192. params.put("xColumn", xColumnName);
    193. params.put("yColumn", yColumnName);
    194. params.put("timeStatType", timeStatType);
    195. EntityWrapper<CeshichengjiEntity> ew = new EntityWrapper<CeshichengjiEntity>();
    196. String tableName = request.getSession().getAttribute("tableName").toString();
    197. if(tableName.equals("jiaoshi")) {
    198. ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
    199. }
    200. if(tableName.equals("yonghu")) {
    201. ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
    202. }
    203. List<Map<String, Object>> result = ceshichengjiService.selectTimeStatValue(params, ew);
    204. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    205. for(Map<String, Object> m : result) {
    206. for(String k : m.keySet()) {
    207. if(m.get(k) instanceof Date) {
    208. m.put(k, sdf.format((Date)m.get(k)));
    209. }
    210. }
    211. }
    212. return R.ok().put("data", result);
    213. }
    214. /**
    215. * 分组统计
    216. */
    217. @RequestMapping("/group/{columnName}")
    218. public R group(@PathVariable("columnName") String columnName,HttpServletRequest request) {
    219. Map<String, Object> params = new HashMap<String, Object>();
    220. params.put("column", columnName);
    221. EntityWrapper<CeshichengjiEntity> ew = new EntityWrapper<CeshichengjiEntity>();
    222. String tableName = request.getSession().getAttribute("tableName").toString();
    223. if(tableName.equals("jiaoshi")) {
    224. ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
    225. }
    226. if(tableName.equals("yonghu")) {
    227. ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
    228. }
    229. List<Map<String, Object>> result = ceshichengjiService.selectGroup(params, ew);
    230. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    231. for(Map<String, Object> m : result) {
    232. for(String k : m.keySet()) {
    233. if(m.get(k) instanceof Date) {
    234. m.put(k, sdf.format((Date)m.get(k)));
    235. }
    236. }
    237. }
    238. return R.ok().put("data", result);
    239. }
    240. }

      

    1. /**
    2. * 上传文件映射表
    3. */
    4. @RestController
    5. @RequestMapping("file")
    6. @SuppressWarnings({"unchecked","rawtypes"})
    7. public class FileController{
    8. @Autowired
    9. private ConfigService configService;
    10. /**
    11. * 上传文件
    12. */
    13. @RequestMapping("/upload")
    14. public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
    15. if (file.isEmpty()) {
    16. throw new EIException("上传文件不能为空");
    17. }
    18. String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
    19. File path = new File(ResourceUtils.getURL("classpath:static").getPath());
    20. if(!path.exists()) {
    21. path = new File("");
    22. }
    23. File upload = new File(path.getAbsolutePath(),"/upload/");
    24. if(!upload.exists()) {
    25. upload.mkdirs();
    26. }
    27. String fileName = new Date().getTime()+"."+fileExt;
    28. File dest = new File(upload.getAbsolutePath()+"/"+fileName);
    29. file.transferTo(dest);
    30. /**
    31. * 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开
    32. * 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径,
    33. * 并且项目路径不能存在中文、空格等特殊字符
    34. */
    35. // FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/
    36. if(StringUtils.isNotBlank(type) && type.equals("1")) {
    37. ConfigEntity configEntity = configService.selectOne(new EntityWrapper().eq("name", "faceFile"));
    38. if(configEntity==null) {
    39. configEntity = new ConfigEntity();
    40. configEntity.setName("faceFile");
    41. configEntity.setValue(fileName);
    42. } else {
    43. configEntity.setValue(fileName);
    44. }
    45. configService.insertOrUpdate(configEntity);
    46. }
    47. return R.ok().put("file", fileName);
    48. }
    49. /**
    50. * 下载文件
    51. */
    52. @IgnoreAuth
    53. @RequestMapping("/download")
    54. public ResponseEntity<byte[]> download(@RequestParam String fileName) {
    55. try {
    56. File path = new File(ResourceUtils.getURL("classpath:static").getPath());
    57. if(!path.exists()) {
    58. path = new File("");
    59. }
    60. File upload = new File(path.getAbsolutePath(),"/upload/");
    61. if(!upload.exists()) {
    62. upload.mkdirs();
    63. }
    64. File file = new File(upload.getAbsolutePath()+"/"+fileName);
    65. if(file.exists()){
    66. /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
    67. getResponse().sendError(403);
    68. }*/
    69. HttpHeaders headers = new HttpHeaders();
    70. headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
    71. headers.setContentDispositionFormData("attachment", fileName);
    72. return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
    73. }
    74. } catch (IOException e) {
    75. e.printStackTrace();
    76. }
    77. return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
    78. }
    79. }

  • 相关阅读:
    SpringBoot—@ComponentScan注解过滤排除不加载某个类的三种方法
    初识设计模式 - 建造者模式
    从区划边界geojson中查询经纬度坐标对应的省市区县乡镇名称,开源Java工具,内存占用低、高性能
    分类预测 | Matlab实现SSA-SVM多特征分类预测
    MybatisPlus 3 DQL 编程控制 3.2 查询投影
    flutter 权限和图片权限之前的冲突
    Windows环境下用python嵌入式环境跑程序可太方便了
    hadoop进程理解
    生活中的知识产权有哪些?
    C++ Reference: Standard C++ Library reference: Containers: list: list: cend
  • 原文地址:https://blog.csdn.net/m0_49113107/article/details/126089314