• SpringBoot+Vue项目学生选课系统


    文末获取源码

    开发语言:Java

    框架:springboot

    JDK版本:JDK1.8

    服务器:tomcat7

    数据库:mysql 5.7/8.0

    数据库工具:Navicat11

    开发软件:eclipse/myeclipse/idea

    Maven包:Maven3.3.9

    浏览器:谷歌浏览器

    前言介绍 

    系统采用了Java技术,springboot + vue 的前后端分离学生选课系统,前端使用 element-ui 组件库,选择MySQL作为系统的数据库,开发工具选择 idea来进行系统的设计。基本实现了学生选课系统应有的主要功能模块,本系统有以下功能:

    (1)前台:首页、课程信息、校园论坛、校园公告、个人中心、后台管理。 

    (2)管理员:首页、个人中心、学生管理、教师管理课、程信息管理、课程分类管理、选课信息管理、作业信息管理、提交作业管理、学生成绩管理、校园论坛、系统管理。

    (3)学生:首页、个人中心、选课信息管理、作业信息管理、提交作业管理、学生成绩管理、我的收藏管理。

    (4)教师:首页、个人中心、课程信息管理、选课信息管理、作业信息管理、提交作业管理、学生成绩管理。

    系统展示

    前台 

    课程信息

     

    管理员功能

    登录 

    课程信息管理

    选课信息管理 

    校园论坛

    学生功能

    作业信息管理

    学生成绩管理

     

    教师

    课程信息管理 

    部分核心代码

    1. # Tomcat
    2. server:
    3. tomcat:
    4. uri-encoding: UTF-8
    5. port: 8080
    6. servlet:
    7. context-path: /springbootwxjjv
    8. spring:
    9. datasource:
    10. driverClassName: com.mysql.jdbc.Driver
    11. url: jdbc:mysql://127.0.0.1:3306/springbootwxjjv?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
    12. username: root
    13. password:
    14. # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
    15. # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootwxjjv
    16. # username: sa
    17. # password: 123456
    18. servlet:
    19. multipart:
    20. max-file-size: 300MB
    21. max-request-size: 300MB
    22. resources:
    23. static-locations: classpath:static/,file:static/
    24. #mybatis
    25. mybatis-plus:
    26. mapper-locations: classpath*:mapper/*.xml
    27. #实体扫描,多个package用逗号或者分号分隔
    28. typeAliasesPackage: com.entity
    29. global-config:
    30. #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
    31. id-type: 1
    32. #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
    33. field-strategy: 1
    34. #驼峰下划线转换
    35. db-column-underline: true
    36. #刷新mapper 调试神器
    37. refresh-mapper: true
    38. #逻辑删除配置
    39. logic-delete-value: -1
    40. logic-not-delete-value: 0
    41. #自定义SQL注入器
    42. sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
    43. configuration:
    44. map-underscore-to-camel-case: true
    45. cache-enabled: false
    46. call-setters-on-nulls: true
    47. #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other)
    48. jdbc-type-for-null: 'null'
    1. /**
    2. * 选课信息
    3. * 后端接口
    4. * @author
    5. * @email
    6. * @date 2022-04-30 14:26:20
    7. */
    8. @RestController
    9. @RequestMapping("/xuankexinxi")
    10. public class XuankexinxiController {
    11. @Autowired
    12. private XuankexinxiService xuankexinxiService;
    13. /**
    14. * 后端列表
    15. */
    16. @RequestMapping("/page")
    17. public R page(@RequestParam Map<String, Object> params,XuankexinxiEntity xuankexinxi,
    18. HttpServletRequest request){
    19. String tableName = request.getSession().getAttribute("tableName").toString();
    20. if(tableName.equals("jiaoshi")) {
    21. xuankexinxi.setGonghao((String)request.getSession().getAttribute("username"));
    22. }
    23. if(tableName.equals("xuesheng")) {
    24. xuankexinxi.setXuehao((String)request.getSession().getAttribute("username"));
    25. }
    26. EntityWrapper<XuankexinxiEntity> ew = new EntityWrapper<XuankexinxiEntity>();
    27. PageUtils page = xuankexinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuankexinxi), 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,XuankexinxiEntity xuankexinxi,
    36. HttpServletRequest request){
    37. EntityWrapper<XuankexinxiEntity> ew = new EntityWrapper<XuankexinxiEntity>();
    38. PageUtils page = xuankexinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuankexinxi), params), params));
    39. return R.ok().put("data", page);
    40. }
    41. /**
    42. * 列表
    43. */
    44. @RequestMapping("/lists")
    45. public R list( XuankexinxiEntity xuankexinxi){
    46. EntityWrapper<XuankexinxiEntity> ew = new EntityWrapper<XuankexinxiEntity>();
    47. ew.allEq(MPUtil.allEQMapPre( xuankexinxi, "xuankexinxi"));
    48. return R.ok().put("data", xuankexinxiService.selectListView(ew));
    49. }
    50. /**
    51. * 查询
    52. */
    53. @RequestMapping("/query")
    54. public R query(XuankexinxiEntity xuankexinxi){
    55. EntityWrapper< XuankexinxiEntity> ew = new EntityWrapper< XuankexinxiEntity>();
    56. ew.allEq(MPUtil.allEQMapPre( xuankexinxi, "xuankexinxi"));
    57. XuankexinxiView xuankexinxiView = xuankexinxiService.selectView(ew);
    58. return R.ok("查询选课信息成功").put("data", xuankexinxiView);
    59. }
    60. /**
    61. * 后端详情
    62. */
    63. @RequestMapping("/info/{id}")
    64. public R info(@PathVariable("id") Long id){
    65. XuankexinxiEntity xuankexinxi = xuankexinxiService.selectById(id);
    66. return R.ok().put("data", xuankexinxi);
    67. }
    68. /**
    69. * 前端详情
    70. */
    71. @IgnoreAuth
    72. @RequestMapping("/detail/{id}")
    73. public R detail(@PathVariable("id") Long id){
    74. XuankexinxiEntity xuankexinxi = xuankexinxiService.selectById(id);
    75. return R.ok().put("data", xuankexinxi);
    76. }
    77. /**
    78. * 后端保存
    79. */
    80. @RequestMapping("/save")
    81. public R save(@RequestBody XuankexinxiEntity xuankexinxi, HttpServletRequest request){
    82. xuankexinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    83. //ValidatorUtils.validateEntity(xuankexinxi);
    84. xuankexinxiService.insert(xuankexinxi);
    85. return R.ok();
    86. }
    87. /**
    88. * 前端保存
    89. */
    90. @RequestMapping("/add")
    91. public R add(@RequestBody XuankexinxiEntity xuankexinxi, HttpServletRequest request){
    92. xuankexinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    93. //ValidatorUtils.validateEntity(xuankexinxi);
    94. xuankexinxiService.insert(xuankexinxi);
    95. return R.ok();
    96. }
    97. /**
    98. * 修改
    99. */
    100. @RequestMapping("/update")
    101. @Transactional
    102. public R update(@RequestBody XuankexinxiEntity xuankexinxi, HttpServletRequest request){
    103. //ValidatorUtils.validateEntity(xuankexinxi);
    104. xuankexinxiService.updateById(xuankexinxi);//全部更新
    105. return R.ok();
    106. }
    107. /**
    108. * 删除
    109. */
    110. @RequestMapping("/delete")
    111. public R delete(@RequestBody Long[] ids){
    112. xuankexinxiService.deleteBatchIds(Arrays.asList(ids));
    113. return R.ok();
    114. }
    115. /**
    116. * 提醒接口
    117. */
    118. @RequestMapping("/remind/{columnName}/{type}")
    119. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
    120. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    121. map.put("column", columnName);
    122. map.put("type", type);
    123. if(type.equals("2")) {
    124. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    125. Calendar c = Calendar.getInstance();
    126. Date remindStartDate = null;
    127. Date remindEndDate = null;
    128. if(map.get("remindstart")!=null) {
    129. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    130. c.setTime(new Date());
    131. c.add(Calendar.DAY_OF_MONTH,remindStart);
    132. remindStartDate = c.getTime();
    133. map.put("remindstart", sdf.format(remindStartDate));
    134. }
    135. if(map.get("remindend")!=null) {
    136. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    137. c.setTime(new Date());
    138. c.add(Calendar.DAY_OF_MONTH,remindEnd);
    139. remindEndDate = c.getTime();
    140. map.put("remindend", sdf.format(remindEndDate));
    141. }
    142. }
    143. Wrapper<XuankexinxiEntity> wrapper = new EntityWrapper<XuankexinxiEntity>();
    144. if(map.get("remindstart")!=null) {
    145. wrapper.ge(columnName, map.get("remindstart"));
    146. }
    147. if(map.get("remindend")!=null) {
    148. wrapper.le(columnName, map.get("remindend"));
    149. }
    150. String tableName = request.getSession().getAttribute("tableName").toString();
    151. if(tableName.equals("jiaoshi")) {
    152. wrapper.eq("gonghao", (String)request.getSession().getAttribute("username"));
    153. }
    154. if(tableName.equals("xuesheng")) {
    155. wrapper.eq("xuehao", (String)request.getSession().getAttribute("username"));
    156. }
    157. int count = xuankexinxiService.selectCount(wrapper);
    158. return R.ok().put("count", count);
    159. }
    160. }

  • 相关阅读:
    【SpringCloud-学习笔记】初识Docker
    数据结构中常见的哈希表,到底是什么?
    JSON和全局异常处理
    大数据入门篇
    Docker学习笔记(三)
    深入了解Web3:区块链技术如何改变我们的数字世界
    leetcode多个测试用例之间相互影响导致提交失败
    【Java 进阶篇】深入理解 SQL 分组查询
    文献越读_细菌中5‘UTR上RG4促进翻译效率
    Express框架的使用
  • 原文地址:https://blog.csdn.net/m0_49113107/article/details/126224901