package com.onlineclass.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.onlineclass.pojo.ClassTime;
import com.onlineclass.pojo.Course;
import com.onlineclass.pojo.OnlineClassPage;
import com.onlineclass.pojo.Score;
import com.onlineclass.pojo.Teacher;
import com.onlineclass.service.ClassTimeDaoService;
import com.onlineclass.service.CourseDaoService;
import com.onlineclass.service.ScoreDaoService;
import com.onlineclass.service.TeacherDaoService;
/**
*
* @author indext
* @since 2019.11.06
* @version 1.0
*/
@CrossOrigin(origins = "*", maxAge = 3600)
@Controller
public class CourseController {
@Autowired
private CourseDaoService courseDaoService;
@Autowired
private ScoreDaoService ScoreDaoService;
@Autowired
private TeacherDaoService teacherDaoService;
@Autowired
private ClassTimeDaoService classTimeDaoService;
// 分页查询所有课程
@RequestMapping("/courseSel")
@ResponseBody
public OnlineClassPage courseSelPage(HttpServletRequest request, HttpServletResponse response, HttpSession session)
throws Exception {
String course_name = request.getParameter("course_name");
String course_cno = request.getParameter("course_cno");
String pageNoss = request.getParameter("pageNopss");
System.out.println("asdasdasd" + course_name);
int pageNo = Integer.parseInt(pageNoss);
List<Course> courses = courseDaoService.getCourse(course_cno, course_name);
// 显示分页的总页数
int pageNos = courses.size() / 10;
int pageSize = 10;
if (courses.size() % 10 != 0) {
pageNos += 1;
}
// 分页显示记录
List<Course> coursePage = courseDaoService.getCoursePages(course_cno, course_name, pageNo, pageSize);
OnlineClassPage onlineClassPage = new OnlineClassPage();
onlineClassPage.setPageNo(pageNos);
onlineClassPage.setCourse(coursePage);
System.out.println(onlineClassPage.toString());
return onlineClassPage;
}
// 分页查询所有可选课程
@RequestMapping("/student/courseTeaSel")
@ResponseBody
public OnlineClassPage courseTeaSel(HttpServletRequest request, HttpServletResponse response, HttpSession session)
throws Exception {
String course_name = request.getParameter("course_name");
String course_cno = request.getParameter("course_cno");
String teacher_name = request.getParameter("teacher_name");
String pageNoss = request.getParameter("pageNopss");
int pageNo = Integer.parseInt(pageNoss);
List<Teacher> courses = courseDaoService.coursesSel(course_name, course_cno, teacher_name);
// 显示分页的总页数
int pageNos = courses.size() / 10;
int pageSize = 10;
if (courses.size() % 10 != 0) {
pageNos += 1;
}
// 分页显示记录
List<Teacher> coursePage = courseDaoService.coursesSelPage(course_name, course_cno, teacher_name, pageNo,
pageSize);
OnlineClassPage onlineClassPage = new OnlineClassPage();
onlineClassPage.setPageNo(pageNos);
onlineClassPage.setTeacher(coursePage);
System.out.println(onlineClassPage.toString());
return onlineClassPage;
}
// 分页显示所有已选课程
@RequestMapping("/courses")
@ResponseBody
public List<Score> courses(HttpServletRequest request, HttpServletResponse response, HttpSession session) {
String student_sno = request.getParameter("student_sno");
String course_cno = request.getParameter("course_cno");
String teacher_tno = request.getParameter("teacher_tno");
List<Score> scores = courseDaoService.scores(student_sno, course_cno, teacher_tno);
return scores;
}
// 显示所有已选课程
@RequestMapping(value = "/student/courses")
@ResponseBody
public OnlineClassPage studentcourses(HttpServletRequest request, HttpServletResponse response,
HttpSession session) {
String student_sno = request.getParameter("student_sno");
String course_cno = request.getParameter("course_cno");
String teacher_tno = request.getParameter("teacher_tno");
// 获取所选课程所有页数
List<Score> scores = courseDaoService.scores(student_sno, course_cno, teacher_tno);
String pageNoss = request.getParameter("pageNopss");
int pageNo = Integer.parseInt(pageNoss);
int pageSize = 10;
// 显示分页的总页数
int pageNos = scores.size() / 10;
if (scores.size() % 10 != 0) {
pageNos += 1;
}
System.out.println(scores.toString());
// 分页显示记录
List<Score> scoresPage = courseDaoService.scoresPage(student_sno, course_cno, teacher_tno, pageNo, pageSize);
OnlineClassPage onlineClassPage = new OnlineClassPage();
onlineClassPage.setPageNo(pageNos);
onlineClassPage.setScore(scoresPage);
return onlineClassPage;
}
// 根据学号、姓名、课程名查询学生成绩
@RequestMapping(value = "/student/coursesStu")
@ResponseBody
public OnlineClassPage coursesStu(HttpServletRequest request, HttpServletResponse response, HttpSession session) {
String student_sno = request.getParameter("student_sno");
String student_name = request.getParameter("student_name");
String teacher_name = request.getParameter("teacher_name");
String course_name = request.getParameter("course_name");
System.out.println("student_sno:" + student_sno);
System.out.println("student_name:" + student_name);
System.out.println("teacher_name:" + teacher_name);
System.out.println("course_name:" + course_name);
// 获取所选课程所有页数
List<Score> scores = courseDaoService.scoresStu(student_sno, student_name, teacher_name, course_name);
String pageNoss = request.getParameter("pageNopss");
int pageNo = Integer.parseInt(pageNoss);
int pageSize = 10;
// 显示分页的总页数
int pageNos = scores.size() / 10;
if (scores.size() % 10 != 0) {
pageNos += 1;
}
System.out.println(scores.toString());
// 分页显示记录
List<Score> scoresPage = courseDaoService.scoresStuPage(student_sno, student_name, teacher_name, course_name,
pageNo, pageSize);
OnlineClassPage onlineClassPage = new OnlineClassPage();
onlineClassPage.setPageNo(pageNos);
onlineClassPage.setScore(scoresPage);
return onlineClassPage;
}
// 修改课程信息
@RequestMapping(value = "/courses/coursesUpdate")
@ResponseBody
public OnlineClassPage coursesUpdate(HttpServletRequest request, HttpServletResponse response,
HttpSession session) {
String course_cno = request.getParameter("course_cno");
String course_name = request.getParameter("course_name");
String course_information = request.getParameter("course_information");
System.out.println(course_cno + " " + course_name + " " + course_information);
// 获取课程时间
String class_weekend = request.getParameter("class_weekend");
String class_time = request.getParameter("class_time");
int weekend = Integer.parseInt(class_weekend);
int times = Integer.parseInt(class_time);
System.out.println(class_time + " " + class_weekend);
ClassTime classTime = new ClassTime();
classTime.setCourse_cno(course_cno);
classTime.setClass_weekend(weekend);
classTime.setClass_time(times);
String pageNoss = request.getParameter("pageNopss");
int pageNo = Integer.parseInt(pageNoss);
List<Course> courses = courseDaoService.getCourse(course_cno, null);
// 显示分页的总页数
int pageNos = courses.size() / 10;
int pageSize = 10;
if (courses.size() % 10 != 0) {
pageNos += 1;
}
if (weekend > 7 || weekend < 1 || times > 6 || times < 1) {
System.out.println("修改失败!!!");
List<Course> coursePage = courseDaoService.getCoursePages(course_cno, null, pageNo, pageSize);
System.out.println(course_cno);
System.out.println(coursePage);
OnlineClassPage online
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源介绍】 基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip 【备注】 该项目是个人毕设项目,答辩评审分达到95分,代码都经过调试测试,确保可以运行!欢迎下载使用,可用于小白学习、进阶。 该资源主要针对计算机、通信、人工智能、自动化等相关专业的学生、老师或从业者下载使用,亦可作为期末课程设计、课程大作业、毕业设计等。 项目整体具有较高的学习借鉴价值!基础能力强的可以在此基础上修改调整,以实现不同的功能。 欢迎下载,欢迎沟通,互相学习,共同进步!提供答疑!
资源推荐
资源详情
资源评论
收起资源包目录
基于SpringBoot+Mybatis+Vue实现的一个在线选课系统.zip (285个子文件)
CourseController.class 11KB
CourseController.class 11KB
UserController.class 9KB
UserController.class 9KB
TeacherController.class 7KB
TeacherController.class 7KB
AdministorController.class 6KB
AdministorController.class 5KB
StudentController.class 5KB
StudentController.class 5KB
CourseDaoServiceImpl.class 4KB
CourseDaoServiceImpl.class 4KB
OnlineClassPage.class 4KB
OnlineClassPage.class 4KB
Teacher.class 4KB
Teacher.class 4KB
Student.class 3KB
Student.class 3KB
TeacherDaoServiceImpl.class 3KB
TeacherDaoServiceImpl.class 3KB
CourseDao.class 3KB
CourseDao.class 3KB
Score.class 3KB
Score.class 3KB
Course.class 3KB
Course.class 3KB
CourseDaoService.class 3KB
CourseDaoService.class 3KB
ScoreController.class 2KB
ScoreController.class 2KB
UserServiceImpl.class 2KB
UserServiceImpl.class 2KB
User.class 2KB
User.class 2KB
ClassTime.class 2KB
ClassTime.class 2KB
TeacherDao.class 2KB
TeacherDao.class 2KB
AdministorDaoServiceImpl.class 2KB
AdministorDaoServiceImpl.class 2KB
StudentDaoServiceImpl.class 2KB
StudentDaoServiceImpl.class 2KB
TeacherDaoService.class 2KB
TeacherDaoService.class 2KB
MD5Utils.class 2KB
MD5Utils.class 2KB
ScoreDaoServiceImpl.class 1KB
ScoreDaoServiceImpl.class 1KB
Age.class 1KB
Age.class 1KB
ClassTimeDaoServiceImpl.class 1KB
ClassTimeDaoServiceImpl.class 1KB
SpringbootMainApplication.class 1KB
SpringbootMainApplication.class 1KB
UserDao.class 1KB
UserDao.class 1KB
initController.class 1KB
initController.class 1KB
UserDaoService.class 1KB
UserDaoService.class 1KB
AdministorDao.class 1KB
AdministorDao.class 1KB
StudentDao.class 1020B
StudentDao.class 1020B
SendJsonData.class 973B
SendJsonData.class 973B
AdministorDaoService.class 901B
AdministorDaoService.class 901B
StudentDaoService.class 889B
StudentDaoService.class 889B
ScoreDaoService.class 804B
ScoreDaoService.class 804B
ScoreDao.class 786B
ScoreDao.class 786B
ClassTimeDao.class 755B
ClassTimeDao.class 755B
ClassTimeDaoService.class 622B
ClassTimeDaoService.class 622B
OnlineClassObject.class 410B
OnlineClassObject.class 410B
.classpath 1KB
iview.css 308KB
iview.css 308KB
login.css 4KB
login.css 4KB
login.css 4KB
administor.html 111KB
administor.html 111KB
administor.html 111KB
man.html 45KB
man.html 45KB
man.html 45KB
teacher.html 42KB
teacher.html 42KB
teacher.html 42KB
student.html 41KB
student.html 41KB
student.html 41KB
login.html 17KB
login.html 17KB
共 285 条
- 1
- 2
- 3
资源评论
z同学的编程之路
- 粉丝: 1861
- 资源: 2130
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ZEND解密dezender12
- sony 索尼IMX334摄像头模组电路板AD版硬件PCB图(6层板).zip
- 基于flask和echarts融合交易策略的bitfinex可视化微服务.zip
- 包含了wvp-assist.tar wvp-talk.tar zlmediakit.tar .
- 3r4efgh53wgrf43tw
- 2024新版Java基础从入门到精通全套视频+资料下载
- Spring AI大模型视频教程+ChatGPT视频教程+OpenAI大模型视频教程(资料+视频教程)
- ABB工业机器人教程PDF版本
- 123321123323211
- 三相桥式全桥整流电路MATALB Simulink仿真文件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功