基于javaweb的SSM毕业设计管理系统(java+ssm+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

010023182402

020023182402

030023182402

040023182402

050023182402

基于javaweb的SSM毕业设计管理系统(java+ssm+jsp+mysql)

一、项目简述

功能包括: 该系统不错分为学生,教师,管理员,教导主任四种角 色,包括学生管理,教师管理,学生选题,教师选题,主 任审核,管理员审核,开题报告,中期检查,论文提交, 文件管理等等非常不错。

二、项目运行

环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui等。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
			replyStudent = replyStudent.substring(replyStudent.indexOf(",") + 1,replyStudent.length()-1);
}
return "OK";

}else{
return "FAIL";
}
}
/**
* 删除答辩组(专业负责人)
*/
@RequestMapping(value = "/teacher/leading/replydelete.action")
@ResponseBody
public String replydelete(String replyId) {
int rows = replyGroupService.deleteReply(replyId);
if(rows > 0){
return "OK";
}else{
return "FAIL";
}
}

/**
* 向个人信息修改页面跳转(专业负责人)
*/
@RequestMapping(value = "/teacher/leading/topersonInfo.action")
public String TopersonInfo(HttpSession session) {
Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
teacher = teacherService.findTeacher(teacher.gettId(), teacher.gettPwd());
session.setAttribute("USER_INFO", teacher);
return "views/user/teacher/leading/personInfo";
}

/**
* 向密码修改页面跳转(专业负责人)
*/
@RequestMapping(value = "/teacher/leading/toeditPwd.action")
public String ToeditPwd(HttpSession session) {
Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
teacher = teacherService.findTeacherById(teacher.gettId());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

@Controller
public class UserController {

@Autowired
private StudentService studentService;
@Autowired
private TeacherService teacherService;
@Autowired
private AdminService adminService;
/**
* 用户登录
*/
@RequestMapping(value = "/login.action", method = RequestMethod.POST)
public String login(String usercode, String password, String role, Model model, HttpSession session) {
if(role.equals("学生")) {

Student student = studentService.findStudent(usercode, password);
if(student!=null) {
User user = new User();
user.setRole(role);
session.setAttribute("USER", user);
session.setAttribute("USER_INFO", student);
return "redirect:student/toindex.action";
}
}
else if(role.equals("教师")) {

Teacher teacher = teacherService.findTeacher(usercode, password);
if(teacher!=null) {
User user = new User();
user.setRole(role);
session.setAttribute("USER", user);
session.setAttribute("USER_INFO", teacher);
return "redirect:teacher/roleset.action";
}
}
else if(role.equals("管理员")) {
Admin admin = adminService.findAdmin(usercode, password);
if(admin!=null) {
User user = new User();
user.setRole(role);
session.setAttribute("USER", user);
session.setAttribute("USER_INFO", admin);
return "redirect:admin/toindex.action";
}
}

model.addAttribute("msg", "账号或密码错误,请重新输入!");
return "login";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
	return mv;
}

/**
* 向待审核课题页面跳转
*/
@RequestMapping(value = "/teacher/leading/totitlelist1.action")
public ModelAndView titlelist1(HttpSession session, @ModelAttribute("title") Title title,
@RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
// pageNo 页码 pageSize 每页记录数
PageHelper.startPage(pageNum, 10);
Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
title.setMajor(teacher.getMajor());
title.setTitlState("待审批");
List<Title1>list = titleService.findTitleListBytitlState1(title);
PageInfo<Title1> pageInfo = new PageInfo<>(list,10);
ModelAndView mv = new ModelAndView();
mv.addObject("title", title);
mv.addObject("pageInfo", pageInfo);
mv.setViewName("views/user/teacher/leading/titlelist1");
return mv;
}

/**
* 专业负责人审核课题
*/
@RequestMapping(value = "/teacher/leading/checkTitle.action")
@ResponseBody
public String checkTitle(Title title) {
SelectTitle selectTitle = new SelectTitle();
selectTitle = selectTitleService.findBytitlId(title.getTitlId());
if(selectTitle!=null) {
if(title.getTitlState().equals("审批不通过") && selectTitle.getSeltitlState().equals("待专业负责人审批")) {
selectTitle.setSeltitlState("拒绝");
selectTitleService.updateSelTitle(selectTitle);
}
if(title.getTitlState().equals("已审批") && selectTitle.getSeltitlState().equals("待专业负责人审批")) {
selectTitle.setSeltitlState("同意");
selectTitleService.updateSelTitle(selectTitle);
}
}
int rows = titleService.updateTitleById(title);
if(rows > 0){
return "OK";
}else{
return "FAIL";
}
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
	    // 重定向到登录页面的跳转方法
return "redirect:tologin.action";
}

/**
* 向用户登陆页面跳转
*/
@RequestMapping(value = "/tologin.action", method = RequestMethod.GET)
public String toLogin() {
return "login";
}


}
package com.ysj.common.utils;




/**
*  * 效果最好的一种方法,但是需要 window 环境,而且速度是最慢的需要安装 msofficeWord 以及 SaveAsPDFandXPS.exe
* (  * word 的一个插件,用来把 word 转化为 pdf,可以不用安装,本次未安装测试通过 )  *  *  *  
*/
public class WordToPdf {

private static final int wdFormatPDF = 17; // PDF 格式

public void wordToPDF(String sfileName, String toFileName) {

System.out.println("启动 Word...");

long start = System.currentTimeMillis();
ActiveXComponent app = null;
Dispatch doc = null;
try {
app = new ActiveXComponent("Word.Application");
app.setProperty("Visible", new Variant(false));
Dispatch docs = app.getProperty("Documents").toDispatch();
doc = Dispatch.call(docs, "Open", sfileName).toDispatch();
System.out.println("打开文档..." + sfileName);
System.out.println("转换文档到 PDF..." + toFileName);
File tofile = new File(toFileName);
if (tofile.exists()) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
							projBook.setfId(myFileService.selectByfName(originalFilename).getfId());
projBook.setsId(student.getsId());
projBook.setAgree("待通过");
projBookService.createProjBook(projBook);
}else if(fType.equals("开题报告")) {
OpenReport openReport = new OpenReport();
openReport.setfId(myFileService.selectByfName(originalFilename).getfId());
openReport.setsId(student.getsId());
openReport.setAgree("待通过");
openReportService.createOpenReport(openReport);
}else if(fType.equals("中期检查")) {
MidCheck midCheck = new MidCheck();
midCheck.setfId(myFileService.selectByfName(originalFilename).getfId());
midCheck.setsId(student.getsId());
midCheck.setAgree("待通过");
midCheckService.createMidCheck(midCheck);
}else if(fType.equals("论文")) {
SelectTitle selectTitle = selectTitleService.findSelTitleListBysIdAndState(student.getsId(),"同意").get(0);
Thesis thesis = new Thesis();
thesis.setfId(myFileService.selectByfName(originalFilename).getfId());
thesis.setsId(student.getsId());
thesis.setAgree("待通过");
thesis.setTitlId(selectTitle.getTitlId());
thesisService.createThesis(thesis);
}else if(fType.equals("附件")) {
ThesisAttachment thesisAttachment = new ThesisAttachment();
thesisAttachment.setfId(myFileService.selectByfName(originalFilename).getfId());
thesisAttachment.setsId(student.getsId());
thesisAttachmentService.createThesisAttachment(thesisAttachment);
}

} catch (Exception e) {
e.printStackTrace();
mv.setViewName("views/error");
return mv;
}
}
// 跳转到成功页面
mv.setViewName("views/success");
return mv;
}else{
mv.setViewName("views/error");
return mv;
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
			System.out.println("文件保存地址" + newFilename +"\n");
File filePath2 = new File(newFilename);
int i = 0;
String s3 = null;
while(filePath2.exists()) {
i++;
s3 = s2+ "(" + String.valueOf(i) +")";
originalFilename = s3 + s1;
System.out.println("文件已存在,重新命名为: "+originalFilename); //文件名
newFilename = dirPath + "\\" + originalFilename;
System.out.println("新文件地址是: " +newFilename);
filePath2 = new File(newFilename);
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
String nowtime = df.format(new Date());
System.out.println(nowtime);// new Date()为获取当前系统时间
try {
// 使用MultipartFile接口的方法完成文件上传到指定位置
file.transferTo(new File(newFilename));
// String newFilenamePdf = s3 + ".pdf";
// System.out.println("生成的pdf文件名是: "+ newFilenamePdf);
// newFilenamePdf = dirPath + "\\" + newFilenamePdf;
// System.out.println("生成的pdf文件的保存地址是: "+newFilenamePdf);
// WordToPdf w = new WordToPdf();
// w.wordToPDF(newFilename, newFilenamePdf);
Myfile myfile = new Myfile();
myfile.setfName(originalFilename);
myfile.setfPath(newFilename);
Date date = df.parse(nowtime);
myfile.setUploadDatetime(date);
myfile.setfType(fType);
myFileService.createMyfile(myfile);
if(fType.equals("任务书")) {
ProjBook projBook = new ProjBook();
projBook.setfId(myFileService.selectByfName(originalFilename).getfId());
projBook.setsId(student.getsId());
projBook.setAgree("待通过");
projBookService.createProjBook(projBook);
}else if(fType.equals("开题报告")) {
OpenReport openReport = new OpenReport();
openReport.setfId(myFileService.selectByfName(originalFilename).getfId());
openReport.setsId(student.getsId());


项目链接:
https://javayms.github.io?id=031422322105200jm
https://javayms.pages.dev?id=031422322105200jm