Java classic foundation project -- detailed design of student information management system [with source code]

Posted by acrayne on Thu, 14 Oct 2021 01:25:28 +0200

🍅 Author home page: Li Yangyong  

🍅 Introduction: high quality creator in Java field 🏆, [Li Yangyong] author of public account ✌   Resume template, learning materials, interview question bank [pay attention to me and give it to you]

🍅 Get the source code at the end of the article 🍅

  Near the end of the semester, or graduation project, you are still doing java program, network programming and final homework. Do you think the teacher's homework requirements are big? I don't know what to do with my graduation project? Are there too many web features? No suitable type or system? wait. Here, the problem you want to solve is in the column below 👇🏻👇🏻👇🏻👇🏻

❤️Java project boutique practical case❤️

❤️Web front end final homework web page practice❤️

  Can meet your needs. The original Jsp, SSM, SpringBoot, HTML+CSS+JS page design, web college students' web design homework source code and so on can be solved by reference. Without much to say, take a student information management system as an example

Summary design:

        This system design takes convenience, quickness and security as the starting point, abandons the defects and deficiencies of traditional manual records on student information management, and adopts a new way to enable the school to store and maintain student information and increase management efficiency. The system is generally divided into three modules: administrator login management background, student login course selection and teaching to teachers, and gives administrators many functions to operate the system, including: student management, teacher management, course selection management, password modification and so on; It provides student users with functions such as course query, selection, password modification, etc. Through the design of these functional modules, the functions required by teachers to control students' information are met. The system adopts B/S three-tier structure and JSP technology for the production of dynamic pages. In order to realize the safety and reliability of the management system and the reuse of some codes, Java beans are used to encapsulate the important codes of the program. The system implements the people-oriented idea and has high practicability.  

System function overview:

The main modules are designed as follows:

Use Shiro permission management framework to realize login verification and storage of login information, distribute permission roles according to different login accounts, and set roles for different page URLs.

    Administrators can add, delete, modify and query teacher information, student information and course information. Administrators can reset the password of non administrator accounts.

Course management: when students have successfully selected courses, student management cannot be deleted: when adding student information, its information will also be added to the login form. Teacher management: the same as above

Account password reset:

After logging in, teachers can get the list of courses they teach, and can score the students who have selected the course. They can't perform secondary operations on the students who have finished scoring

After students log in, they can obtain the courses they have selected and completed according to the student information

All courses: elective courses here. After selection, it will automatically jump to the selected course options

Selected courses: the courses that have not been completed are displayed here, that is, the teacher has not given grades. Since no grades have been given, you can withdraw from the course here

Courses completed: displays the courses that have been completed and the teacher has changed the password for the grades:

  Screenshot of main functions:  

User login: user login is to select roles to log in: administrator, teacher and student

System home page: after the administrator logs in, the specific function module can add, delete, modify and query teacher information, student information and course information. The administrator account can reset the password of non administrator account.

Course management: course list management and adding courses

  Add and enter course information

Student management: student list management and adding students

  Add student information

Teacher management:

File upload and download:  

File list and download files

File upload

Account number related:  

After the teacher logs in, the main page displays:

View lecture list

View student information for this course

Grade students' grades  

  Student user login:

  According to the student information, obtain the courses they have selected and the courses they have completed

  Main code display:  

Login related

package com.system.controller;

import com.system.exception.CustomException;
import com.system.po.Userlogin;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Li Yangyong
 */
@Controller
public class LoginController {

    //Login jump
    @RequestMapping(value = "/login", method = {RequestMethod.GET})
    public String loginUI() throws Exception {
        return "../../login";
    }

    //Login form processing
    @RequestMapping(value = "/login", method = {RequestMethod.POST})
    public String login(Userlogin userlogin) throws Exception {

        //Shiro login
        UsernamePasswordToken token = new UsernamePasswordToken(userlogin.getUsername(),
                userlogin.getPassword());
        Subject subject = SecurityUtils.getSubject();

        //If the user name cannot be obtained, the login fails. If the login fails, an exception will be thrown directly
        subject.login(token);
        if (subject.hasRole("admin")&userlogin.getRole()==0) {
                return "redirect:/admin/showStudent";
        } else if (subject.hasRole("teacher")&userlogin.getRole()==1) {
                return "redirect:/teacher/showCourse";
        } else if (subject.hasRole("student")&userlogin.getRole()==2) {
                return "redirect:/student/showCourse";
        }else throw new CustomException("Please select the correct identity to log in");


    }

}

File upload

package com.system.controller;

import com.system.po.FileVO;
import com.system.service.FileService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.UUID;

/**
 * File upload and download
 */
@Controller
@RequestMapping("/file")
public class FileController {


    @Resource(name = "fileServiceImpl")
    private FileService fileService;

    @RequestMapping("/upload")
    public String  fileUpload(@RequestParam MultipartFile file, FileVO filevo, HttpServletRequest request) throws IOException {
        //Upload path save settings
        // Write files to disk
        String fileName = file.getOriginalFilename();
        String[] str = fileName.split("\\.");
        String uuid = UUID.randomUUID().toString().replaceAll("-","");
        String headPath = "E://upload/" + uuid+ "."+str[str.length-1];
        File dest = new File(headPath);
        file.transferTo(dest);
        filevo.setFileID(uuid);
        filevo.setFilePath(headPath);
        filevo.setUserID(null);
        try {
            fileService.save(filevo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "redirect:/admin/showFile";
    }


    @RequestMapping("/downFile")
    public void down(HttpServletRequest request, HttpServletResponse response,String fileID) throws Exception{
        FileVO fileVO = fileService.findById(fileID);
        String fileName = fileVO.getFilePath();
        String[] str = fileName.split("\\.");
        InputStream bis = new BufferedInputStream(new FileInputStream(new File(fileName)));
        String filename =  fileVO.getFileName()+"\\."+str[str.length-1];
        filename = URLEncoder.encode(filename,"UTF-8");
        response.addHeader("Content-Disposition", "attachment;filename=" + filename);
        response.setContentType("multipart/form-data");
        BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
        int len = 0;
        while((len = bis.read()) != -1){
            out.write(len);
            out.flush();
        }
        out.close();
    }

}

exception handling

package com.system.exception;

/**
 *  The system defines the exception class. For the expected exception, you need to throw this kind of exception in the program
 */
public class CustomException extends Exception {

    //Abnormal information
    public String message;

    public CustomException(String message) {
        super(message);
        this.message=message;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}

  Main database design:

  The main data tables include: specialty table, curriculum table, document information table, role table, student course selection table, teacher table, student table, etc

CREATE TABLE `college` (
  `collegeID` int(11) NOT NULL,
  `collegeName` varchar(200) NOT NULL COMMENT 'Course name',
  PRIMARY KEY (`collegeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `college` */

insert  into `college`(`collegeID`,`collegeName`) values 

(1,'Computer Department'),

(2,'Design Department'),

(3,'Department of Finance and Economics');

/*Table structure for table `course` */

DROP TABLE IF EXISTS `course`;

CREATE TABLE `course` (
  `courseID` int(11) NOT NULL,
  `courseName` varchar(200) NOT NULL COMMENT 'Course name',
  `teacherID` int(11) NOT NULL,
  `courseTime` varchar(200) DEFAULT NULL COMMENT 'Opening time',
  `classRoom` varchar(200) DEFAULT NULL COMMENT 'Starting place',
  `courseWeek` int(200) DEFAULT NULL COMMENT 'Class hours',
  `courseType` varchar(20) DEFAULT NULL COMMENT 'Course type',
  `collegeID` int(11) NOT NULL COMMENT 'Affiliated colleges and departments',
  `score` int(11) NOT NULL COMMENT 'credit',
  PRIMARY KEY (`courseID`),
  KEY `collegeID` (`collegeID`),
  KEY `teacherID` (`teacherID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `course` */

insert  into `course`(`courseID`,`courseName`,`teacherID`,`courseTime`,`classRoom`,`courseWeek`,`courseType`,`collegeID`,`score`) values 

(1,'C Language programming',1001,'Tuesday','Section 401',18,'required course',1,3),

(2,'Python Reptile skills',1001,'Thursday','X402',18,'required course',1,3),

(3,'data structure',1001,'Thursday','Section 401',18,'required course',1,2),

(4,'Java Programming',1002,'Friday','Section 401',18,'required course',1,2),

(5,'English',1002,'Thursday','X302',18,'required course',2,2),

(6,'clothing design',1003,'Monday','Section 401',18,'Elective courses',2,2);

/*Table structure for table `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 'jurisdiction',
  PRIMARY KEY (`roleID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `role` */

insert  into `role`(`roleID`,`roleName`,`permissions`) values 

(0,'admin',NULL),

(1,'teacher',NULL),

(2,'student',NULL);

/*Table structure for table `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 'achievement',
  KEY `courseID` (`courseID`),
  KEY `studentID` (`studentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `selectedcourse` */

insert  into `selectedcourse`(`courseID`,`studentID`,`mark`) values 

(2,10001,12),

(1,10001,95),

(1,10002,66),

(2,10003,99),

(5,10001,NULL),

(3,10001,NULL),

(1,10003,NULL),

(4,10003,NULL);

/*Table structure for table `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 'date of birth',
  `grade` date DEFAULT NULL COMMENT 'Admission time',
  `collegeID` int(11) NOT NULL COMMENT 'Faculty id',
  PRIMARY KEY (`userID`),
  KEY `collegeID` (`collegeID`)
) ENGINE=InnoDB AUTO_INCREMENT=10008 DEFAULT CHARSET=utf8;

/*Data for the table `student` */

insert  into `student`(`userID`,`userName`,`sex`,`birthYear`,`grade`,`collegeID`) values 

(9999,'mike1','male','1996-09-03','2019-11-13',3),

(10001,'Xiao Hong','male','2020-03-02','2020-03-02',1),

(10002,'Little green','male','2020-03-10','2020-03-10',1),

(10003,'Xiao Chen','female','1996-09-02','2015-09-02',2),

(10005,'Small left','female','1996-09-02','2015-09-02',2),

(10007,'MIke','male','1996-09-02','2015-09-02',2);

/*Table structure for table `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 'education',
  `title` varchar(255) DEFAULT NULL COMMENT 'title',
  `grade` date DEFAULT NULL COMMENT 'Entry time',
  `collegeID` int(11) NOT NULL COMMENT 'Faculty',
  PRIMARY KEY (`userID`),
  KEY `collegeID` (`collegeID`)
) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8;

/*Data for the table `teacher` */

insert  into `teacher`(`userID`,`userName`,`sex`,`birthYear`,`degree`,`title`,`grade`,`collegeID`) values 

(1001,'Miss Liu','female','1990-03-08','master','associate professor','2015-09-02',2),

(1002,'Miss Zhang','female','1996-09-02','doctor','lecturer','2015-09-02',1),

(1003,'Soft teacher','female','1996-09-02','master','assistant','2017-07-07',1);

/*Table structure for table `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 'Role permissions',
  PRIMARY KEY (`userID`),
  KEY `role` (`role`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;

/*Data for the table `userlogin` */

insert  into `userlogin`(`userID`,`userName`,`password`,`role`) values 

(1,'admin','123',0),

(10,'10003','123',2),

(11,'10005','123',2),

(14,'1001','123',1),

(15,'1002','123',1),

(16,'1003','123',1),

(20,'9999','123',2),

(21,'10001','123',2),

(22,'10002','123',2);

Paper structure and catalogue design:

1, Introduction 4

1.1 research background 4

1.2 system design overview 4

1.3 research contents 5

2, Introduction to related technologies 5

2.1 spring 5

2.2 Spring MVC 6

2.3 mybatis 7

2.4 JSP technology 7

2.5 jQuery 8

2.6 Mysql 8

3, Demand analysis and feasibility 11

3.1 system function overview 11

3.2 system operation environment 11

3.3 technical design 12

3.4 social feasibility 12

3.5 safety feasibility 12

3.6 economic feasibility 12

3.7 legal feasibility 12

4, System design 13

4.1 system mode architecture 13

4.2 system hierarchy 13

4.3 detailed design of system functions 14

4.4 data flow diagram 14

4.5 source code architecture 15

5, System implementation 17

5.1 main categories of procedures 17

5.1.1 User Login Class 17

5.1.2 teacher information 17

5.1.3 role permission category 17

5.1.4 course information 17

5.1.5 student information 18

5.1.6 students' course selection 18

5.2 screenshot of main modules of system functions 18

5.2.1 key code implementation 18

5.2.2 screenshot of some functions 23

6, Database design 26

Table 6.1 basic design 26

6.2 database three paradigm requirements: 26

6.3 database table ER figure 27

6.4 design of user login form 27

6.5 teacher table design 28

6.6 design of student information table 29

6.7 design of student course selection table 30

6.8 design of role permission table 31

  6.9 curriculum design 31

6.10 department table design 32

7, Development experience 33

8, Test case 33

9, Reference contribution 34

  Recommendations for design and implementation of relevant systems:

Design and implementation of front and back office of film ticketing website management system based on java springboot+mybatis

Design and implementation of spring boot + mybatis winery internal management system based on Java SSM

Design and implementation of smart life sharing platform based on JAVA springboot+mybatis

Design and implementation of furniture mall platform based on Java springboot+vue+redis

Design and implementation of anti epidemic substance information management system based on JAVA SSM springboot

See more bloggers' homepage and more practical projects > > >

Well, that's all for today. Let's praise, collect and comment. Let's go. See you next time~~

Get the complete source code:

Everyone likes, collects, pays attention to, comments and views 👇🏻👇🏻👇🏻 WeChat official account gets contact 👇🏻👇🏻👇🏻

Punch in article update   79/   100 days

  Highlight column recommendations:

100 sets of high-quality practical case of Java completion project

HTML5 operation case "100 sets"

Web operation front-end web page practice "100 sets"

Topics: Front-end Database Spring MVC