作者主页:源码空间站2022
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
1、本系统使用SSM框架
2、有管理员、教师、学生三种角色,管理员使用admin/admin登录,教师使用t_01/6666登录,学生使用142001/111登录
3、管理员有最大权限,可以进行信息管理、教师管理、学生管理、选题管理、公告管理、查看已上传等;
4、教师角色包括个人信息管理、选题管理、进度管理、学生管理、疑问管理、文档管理、成绩管理
5、学生角色包括个人信息管理、课题管理、进度管理、文档管理、提问管理、查看答辩资格、成绩管理
管理员用户:admin 密码:admin
教师用户:t_01 密码:6666
学生用户:142001 密码:111
1.JDK配置
首先安装好JDK,我一般使用1.8版本的JDK。
2.安装IDEA
3.MySQL安装
4. IDEA/Eclipse配置Tomcat 8
MySQL一般安装5.7版本的。
package com.zc.web;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.zc.entity.Announcement;
import com.zc.entity.Student;
import com.zc.entity.Teacher;
import com.zc.entity.ThesisPaper;
import com.zc.entity.ThesisTitle;
import com.zc.entity.User;
import com.zc.service.IAnnouncementService;
import com.zc.service.IDepartmentService;
import com.zc.service.IMajorService;
import com.zc.service.IStudentService;
import com.zc.service.ITeacherService;
/**
*
* @author zhangC
* adminMainForm() 跳转到主页
* adminModifyPassword() 跳转 修改密码
* adminTeacherAdd() 跳转 教师添加
* adminTeacherManage() 跳转 教师管理
* adminStudentAdd() 跳转 学生添加
* adminStudentManage() 跳转 学生管理
* adminCheckThesis() 跳转 审核课题
* adminAnnouncement() 跳转 查看公告
* adminPublishAnnouncement() 跳转 发布公告
*
* @date 2018-4-8
* @author zhangC
* addTeacher() 添加教师到数据库中
* adminShowAllTeacher() 显示教师
* adminDeleteTeacher() 删除教师
* adminModifyTeacher() 跳转到教师修改页面,改页面显示要修改的教师信息
* adminModifyTeacherToDb() 把修改了的教师信息添加到数据库中
*
* @date 2018-4-9
* @author zhangC
* adminShowTeacherOne() 显示查询到的教师信息
*
* @date 2018-4-10
* @author zhangC
* addStudent() 添加学生
* adminShowAllStudent() 显示所有学生信息
* adminModifyStudent() 跳转到修改页面,便显示当前学生信息
* adminModifyStudentToDb() 修改学生信息,保存到数据库中
* adminDeleteStudent() 删除学生信息
* adminShowStudentOne() 显示单个学生信息,用于页面查询到。
*
* @date 2018-4-11
* @author zhangC
* adminCheckThesis() 修改了该方法,可以做到跳转页面的同时显示课题信息List
* agreeThesis() 把课题审核通过 修改status属性
* disgreeThesis() 课题不通过
*
* @date 2018-4-17
* @author zhangC
* adminPublishAnnouncement() 管理员发布公告
* adminDeleteAnnouncement() 管理员删除公告
*
* @date 2018-4-18
* @author zhangC
* adminShowThesisPaper() 管理员查看所有的最终论文
* fileDownload() 文件下载
*
*/
@Controller
@RequestMapping(value="/admin")
public class AdminContraller {
@Autowired
private ITeacherService teacherService;
@Autowired
private IDepartmentService departmentService;
@Autowired
private IStudentService studentService;
@Autowired
private IMajorService majorService;
@Autowired
private IAnnouncementService announcementService;
@RequestMapping(value="/main",method=RequestMethod.GET)
public String adminMainForm() {
return "admin/main.jsp";
}
@RequestMapping(value="/modifyPassword",method=RequestMethod.GET)
public String adminModifyPassword() {
return "admin/adminModifyPassword.jsp";
}
@RequestMapping(value="/teacherAdd",method=RequestMethod.GET)
public String adminTeacherAdd() {
return "admin/adminTeacherAdd.jsp";
}
@RequestMapping(value="/teacherManage",method=RequestMethod.GET)
public String adminTeacherManage() {
return "admin/adminTeacherManage.jsp";
}
@RequestMapping(value="/studentAdd",method=RequestMethod.GET)
public String adminStudentAdd() {
return "admin/adminStudentAdd.jsp";
}
@RequestMapping(value="/studentManage",method=RequestMethod.GET)
public String adminStudentManage() {
return "admin/adminStudentManage.jsp";
}
@RequestMapping(value="/checkThesis",method=RequestMethod.GET)
public String adminCheckThesis(Model model) {
List thesisList = teacherService.showAllThesisTitle();
for(int i=0;i list = announcementService.showAllAnnonucement();
SimpleDateFormat time=new SimpleDateFormat("yyyy-MM-dd");
for(int i=0;i teachers = teacherService.showAllTeacher();
for(int i=0;i teachers = teacherService.showTeacherOne1(teacherNo);
if(teachers.isEmpty()) {
model.addAttribute("showMessage", "没有与查询相匹配的教师信息");
}else {
for(int i=0;i teachers = teacherService.showTeacherOne2(teacherName);
if(teachers.isEmpty()) {
model.addAttribute("showMessage", "没有与查询相匹配的教师信息");
}else {
for(int i=0;i teachers = teacherService.showTeacherOne3(teacherNo, teacherName);
if(teachers.isEmpty()) {
model.addAttribute("showMessage", "没有与查询相匹配的教师信息");
}else {
for(int i=0;i students = studentService.showAllStudent();
for(int i=0;i students = studentService.showStudentOne1(studentNo);
if(students.isEmpty()) {
model.addAttribute("showMessage", "没有与查询相匹配的学生信息");
}else {
for(int i=0;i students = studentService.showStudentOne2(studentName);
if(students.isEmpty()) {
model.addAttribute("showMessage", "没有与查询相学生的教师信息");
}else {
for(int i=0;i students = studentService.showStudentOne3(studentNo, studentName);
if(students.isEmpty()) {
model.addAttribute("showMessage", "没有与查询相匹配的学生信息");
}else {
for(int i=0;i paperList = teacherService.getAllPaper();
List studentList = new ArrayList();
Student s = new Student();
for(int i=0;i fileDownload(HttpServletRequest request, @RequestParam("filePath") String filePath,@RequestParam("fileName") String fileName, Model model) throws Exception {
fileName = new String(fileName.getBytes("iso-8859-1"),"utf-8");
filePath = new String(filePath.getBytes("iso-8859-1"),"utf-8");
File file = new File(filePath);
HttpHeaders headers = new HttpHeaders();
String downloadFile = new String(fileName.getBytes("utf-8"), "iso-8859-1");
headers.setContentDispositionFormData("attachment", downloadFile);
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
return new ResponseEntity(FileUtils.readFileToByteArray(file),headers,HttpStatus.CREATED);
}
}
package com.zc.web;
import java.io.PrintWriter;
import java.util.List;
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 com.zc.entity.Major;
import com.zc.service.IMajorService;
import net.sf.json.JSONArray;
/**
*
* @author zhangC
*
* showAllMajor() 获得所有专业信息
*
*/
@Controller
public class MajorContraller {
@Autowired
private IMajorService majorService;
@RequestMapping(value="/getAllMajor")
public String showAllMajor(HttpServletResponse response,HttpServletRequest request) throws Exception {
List majors = majorService.allMajor();
JSONArray json = JSONArray.fromObject(majors);
response.setContentType("text/html;charset=UTF-8");
PrintWriter write = response.getWriter();
write.write(json.toString());
write.close();
return "admin/adminStudentAdd.jsp";
}
}
如果也想学习本系统,下面领取。关注并回复:005ssm