600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 基于java+ssm+jsp的精品课程学习系统

基于java+ssm+jsp的精品课程学习系统

时间:2022-12-13 16:10:59

相关推荐

基于java+ssm+jsp的精品课程学习系统

项目介绍

如今社会上各行各业,都喜欢用自己行业的专属软件工作,互联网发展到这个时候,人们已经发现离不开了互联网。新技术的产生,往往能解决一些老技术的弊端问题。因为传统精品课程学习信息管理难度大,容错率低,管理人员处理数据费工费时,所以专门为解决这个难题开发了一个精品课程在线学习系统,可以解决许多问题。

精品课程在线学习系统实现的功能包括论坛管理,教学资源管理,课程留言管理,课程收藏管理,公告信息管理,用户管理,试卷管理,试题管理,考试记录管理等功能。该系统采用了Mysql数据库,Java语言,SSM框架等技术进行编程实现。

精品课程在线学习系统可以提高精品课程学习信息管理问题的解决效率,优化精品课程学习信息处理流程,保证精品课程学习信息数据的安全,它是一个非常可靠,非常安全的应用程序。

4.2 功能结构设计

图4.1即为设计的管理员功能结构,管理员权限操作的功能包括管理教学资源,管理公告信息,管理课程留言,管理论坛,管理试卷,管理考试信息等。

图4.2即为设计的用户功能结构,用户权限操作的功能包括观看教学资源视频,下载教学资源文件,发布课程留言,参与论坛帖子发布与评论,选择试卷进行考试以及查看考试记录和错题信息等。

开发环境

编程语言:Java

数据库 :Mysql

系统架构:B/S

后端框架:SSM

编译工具:idea或者eclipse,jdk1.8,maven

支持定做:java/php/python/android/小程序/vue/爬虫/c#/

系统实现

5.1 管理员功能实现

5.1.1 教学资源管理

图5.1 即为编码实现的教学资源管理界面,教学资源信息有教学资源视频,教学资源图片,教学资源标题,教学资源类型等信息,管理员可以添加教学资源,可以使用修改功能更正登记有误的教学资源信息,可以删除需要删除的教学资源信息等。

图5.1 教学资源管理界面

5.1.2 试卷管理

图5.2 即为编码实现的试卷管理界面,试卷信息包括试卷总分,考试时长,试卷名称,试卷状态等信息,管理员负责添加试卷,对登记有误的试卷信息进行修改,同时可以在试卷管理界面删除需要删除的试卷等。

图5.2 试卷管理界面

5.1.3 试题管理

图5.3 即为编码实现的试题管理界面,试卷是由许多试题组合而成,对于试题信息的管理也是属于管理员管理的内容,试题信息包括答案,分数,试题名称等信息,管理员能够对试题进行修改,也能在试题管理界面对需要删除的试题进行删除。

图5.3 试题管理界面

5.1.4 论坛管理

图5.4 即为编码实现的论坛管理界面,管理员查看帖子内容,发帖时间,帖子标题等信息,可以修改帖子,可以对论坛帖子的回复内容进行查看,可以通过帖子类型查询帖子等。

图5.4 论坛管理界面

5.1.5 用户管理

图5.5 即为编码实现的用户管理界面,用户的注册信息包括用户头像,电子邮箱,性别,姓名等信息也能让管理员查看和修改,删除。

图5.5 用户管理界面

5.2 用户功能实现

5.2.1 教学资源

图5.6 即为编码实现的教学资源界面,用户在教学资源界面通过观看视频的方式来学习课程,同时可以下载教学资源文件,可以在教学资源界面的下方留言区域发布课程相关的留言信息。

图5.6 教学资源界面

5.2.2 在线论坛

图5.7 即为编码实现的在线论坛界面,用户通过在线论坛功能实现对某个话题的具体讨论,讨论方式主要就是发布帖子,跟踪帖子,回复帖子等。

图5.7 在线论坛界面

5.2.3 试卷管理

图5.8 即为编码实现的试卷管理界面,用户在试卷管理界面选择任意一种试卷,然后点击考试按钮进行答题。

图5.8 试卷管理界面

5.2.4 考试记录

图5.9 即为编码实现的考试记录界面,用户参与了试卷答题之后,需要在考试记录界面查看答题详情信息,以及查看试卷答题所得分数信息等。

图5.9 考试记录界面

核心代码

package com.controller;import java.io.File;import java.math.BigDecimal;import .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 mons.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("/forum")public class ForumController {private static final Logger logger = LoggerFactory.getLogger(ForumController.class);@Autowiredprivate ForumService forumService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//级联表service@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));if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = forumService.queryPage(params);//字典表数据转换List<ForumView> list =(List<ForumView>)page.getList();for(ForumView 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);ForumEntity forum = forumService.selectById(id);if(forum !=null){//entity转viewForumView view = new ForumView();BeanUtils.copyProperties( forum , view );//把实体数据重构到view中//级联表YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());if(yonghu != null){BeanUtils.copyProperties( yonghu , view ,new String[]{"id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}//管理员用户表做特殊处理,防止和用户表账户姓名字段冲突UsersEntity users = usersService.selectById(forum.getUsersId());if(users != null){view.setUsersId(users.getId());view.setUusername(users.getUsername());view.setUpassword(users.getPassword());view.setUrole(users.getRole());view.setUaddtime(users.getAddtime());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody ForumEntity forum, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");else if("用户".equals(role))forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));else if("管理员".equals(role))forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>().eq("forum_name", forum.getForumName()).eq("yonghu_id", forum.getYonghuId()).eq("users_id", forum.getUsersId()).eq("super_ids", forum.getSuperIds()).eq("forum_types", forum.getForumTypes()).eq("forum_state_types", forum.getForumStateTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());ForumEntity forumEntity = forumService.selectOne(queryWrapper);if(forumEntity==null){forum.setInsertTime(new Date());forum.setCreateTime(new Date());forumService.insert(forum);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody ForumEntity forum, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());String role = String.valueOf(request.getSession().getAttribute("role"));// if(false)// return R.error(511,"永远不会进入");// else if("用户".equals(role))// forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));// else if("管理员".equals(role))// forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));//根据字段查询是否有相同数据Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>().notIn("id",forum.getId()).andNew().eq("forum_name", forum.getForumName()).eq("yonghu_id", forum.getYonghuId()).eq("users_id", forum.getUsersId()).eq("super_ids", forum.getSuperIds()).eq("forum_types", forum.getForumTypes()).eq("forum_state_types", forum.getForumStateTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());ForumEntity forumEntity = forumService.selectOne(queryWrapper);forum.setUpdateTime(new Date());if(forumEntity==null){forumService.updateById(forum);//根据id更新return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());forumService.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<ForumEntity> forumList = 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("../../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){//循环ForumEntity forumEntity = new ForumEntity();// forumEntity.setForumName(data.get(0));//帖子标题 要改的// forumEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的// forumEntity.setUsersId(Integer.valueOf(data.get(0))); //管理员 要改的// forumEntity.setForumContent("");//详情和图片// forumEntity.setSuperIds(Integer.valueOf(data.get(0))); //父id 要改的// forumEntity.setForumTypes(Integer.valueOf(data.get(0))); //帖子类型 要改的// forumEntity.setForumStateTypes(Integer.valueOf(data.get(0))); //帖子状态 要改的// forumEntity.setInsertTime(date);//时间// forumEntity.setUpdateTime(sdf.parse(data.get(0)));//修改时间 要改的// forumEntity.setCreateTime(date);//时间forumList.add(forumEntity);//把要查询是否重复的字段放入map中}//查询是否重复forumService.insertBatch(forumList);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));// 没有指定排序字段就默认id倒序if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){params.put("orderBy","id");}PageUtils page = forumService.queryPage(params);//字典表数据转换List<ForumView> list =(List<ForumView>)page.getList();for(ForumView 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);ForumEntity forum = forumService.selectById(id);if(forum !=null){//entity转viewForumView view = new ForumView();BeanUtils.copyProperties( forum , view );//把实体数据重构到view中//级联表YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());if(yonghu != null){BeanUtils.copyProperties( yonghu , view ,new String[]{"id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}UsersEntity users = usersService.selectById(forum.getUsersId());if(users != null){view.setUsersId(users.getId());view.setUusername(users.getUsername());view.setUpassword(users.getPassword());view.setUrole(users.getRole());view.setUaddtime(users.getAddtime());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody ForumEntity forum, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>().eq("forum_name", forum.getForumName()).eq("yonghu_id", forum.getYonghuId()).eq("users_id", forum.getUsersId()).eq("super_ids", forum.getSuperIds()).eq("forum_types", forum.getForumTypes()).eq("forum_state_types", forum.getForumStateTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());ForumEntity forumEntity = forumService.selectOne(queryWrapper);if(forumEntity==null){forum.setInsertTime(new Date());forum.setCreateTime(new Date());forumService.insert(forum);return R.ok();}else {return R.error(511,"表中有相同数据");}}}

论文参考

目 录

摘 要 I

Abstract II

第1章 绪论 1

1.1 课题背景 1

1.2 课题意义 1

1.3 研究内容 1

第2章 开发环境与技术 3

2.1 Java语言 3

2.2 MYSQL数据库 3

2.3 IDEA开发工具 4

2.4 SSM框架 4

第3章 系统分析 5

3.1 可行性分析 5

3.1.1 技术可行性 5

3.1.2 经济可行性 5

3.1.3 操作可行性 5

3.2 系统流程 5

3.2.1 操作流程 6

3.2.2 登录流程 6

3.2.3 删除信息流程 7

3.2.4 添加信息流程 7

3.3 性能需求 8

3.4 功能需求 9

第4章 系统设计 12

4.1 系统设计思想 12

4.2 功能结构设计 13

4.3 数据库设计 14

4.3.1 数据库概念设计 14

4.3.2 数据库物理设计 17

第5章 系统实现 23

5.1 管理员功能实现 23

5.1.1 教学资源管理 23

5.1.2 试卷管理 23

5.1.3 试题管理 24

5.1.4 论坛管理 24

5.1.5 用户管理 25

5.2 用户功能实现 25

5.2.1 教学资源 25

5.2.2 在线论坛 26

5.2.3 试卷管理 26

5.2.4 考试记录 27

第6章 系统测试 28

6.1 功能测试 28

6.1.1 登录功能测试 28

6.1.2 修改密码功能测试 29

6.2 系统测试结果 30

结 论 31

参考文献 32

致 谢 33

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。