🍅 Author’s home page: Java Yang Yong Lee 🍅 Home page contact 🍅 for source code

Near the end of the semester, or graduation project, you are still doing Java program network programming, the final homework, the teacher’s homework requirements feel too big? Don’t know what to do with the graduation project? Are there too many web features? Don’t have the right type or system? And so on. Here, any problem you want to solve, can be met here. Original Jsp, SSM, SpringBoot, as well as HTML+CSS+JS page design, web college student web page design source code and so on can be referenced to be solved. Without further discussion, let’s take an online student course selection system for example

 

Introduction:

Our school was upgraded to an undergraduate university after the merger of three colleges, and weifang Art School was merged in a few years ago. Therefore, the level of students is stepped and the training mode is diversified. Therefore, the workload of course selection and course arrangement, which is one of the core work of college education and teaching, is bound to increase in series. Obviously, the traditional way of selecting and arranging courses can not adapt to the special educational situation of our school. It is urgent to design a campus course selection management system to improve its work efficiency. At present, the university has 22 teaching units, 68 undergraduate majors, and more than 23,000 full-time students. Campus course selection management system will fully CRMc2] technology and ideas into the campus information system, so that all teachers and students can take the convenience of campus management system for scientific research and learning, very good to solve the previous students difficult to choose courses, teachers workload and other problems. Compared with the traditional way of selecting courses, the management system of selecting courses based on Java replaces manpower with computer, closely connecting the administrators, teachers and students of the school, and achieving efficient communication of information. With this course selection system, the school’s educational management staff can make the teaching resources can be quickly and reasonably allocated to use, in order to minimize the waste of resources; Teachers and course selection administrators can greatly improve their work efficiency, so that they can have more time and energy to focus on their own work; Students can ensure the timeliness and accuracy of online course selection and avoid the failure and delay of course selection caused by uncertain factors such as repetition and congestion. It fully embodies the advantages of systematic management in this information age.

Main function design:

Runtime environment: Java JDK 1.8, mysql5, Tomcat 7. X,8. X,9

Main technology: HTML+CSS+JavaScript+ JSP +mysql

Main character design:

1. Administrator: administrator login, student management, teacher management, class management, add classes, add teachers, add students, course management, add courses, system user management, add users, modify password and other functions. 2. Teacher: teacher login, course selection management, add course selection students, score management, add scores, view student information, view class information, view personal files, modify password and other functions. 3. Students: Students login, course selection management, grade view, view personal files, modify password and other functions

Screenshots of main functions:

User login:

Enter the account password to select a user role for login. Each role has different function rights

Administrator home page:

Administrator login after the main function modules are: student management, teacher management, class management, add class, add teachers, add students, course management, add courses, system user management, add users, modify password and other functions.

Add student:

Teacher management:

You can query data according to the name of the teacher, and add, modify, delete the teacher information

Class management

Add class information:

Course management and addition

 

Change password:

Student login system:

Main function design: student login, course selection management, grade view, view personal files, modify password and other functions

Teacher login system:

Teacher login, elective management, add elective students, score management, add scores, view student information, view class information, view personal files, modify password and other functions

Main source code display:

Login form processing:

@RequestMapping(value = "/login", Method = {requestmethod. POST}) public String login(Userlogin Userlogin) throws Exception {//Shiro Implements login...... UsernamePasswordToken token = new UsernamePasswordToken(userlogin.getUsername(), userlogin.getPassword()); Subject subject = SecurityUtils.getSubject(); // If the user fails to obtain the user name, an exception will be thrown. subject.login(token); If (subject.hasrole ("admin")& userlogin.getrole ()==0) {}else throw new CustomException(" Please login with the correct id "); // The business layer implements dao data layer operations...... public Userlogin findByName(String name) throws Exception { UserloginExample userloginExample = new UserloginExample(); UserloginExample.Criteria criteria = userloginExample.createCriteria(); criteria.andUsernameEqualTo(name); List<Userlogin> list = userloginMapper.selectByExample(userloginExample); return list.get(0); }Copy the code

Course Management Enquiry:

@requestMapping ("/showCourse") public String showCourse(Model Model, Integer page) throws Exception { List<CourseCustom> list = null; // Page number object...... PagingVO pagingVO = new PagingVO(); // Set the total number of pages...... pagingVO.setTotalCount(courseService.getCountCouse()); if (page == null || page == 0) { pagingVO.setToPageNo(1); list = courseService.findByPaging(1); } else { pagingVO.setToPageNo(page); list = courseService.findByPaging(page); } model.addAttribute("courseList", list); model.addAttribute("pagingVO", pagingVO); return "admin/showCourse"; }Copy the code

Teacher enquiries:

Background data operation display, background encapsulation data and paging processing data // teacher page display...... @RequestMapping("/showTeacher") public String showTeacher(Model model, Integer page) throws Exception { List<TeacherCustom> list = null; // Page number object... PagingVO pagingVO = new PagingVO(); // Set the total number of pages...... pagingVO.setTotalCount(teacherService.getCountTeacher()); if (page == null || page == 0) { pagingVO.setToPageNo(1); list = teacherService.findByPaging(1); } else { pagingVO.setToPageNo(page); list = teacherService.findByPaging(page); } model.addAttribute("teacherList", list); model.addAttribute("pagingVO", pagingVO); return "admin/showTeacher"; } // query teacher information on page...... List<TeacherCustom> findByPaging(Integer toPageNo) throws Exception;Copy the code

Student information display:

// Student information display...... @RequestMapping("/showStudent") public String showStudent(Model model, Integer page) throws Exception { List<StudentCustom> list = null; // Page number object...... PagingVO pagingVO = new PagingVO(); // Set the total number of pages...... pagingVO.setTotalCount(studentService.getCountStudent()); if (page == null || page == 0) { pagingVO.setToPageNo(1); list = studentService.findByPaging(1); } else { pagingVO.setToPageNo(page); list = studentService.findByPaging(page); } model.addAttribute("studentList", list); model.addAttribute("pagingVO", pagingVO); return "admin/showStudent"; } // Add student info... @RequestMapping(value = "/addStudent", method = {RequestMethod.POST}) public String addStudent(StudentCustom studentCustom, Model model) throws Exception { Boolean result = studentService.save(studentCustom); if (! Result) {model. AddAttribute ("message", "duplicate "); return "error"; } // Add it to the login table...... Userlogin userlogin = new Userlogin(); userlogin.setUsername(studentCustom.getUserid().toString()); userlogin.setPassword("123"); userlogin.setRole(2); userloginService.save(userlogin); // Redirect... return "redirect:/admin/showStudent"; } // Completed courses...... @requestMapping (value = "/overCourse") Public String overCourse(Model Model) throws Exception {// Obtain the current user name...... Subject subject = SecurityUtils.getSubject(); StudentCustom studentCustom = studentService.findStudentAndSelectCourseListByName((String) subject.getPrincipal()); StudentCustom ==null if (studentCustom==null){throw new CustomException(" You haven't completed any classes yet, please select one class." ); } List<SelectedCourseCustom> list = studentCustom.getSelectedCourseList(); model.addAttribute("selectedCourseList", list); return "student/overCourse"; }Copy the code

Change password:

// Reset the password of this account...... @RequestMapping(value = "/passwordRest", method = {RequestMethod.POST}) public String passwordRest(String oldPassword, String password1) throws Exception { Subject subject = SecurityUtils.getSubject(); String username = (String) subject.getPrincipal(); Userlogin userlogin = userloginService.findByName(username); if (! Oldpassword.equals (userlogin.getpassword ())) {throw new CustomException(" oldPassword incorrect..." ); } else { userlogin.setPassword(password1); userloginService.updateByName(username, userlogin); } return "redirect:/logout"; }Copy the code

Part of database design:

DROP TABLE IF EXISTS `college`;
CREATE TABLE `college` (
  `collegeID` int(11) NOT NULL,
  `collegeName` varchar(200) NOT NULL COMMENT '课程名',
  PRIMARY KEY (`collegeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of college
-- ----------------------------
INSERT INTO `college` VALUES ('1', '计算机系');
INSERT INTO `college` VALUES ('2', '设计系');
INSERT INTO `college` VALUES ('3', '财经系');

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `courseID` int(11) NOT NULL,
  `courseName` varchar(200) NOT NULL COMMENT '课程名称',
  `teacherID` int(11) NOT NULL,
  `courseTime` varchar(200) DEFAULT NULL COMMENT '开课时间',
  `classRoom` varchar(200) DEFAULT NULL COMMENT '开课地点',
  `courseWeek` int(200) DEFAULT NULL COMMENT '学时',
  `courseType` varchar(20) DEFAULT NULL COMMENT '课程类型',
  `collegeID` int(11) NOT NULL COMMENT '所属院系',
  `score` int(11) NOT NULL COMMENT '学分',
  PRIMARY KEY (`courseID`),
  KEY `collegeID` (`collegeID`),
  KEY `teacherID` (`teacherID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of course
-- ----------------------------
INSERT INTO `course` VALUES ('1', 'C语言程序设计', '1001', '周二', '科401', '18', '必修课', '1', '3');
INSERT INTO `course` VALUES ('2', 'Python爬虫技巧', '1001', '周四', 'X402', '18', '必修课', '1', '3');
INSERT INTO `course` VALUES ('3', '数据结构', '1001', '周四', '科401', '18', '必修课', '1', '2');
INSERT INTO `course` VALUES ('4', 'Java程序设计', '1002', '周五', '科401', '18', '必修课', '1', '2');
INSERT INTO `course` VALUES ('5', '英语', '1002', '周四', 'X302', '18', '必修课', '2', '2');
INSERT INTO `course` VALUES ('6', '服装设计', '1003', '周一', '科401', '18', '选修课', '2', '2');

-- ----------------------------
-- Table structure for file
-- ----------------------------
DROP TABLE IF EXISTS `file`;
CREATE TABLE `file` (
  `fileID` varchar(100) COLLATE utf8_bin NOT NULL,
  `fileName` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `fileDesc` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `filePath` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `userID` int(11) DEFAULT NULL,
  `fileExt1` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `fileExt2` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `fileExt3` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`fileID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of file
-- ----------------------------
INSERT INTO `file` VALUES ('3192d10378ea44d88d8b558562a480e3', '理工类模板.docx', '理工类模板.docx', 'E://upload/3192d10378ea44d88d8b558562a480e3.docx', null, null, null, null);
INSERT INTO `file` VALUES ('59c0f03696be4e73a64c7625f1887e88', '测测1231', '十分大师傅十分213', 'E://upload/59c0f03696be4e73a64c7625f1887e88.jpg', null, null, null, null);
INSERT INTO `file` VALUES ('8a1d671ba48f441ead14255e9fda3c96', '测测123', 'wrwerwer', 'E://upload/8a1d671ba48f441ead14255e9fda3c96.sql', null, null, null, null);

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `roleID` int(11) NOT NULL,
  `roleName` varchar(20) NOT NULL,
  `permissions` varchar(255) DEFAULT NULL COMMENT '权限',
  PRIMARY KEY (`roleID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('0', 'admin', null);
INSERT INTO `role` VALUES ('1', 'teacher', null);
INSERT INTO `role` VALUES ('2', 'student', null);

-- ----------------------------
-- Table structure for selectedcourse
-- ----------------------------
DROP TABLE IF EXISTS `selectedcourse`;
CREATE TABLE `selectedcourse` (
  `courseID` int(11) NOT NULL,
  `studentID` int(11) NOT NULL,
  `mark` int(11) DEFAULT NULL COMMENT '成绩',
  KEY `courseID` (`courseID`),
  KEY `studentID` (`studentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of selectedcourse
-- ----------------------------
INSERT INTO `selectedcourse` VALUES ('2', '10001', '12');
INSERT INTO `selectedcourse` VALUES ('1', '10001', '95');
INSERT INTO `selectedcourse` VALUES ('1', '10002', '66');
INSERT INTO `selectedcourse` VALUES ('2', '10003', '99');
INSERT INTO `selectedcourse` VALUES ('5', '10001', null);
INSERT INTO `selectedcourse` VALUES ('3', '10001', null);
INSERT INTO `selectedcourse` VALUES ('1', '10003', null);
INSERT INTO `selectedcourse` VALUES ('4', '10003', null);

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(200) NOT NULL,
  `sex` varchar(20) DEFAULT NULL,
  `birthYear` date DEFAULT NULL COMMENT '出生日期',
  `grade` date DEFAULT NULL COMMENT '入学时间',
  `collegeID` int(11) NOT NULL COMMENT '院系id',
  PRIMARY KEY (`userID`),
  KEY `collegeID` (`collegeID`)
) ENGINE=InnoDB AUTO_INCREMENT=10006 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO `student` VALUES ('9999', 'mike1', '男', '1996-09-03', '2019-11-13', '3');
INSERT INTO `student` VALUES ('10001', '小红', '男', '2020-03-02', '2020-03-02', '1');
INSERT INTO `student` VALUES ('10002', '小绿', '男', '2020-03-10', '2020-03-10', '1');
INSERT INTO `student` VALUES ('10003', '小陈', '女', '1996-09-02', '2015-09-02', '2');
INSERT INTO `student` VALUES ('10005', '小左', '女', '1996-09-02', '2015-09-02', '2');

-- ----------------------------
-- Table structure for teacher
-- ----------------------------
DROP TABLE IF EXISTS `teacher`;
CREATE TABLE `teacher` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(200) NOT NULL,
  `sex` varchar(20) DEFAULT NULL,
  `birthYear` date NOT NULL,
  `degree` varchar(20) DEFAULT NULL COMMENT '学历',
  `title` varchar(255) DEFAULT NULL COMMENT '职称',
  `grade` date DEFAULT NULL COMMENT '入职时间',
  `collegeID` int(11) NOT NULL COMMENT '院系',
  PRIMARY KEY (`userID`),
  KEY `collegeID` (`collegeID`)
) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of teacher
-- ----------------------------
INSERT INTO `teacher` VALUES ('1001', '刘老师', '女', '1990-03-08', '硕士', '副教授', '2015-09-02', '2');
INSERT INTO `teacher` VALUES ('1002', '张老师', '女', '1996-09-02', '博士', '讲师', '2015-09-02', '1');
INSERT INTO `teacher` VALUES ('1003', '软老师', '女', '1996-09-02', '硕士', '助教', '2017-07-07', '1');

-- ----------------------------
-- Table structure for userlogin
-- ----------------------------
DROP TABLE IF EXISTS `userlogin`;
CREATE TABLE `userlogin` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(200) NOT NULL,
  `password` varchar(200) NOT NULL,
  `role` int(11) NOT NULL DEFAULT '2' COMMENT '角色权限',
  PRIMARY KEY (`userID`),
  KEY `role` (`role`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of userlogin
-- ----------------------------
INSERT INTO `userlogin` VALUES ('1', 'admin', '123', '0');
INSERT INTO `userlogin` VALUES ('10', '10003', '123', '2');
INSERT INTO `userlogin` VALUES ('11', '10005', '123', '2');
INSERT INTO `userlogin` VALUES ('14', '1001', '123', '1');
INSERT INTO `userlogin` VALUES ('15', '1002', '123', '1');
INSERT INTO `userlogin` VALUES ('16', '1003', '123', '1');
INSERT INTO `userlogin` VALUES ('20', '9999', '123', '2');
INSERT INTO `userlogin` VALUES ('21', '10001', '123', '2');
INSERT INTO `userlogin` VALUES ('22', '10002', '123', '2');
Copy the code

Generally speaking, this project is suitable for Java college students to use as a reference for course design or Java graduation project

Well, that’s it for today. I’m Obama. See you next time

Clocked articles updated 75/100 days