基于ssm的学生选课管理系统的设计与实现
一、功能介绍
管理员功能分析
1、管理员用户可以查询所有学生信息,也可以根据学生的学号、学院、专业、班级查询学生信息。可以修改学生的姓名、年龄、身份证号、性别、密码、专业、学院、班级,可以增加、删除学生
2、管理员用户可以查询所有教师信息,也根据教师的编号进行查询,可以修改教师的姓名、性别、密码、个人简介,也可以增加、删除教师
3、管理员用户可以查询所有课程,也可以根据课程编号、课程名、所属学院、课程类型查询课程。可以修改课程名、课程简介、课程类型(是否必修)、系信息、专业信息进行修改。也可以增加删除课程
教师功能分析
1、教师用户可以查看课程,可以根据课程编号、课程名、所属学院、课程类型查看课程;
2、教师用户选择可教课程,并设置教课时间、教课日、教课班级、上课教师、学分、学时、总人数;
3、教师用户修改所选课程的教课时间、教课日、教课班级、上课教师、学分、学时、总人数;
4、教师用户可以查看自己所教课程的选课结果,查询选课学生的学号、姓名、性别、班级、专业、学院 ;
5、教师用户可以给学生打分。
6、教师用户可以修改自己的密码。
学生功能分析
1、学生用户可以查询全部课程,也可以通过课程名、课程编号、所属学院课程类型进行查询。并进行选课。
2、学生用户可以查看选课结果。
3、学生用户可以退选已选课程。
4、学生用户可以查看已修课程。
5、学生用户可以修改自己的密码
二、实现截图
三、部分代码
package net.fuzui.StudentInfo.handler;import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;import net.fuzui.StudentInfo.service.CoursePlanService;
import net.fuzui.StudentInfo.service.CourseService;
import net.fuzui.StudentInfo.service.StudentService;
import net.fuzui.StudentInfo.service.TeacherService;@Controller
@RequestMapping("/AjaxHandler")
public class AjaxHandler {@AutowiredCourseService courseService;@AutowiredStudentService studentService;@AutowiredTeacherService teacherService;@AutowiredCoursePlanService coursePlanService;/*** ajax验证课程编号是否存在* @param cid* @param response* @param request* @throws IOException*/@RequestMapping(value="/existCid",method = RequestMethod.POST)public void existCid(@RequestParam("cid") String cid,HttpServletResponse response,HttpServletRequest request) throws IOException{System.out.println("课程编号="+cid);response.setContentType("text/html;charset=UTF-8");response.setHeader("Cache-Control", "no-cache");System.out.println(cid+"----------");PrintWriter out=null;out=response.getWriter();if(courseService.getByCouCid(cid) != null && cid !=null && !"".equals(cid)){out.println("课程编号已存在");}else if(cid !=null && !"".equals(cid)){out.println("此课程编号可以使用");}else {out.println("课程编号不能为空");}out.flush();out.close();}@RequestMapping(value="/existSid",method = RequestMethod.POST)public void existSid(@RequestParam("sid") String sid,HttpServletResponse response,HttpServletRequest request) throws IOException{System.out.println("学号="+sid);response.setContentType("text/html;charset=UTF-8");response.setHeader("Cache-Control", "no-cache");PrintWriter out=null;out=response.getWriter();if(studentService.getByStuSid(sid) != null && sid.length() ==12){out.println("学号已存在");}else if(sid.length() ==12){out.println("学号可以使用");}else {out.println("学号必须是12位");}out.flush();out.close();}//ajax验证教师id@RequestMapping(value="/existTid",method = RequestMethod.POST)public void existTid(@RequestParam("tid") String tid,HttpServletResponse response,HttpServletRequest request) throws IOException{response.setContentType("text/html;charset=UTF-8");response.setHeader("Cache-Control", "no-cache");PrintWriter out=null;out=response.getWriter();if(teacherService.getByTeaTid(tid) != null && tid.length() <=5){out.println("教师编号已存在");}else if(tid.length() <=12){out.println("教师编号可以使用");}else {out.println("教师编号必须小于等于5位");}out.flush();out.close();}@RequestMapping(value="/existTime",method = RequestMethod.POST)public void existTime(@RequestParam("coursetime") String coursetime,@RequestParam("courseweek") String courseweek,@RequestParam("classroom") String classroom,HttpServletResponse response,HttpServletRequest request) throws IOException{response.setContentType("text/html;charset=UTF-8");response.setHeader("Cache-Control", "no-cache");PrintWriter out=null;System.out.println("--------------------------");System.out.println(coursetime+"---"+courseweek+"---"+classroom);out=response.getWriter();if(coursePlanService.ajaxGetCoursePlan(coursetime,courseweek,classroom) != null){//out.println("此功能排重正在开发中.....");}else {//out.println("此功能排重正在开发中.....");}out.flush();out.close();}}
数据库及完整代码咨询,请扫码