Java课程信息管理系统怎么实现
发表于:2025-11-10 作者:千家信息网编辑
千家信息网最后更新 2025年11月10日,这篇文章主要讲解了"Java课程信息管理系统怎么实现",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Java课程信息管理系统怎么实现"吧!一、项目运行环
千家信息网最后更新 2025年11月10日Java课程信息管理系统怎么实现
这篇文章主要讲解了"Java课程信息管理系统怎么实现",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Java课程信息管理系统怎么实现"吧!
一、项目运行
环境配置:
Jdk1.8 + Tomcat8.0 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
Springboot + SpringMVC + MyBatis + FreeMarker + JavaScript + JQuery + Ajax + maven等等。
二、效果图展示

三、核心代码
用户管理控制层
@Controller@RequestMapping("/User")public class UserController { @Autowired private UserService userService; @Autowired private PowerService powerService; @Autowired private RoleService roleService; @Autowired private NoticeService noticeService; @RequestMapping("/Main") public String res(HttpServletRequest request){ String time = DateUtil.getStringToday(); request.getSession().setAttribute("time", time); Notice notice = new Notice(); List list = noticeService.queryAll(notice); notice = list.get(0); User user = userService.selectByPrimaryKey(notice.getUserid()); notice.setUserid(user.getName()); request.getSession().setAttribute("notice", notice); return "Main"; } @RequestMapping("/changePa") public String res1(){ return "changePass"; } @RequestMapping("/Login") public ModelAndView login(HttpServletRequest request,String id,String password) throws Exception{ ModelAndView mav = new ModelAndView(); User user1 = userService.selectByPrimaryKey(id); if(user1 == null || !password.equals(user1.getPassword())){ mav.setViewName("index"); request.getSession().setAttribute("info", "error"); return mav; }else{ Role role = new Role(); role.setRoleid(user1.getRoleid()); List list =roleService.QueryAll(role); role =list.get(0); request.getSession().setAttribute("roleName", role.getRolename()); Power power = powerService.selectByPrimaryKey(role.getPowerid()); if(!StringUtil.isNullOrEmpty(power.getPower())){ request.getSession().setAttribute("power", power.getPower()); } String time = DateUtil.getStringToday(); request.getSession().setAttribute("time", time); request.getSession().setAttribute("user", user1); mav.setViewName("redirect:/User/Main"); } return mav; } @RequestMapping("/updateStudent") public String update(User user){ userService.updateByPrimaryKey(user); return "redirect:/User/student"; } @RequestMapping("/updateTeacher") public String updatet(User user){ userService.updateByPrimaryKey(user); return "redirect:/User/teacher"; } @RequestMapping("/updatePa") public String updatePa(String userID,String password){ User user = new User(); System.out.println(userID); User user1 = userService.selectByPrimaryKey(userID); user1.setPassword(password); userService.updateByPrimaryKey(user1); return "Main"; } @RequestMapping("/delete") public String delete(String ID){ userService.deleteByPrimaryKey(ID); return "redirect:/User/queryAll"; } @RequestMapping("/teacher") public String QueryAllTeacher(HttpServletRequest request,User user){ List list = userService.QueryAllTeacher(user); request.setAttribute("list", list); if(null != user.getName()){ request.setAttribute("name", user.getName()); } if(null != user.getMobile()){ request.setAttribute("mobile", user.getMobile()); } return "teacher"; } @ResponseBody @RequestMapping("/jsonteacher") public String QueryAllTeacherjson(HttpServletRequest request,User user){ List list = userService.QueryAllTeacher(user); JSONObject json = new JSONObject(); return json.toJSONString(list); } @RequestMapping("/student") public String QueryAllStudent(HttpServletRequest request,User user){ List list = userService.QueryAllStudent(user); request.setAttribute("list", list); if(null != user.getName()){ request.setAttribute("name", user.getName()); } if(null != user.getMobile()){ request.setAttribute("mobile", user.getMobile()); } return "student"; } @RequestMapping("/addteacher") public String addUser(User user){ String passWord = "123456"; user.setPassword(passWord); user.setType(Constans.TEACHER); userService.insert(user); return "redirect:/User/teacher"; } @RequestMapping("/addstudent") public String addStudent(User user){ String passWord = "123456"; user.setPassword(passWord); user.setType(Constans.STUDENT); userService.insert(user); return "redirect:/User/student"; } @ResponseBody @RequestMapping("/queryOne") public String queryOne(String ID){ User user = new User(); user.setId(ID); List list = userService.QueryAll(user); user = list.get(0); JSONObject json = new JSONObject(); String data = json.toJSONString(user); return data; } @RequestMapping("/quit") public ModelAndView quit(HttpServletRequest request) throws Exception{ ModelAndView mav = new ModelAndView(); HttpSession session1 = request.getSession(); session1.invalidate(); request.getSession().setAttribute("info", "quit"); mav.setViewName("index"); return mav; } } 排课控制层
@Controller@RequestMapping("/Course")public class CourseController { @Autowired private CourseService courseService; @Autowired private CurelationService curelationService; @Autowired private CoursecommentService coursecommentService; @ResponseBody @RequestMapping("/queryOneCom") public String queryOneCom(String ID){ Coursecomment course = new Coursecomment(); course.setId(ID); System.out.println("===================================="+ID); List list = coursecommentService.queryAll(course); course = list.get(0); JSONObject json = new JSONObject(); return json.toJSONString(course); } @RequestMapping("addComment") public String addComment(HttpServletRequest request, Coursecomment coursecomment){ User user = (User) request.getSession().getAttribute("user"); coursecomment.setCreatetime(DateUtil.getStringToday()); coursecomment.setUserid(user.getName()); coursecomment.setId(String.valueOf(Math.random()).substring(2,10)); coursecommentService.insert(coursecomment); return "redirect:/Course/suggeetion"; } @ResponseBody @RequestMapping("jsoncourse") public String jsoncourse(HttpServletRequest request, Curelation course){ User user = (User) request.getSession().getAttribute("user"); /*String type = "1"; if ("1".equals(user.getType())){ type="2"; } course.setType(type); course.setUserid(user.getId());*/ List curelationList = curelationService.queryAll(course); List dataList = new ArrayList<>(); for (int i = 0; i < curelationList.size(); i++) { Course curelation = courseService.selectByPrimaryKey(curelationList.get(i).getCourseid()); dataList.add(curelation); } JSONObject json = new JSONObject(); return json.toJSONString(dataList); } @RequestMapping("suggeetion") public String suggeetion(HttpServletRequest request, Coursecomment coursecomment){ List coursecomments = coursecommentService.queryAll(coursecomment); request.setAttribute("list",coursecomments); return "suggeetion"; } @RequestMapping("view") public String view(HttpServletRequest request){ User user = (User) request.getSession().getAttribute("user"); String type = "1"; if ("1".equals(user.getType())){ type="2"; } List 公告控制层
@Controller@RequestMapping("/Notice")public class NoticeController { @Autowired private NoticeService noticeService; @RequestMapping("/add") public String toAdd(){ return "NoticeAdd"; } @RequestMapping("/modify") public String modify(HttpServletRequest request,Notice notice){ List noticeList = noticeService.queryAll(notice); request.setAttribute("list",noticeList); return "noticeModfiy"; } @RequestMapping("/update") public String update(HttpServletRequest request,Notice notice){ User user = (User) request.getSession().getAttribute("user"); notice.setUserid(user.getId()); notice.setCreatdate(DateUtil.getStringToday()); noticeService.update(notice); return "redirect:/Notice/modify"; } @RequestMapping("/delete") public String delete(HttpServletRequest request,Notice notice){ List noticeList = noticeService.queryAll(notice); request.setAttribute("list",noticeList); return "noticeDelete"; } @RequestMapping("/delete1") public String delete1(String ID){ noticeService.delete(ID); return "redirect:/Notice/delete"; } @ResponseBody @RequestMapping("/queryOne") public String queryOne(String id){ System.out.println("=================="+id); Notice notice = new Notice(); notice.setId(id); List noticeList = noticeService.queryAll(notice); JSONObject json = new JSONObject(); return json.toJSONString(noticeList.get(0)); } @RequestMapping("/add1") public String add(HttpServletRequest request,String Content,String biaoti) throws Exception{ User user = (User) request.getSession().getAttribute("user"); Notice notice = new Notice(); notice.setContent(Content); notice.setTitle(biaoti); notice.setCreatdate(DateUtil.Date2String(new Date())); notice.setId(String.valueOf(Math.random()).substring(2, 8)); notice.setUserid(user.getId()); noticeService.add(notice); return "redirect:/User/Main"; }} 角色控制层
@Controller@RequestMapping("/Role")public class RoleController { @Autowired private RoleService depotService; @Autowired private PowerService powerService; @RequestMapping("/update") public String update(String id,String rolename,String powerContent){ Role role = new Role(); role.setRoleid(id); role.setRolename(rolename); depotService.update(role); List list = depotService.QueryAll(role); Role role1 = list.get(0); Power power = new Power(); if(powerContent.indexOf("110") != -1){ powerContent = powerContent + ",1100"; } if(powerContent.indexOf("120") != -1){ powerContent = powerContent + ",1200"; } if(powerContent.indexOf("130") != -1){ powerContent = powerContent + ",1300"; } if(powerContent.indexOf("140") != -1){ powerContent = powerContent + ",1400"; } if(powerContent.indexOf("150") != -1){ powerContent = powerContent + ",1500"; } power.setPower(powerContent); power.setRoleid(role1.getPowerid()); powerService.update(power); return "redirect:/Role/queryAll"; } @RequestMapping("/delete") public String delete(String ID){ depotService.deleteByPrimaryKey(ID); return "redirect:/Role/queryAll"; } @RequestMapping("/queryAll") public String queryAll(HttpServletRequest request,Role role){ List list = depotService.QueryAll(role); request.setAttribute("list", list); if(null != role.getRolename()){ request.setAttribute("rolename", role.getRolename()); } return "Role"; } @RequestMapping("/add") public String add(String roleid,String rolename,String powerContent){ Power power1 = new Power(); Role role = new Role(); String powerid = String.valueOf(Math.random()).substring(2, 8); role.setRoleid(String.valueOf(Math.random()).substring(2, 6)); role.setPowerid(powerid); role.setRolename(rolename); power1.setPower(powerContent); power1.setRoleid(powerid); power1.setId(String.valueOf(Math.random()).substring(2, 8)); powerService.insert(power1); depotService.insert(role); return "redirect:/Role/queryAll"; } @ResponseBody @RequestMapping("/queryOne") public String queryOne(String ID){ JSONObject json = new JSONObject(); Role depot = new Role(); Power power = new Power(); power.setId(ID); System.out.println(ID); depot.setRoleid(ID); List list = depotService.QueryAll(depot); Role role1 = list.get(0); Power power1 = powerService.selectByPrimaryKey(role1.getPowerid()); String name = role1.getRolename(); role1.setPowerid(power1.getPower()); String data = json.toJSONString(role1); return data; } @ResponseBody @RequestMapping("/getAll") public String getAll(Role role){ JSONObject json = new JSONObject(); List list = depotService.QueryAll(role); String jsonq = json.toJSONString(list); System.out.println(jsonq); return jsonq; } } 感谢各位的阅读,以上就是"Java课程信息管理系统怎么实现"的内容了,经过本文的学习后,相信大家对Java课程信息管理系统怎么实现这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!
课程
信息
管理
管理系统
系统
控制
学生
学习
内容
成绩
项目
一行
代码
公告
单元
名称
姓名
就是
属性
思路
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
湖北网络安全存储服务器机箱定制
颈复康颗粒广告数据库
现在智能软件开发薪资待遇
威龙网络技术有限公司怎么样
数字书法软件开发
服务器分区时磁盘结构损坏
区领导参加网络安全法培训
西城区一站式网络技术咨询软件
濮阳网络技术发展
服务器磁盘清理
中职网络技术 开什么课
英雄联盟显示一直正在连接服务器
城轨云网络安全设计
偃师软件开发价格
idpbg 软件开发
sql报表服务器项目
深圳鸿创网络技术
软件企业 嵌入式软件开发
hpe塔式服务器报价
南瑞继保软件开发工程师待遇
软件开发的新增和优化
网络安全的国际立法情况
数据库数据循环删除
网络技术初中课外阅读措施
数据库技术出现的原因
克瑞尔房地产数据库
网络安全工程师招聘沈阳
为什么闽政通无法连接服务器
腾讯云轻量应用服务器小程序
聚焦网络安全海报