毕业设计管理系统
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
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
} catch (Exception e){
}
if(rows > 0){
return "OK";
}else{
return "FAIL";
}
}
/**
* 向学生列表跳转
*/
@RequestMapping(value = "/admin/tostudentlist.action")
public ModelAndView studentlist(@ModelAttribute("student") Student student,
@RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
List<Student> list = studentService.Studentlist(student);
List<BaseDept> list1 = baseDeptService.deptlist();
String fPath = file.getfPath();
String fPath2 = StringUtils.substringBeforeLast(fPath, ".");
fPath2 = fPath2 + ".pdf";
System.out.println("检查是否存在此pdf文件" + fPath2);
File file2 = new File(fPath2);
if(!file2.exists()) {
WordToPdf w = new WordToPdf();
w.wordToPDF(fPath, fPath2);
}
String f = file.getfName();
f = f.substring(0, f.indexOf("."));
f = f + ".pdf";
String t = teacher.gettId();
ModelAndView mv = new ModelAndView();
mv.addObject("f", f);
mv.addObject("t", t);
System.out.println(f+t);
mv.setViewName("views/pdf");
return mv;
}
/**
private MyFileService fileService;
@Autowired
private SelectTitleService selectTitleService;
@Autowired
private TeacherService teacherService;
@Autowired
private ProjBookService projBookService;
@Autowired
private OpenReportService openReportService;
@Autowired
private MidCheckService midCheckService;
if(rows > 0){
teacherService.editInfo1(baseDept);
studentService.editInfo1(baseDept,oldName);
return "OK";
}else{
return "FAIL";
}
}
/**
* 向专业列表跳转
*/
@RequestMapping(value = "/admin/tomajorlist.action")
public ModelAndView majorlist(String deptId,@RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
List<BaseMajor> list1 = baseMajorService.findMajorBydeptId1(deptId);
PageInfo<BaseMajor> pageInfo = new PageInfo<>(list1,10);
ModelAndView mv = new ModelAndView();
}catch(Exception e){
}
if(rows > 0){
return "OK";
}else{
return "FAIL";
}
}
}
用户管理控制层:
@Controller
public class UserController {
@Autowired
private StudentService studentService;
@Autowired
private TeacherService teacherService;
@Autowired
private AdminService adminService;
/**
* 用户登录
*/
@RequestMapping(value = "/login.action", method = RequestMethod.POST)
return "FAIL";
}
}
/**
* 向专业列表跳转
*/
@RequestMapping(value = "/admin/tomajorlist.action")
public ModelAndView majorlist(String deptId,@RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
List<BaseMajor> list1 = baseMajorService.findMajorBydeptId1(deptId);
PageInfo<BaseMajor> pageInfo = new PageInfo<>(list1,10);
ModelAndView mv = new ModelAndView();
mv.addObject("pageInfo", pageInfo);
mv.addObject("deptId", deptId);
mv.setViewName("views/user/admin/majorlist");
return mv;
}
String dirPath =
request.getServletContext().getRealPath("/upload/"+name1);
System.out.println(dirPath);
File filePath = new File(dirPath);
// 如果保存文件的地址不存在,就先创建目录
if (!filePath.exists()) {
filePath.mkdirs();
}
String newFilename = dirPath + "\\" + originalFilename;
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;
@RequestMapping("/file/fileUpload.action")
public ModelAndView fileUpload(HttpSession session,HttpServletResponse response,
@RequestParam("fType") String fType,
@RequestParam("uploadfile") List<MultipartFile> uploadfile, HttpServletRequest request) throws IOException {
Student student = (Student)session.getAttribute("USER_INFO");
ModelAndView mv = new ModelAndView();
mv.addObject("fType", fType);
if(fType.equals("任务书")) {
List<ProjBook> list = projBookService.findProjBookBysIdAndAgree(student.getsId(), "待通过");
if(list.size()!=0) {
mv.addObject("FAIL", "FAIL1");
mv.setViewName("views/error");
return mv;
}
}else if(fType.equals("开题报告")) {
List<OpenReport> list = openReportService.findOpenReportBysIdAndAgree(student.getsId(), "待通过");
if(list.size()!=0) {
mv.addObject("FAIL", "FAIL1");
mv.setViewName("views/error");
return mv;
}
/**
* 删除/恢复专业
*/
@RequestMapping("/admin/deleteMajor.action")
@ResponseBody
public String deleteMajor(String majorId,int s) {
int rows = 0;
try {
rows = baseMajorService.editMajor1(majorId,s);
} catch(Exception e) {
}
if(rows > 0){
return "OK";
}else{
return "FAIL";
}
}
/**
* 向管理员修改密码界面跳转
*/
@RequestMapping("/admin/toeditPwd.action")
public String toeditPwd(HttpSession session) {
Admin admin = (Admin)session.getAttribute("USER_INFO");
@RequestMapping("/admin/toeditPwd.action")
public String toeditPwd(HttpSession session) {
Admin admin = (Admin)session.getAttribute("USER_INFO");
admin = adminService.getAdmin(admin.getAdminId());
session.setAttribute("USER_INFO", admin);
return "views/user/admin/editPwd";
}
/**
* 管理员密码修改
*/
@RequestMapping(value = "/admin/editPwd.action")
@ResponseBody
public String editPwd(Admin admin) {
int rows =0;
try{
rows = adminService.editInfo(admin);
}catch(Exception e){
}
if(rows > 0){
return "OK";
List<BaseMajor> list1 = baseMajorService.findMajorBydeptId1(deptId);
PageInfo<BaseMajor> pageInfo = new PageInfo<>(list1,10);
ModelAndView mv = new ModelAndView();
mv.addObject("pageInfo", pageInfo);
mv.addObject("deptId", deptId);
mv.setViewName("views/user/admin/majorlist");
return mv;
}
/**
* 通过majorId获取专业详情
*/
@RequestMapping("/admin/getMajorById.action")
@ResponseBody
public BaseMajor getMajorById(String majorId) {
BaseMajor baseMajor = baseMajorService.findMajorById(majorId);
return baseMajor;
}
/**
* 新建专业
*/
@RequestMapping(value = "/admin/createMajor.action")