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

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

基于javaweb+mysql的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等。

}else{
	        return "FAIL";
	    }
	}
	
	/**
	 * 向个人信息修改页面跳转(教师)
	 */
	@RequestMapping(value = "/teacher/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/personInfo";
	}
	
	/**
	 * 教师信息修改
	 */
	@RequestMapping(value = "/teacher/editInfo.action")
	@ResponseBody
	public String editInfo(Teacher teacher) {
		int rows =0;
		try{
			rows = teacherService.editInfo(teacher);
			}catch(Exception e){
				rows =0;
			}
		if(rows > 0){
	    	System.out.println("OK");
	        return "OK";
	    }else{
	    	System.out.println("FAIL");
	        return "FAIL";
	    }
	}
	
	
	/**
	 * 向密码修改页面跳转(教师)
	 */
	@RequestMapping(value = "/teacher/toeditPwd.action")
	public String toeditPwd(HttpSession session) {
		Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
		teacher = teacherService.findTeacherById(teacher.gettId());
		session.setAttribute("USER_INFO", teacher);
		return "views/user/teacher/editPwd";
	}
	
	/**
	 * 教师密码修改
	 */
/**
	 * 获取答辩学生评语详情
	 */
	@RequestMapping(value = "/teacher/getReviewBySId.action")
	@ResponseBody
	public List<Review1> getReviewBySId(String sId){
		List<Review1> list = null;
	  try{
		  list = reviewService.findBySId(sId);
	  }catch(Exception e){
	     
	  }
	  return list;
	}
	
	/**
	 * 保存学生答辩成绩
	 */
	@RequestMapping(value = "/teacher/saveScore.action")
	@ResponseBody
	public String saveScore(String sId,Long titlId){
		int rows = 0;
		List<Review1> list = null;
		int flag = 0;
		try {
			list = reviewService.findBySId(sId);
		} catch(Exception e) {
			
		}
		for(int i = 0;i<list.size();i++) {
			if(list.get(i).getReviewScore()==0) {
				flag = 1;
			}
		}
		if(flag == 1) {
			return "FAIL1";
		}
		int score1 = 0;
		int score2 = 0;
		int count = 0;
		for(int i = 0;i<list.size();i++) {
			if(i == 0) {
// 火狐等其它浏览器统一为ISO-8859-1编码显示
		return new String(filename.getBytes("UTF-8"), "ISO-8859-1");
	}

	/**
	 * 预览文档(pdf)
	 */
	@RequestMapping("/file/toPdfProjBook.action")
	public ModelAndView toPdfProjBook(Long num1, String num2) {
		Myfile file = fileService.toPdfProjBook(num1);
		Teacher teacher = teacherService.findTeacherById(num2);
		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;
	}

	/**
	 * 文件下载
	 */
	@RequestMapping("/file/filedown.action")
	public ResponseEntity<byte[]> downfile(HttpSession session, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String fId = request.getParameter("fId");
		ProjBook projBook = null;
		Myfile myfile = new Myfile();
		long l = Long.parseLong(fId);
		myfile = fileService.selectById(l);
		String filename = myfile.getfName();
		projBook = projBookService.findProjBookByfId(l);
		User user =(User) session.getAttribute("USER");
public ModelAndView studentScore (HttpSession session,@RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum){
		Student student = (Student)session.getAttribute("USER_INFO");
		List<SelectTitle> list = selectTitleService.findSelTitleListBysIdAndState(student.getsId(), "同意");
		ScoreProportion scoreProportion = scoreProportionService.getScoreProportion("1");
		ModelAndView mv = new ModelAndView();
		PageInfo<SelectTitle> pageInfo = new PageInfo<>(list,5);
		mv.addObject("pageInfo", pageInfo);
		mv.addObject("scoreProportion", scoreProportion);
		mv.setViewName("views/user/student/studentscore");
		return mv;
	}
	
}
}
	}
	
	/**
	 * 答辩组长获取答辩组学生评分列表
	 */
	@RequestMapping(value = "/teacher/toReplyleader.action")
	public ModelAndView toReplyleader(HttpSession session,@ModelAttribute("review") Review1 review,
                                                   @RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
		PageHelper.startPage(pageNum, 10);
		Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
		String replyLeader = teacher.gettId()+" "+teacher.gettName();
		List <Review1> list2 = reviewService.findReviewByRLer(review,replyLeader);
		int i = 0;
		PageInfo<Review1> pageInfo = new PageInfo<>(list2,10);
		ModelAndView mv = new ModelAndView();
		if(list2.size()!=0) {
			i = 1;
		}
		mv.addObject("i", i);
		mv.addObject("pageInfo", pageInfo);
		mv.setViewName("views/user/teacher/replyLeader");
		return mv;
	}
	
	/**
	 * 获取答辩学生评语详情
	 */
	@RequestMapping(value = "/teacher/getReviewBySId.action")
	@ResponseBody
	public List<Review1> getReviewBySId(String sId){
		List<Review1> list = null;
	  try{
		  list = reviewService.findBySId(sId);
	  }catch(Exception e){
	     
	  }
	  return list;
	}
	
	/**
	 * 保存学生答辩成绩
	 */
	@RequestMapping(value = "/teacher/saveScore.action")
	@ResponseBody
	public String saveScore(String sId,Long titlId){
		int rows = 0;
		List<Review1> list = null;
		int flag = 0;
		try {
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;
				}

	}
	
	/**
	 * 删除文件
	 */
	@RequestMapping("/file/filedelete.action")
	@ResponseBody
	public String filedelete(HttpSession session,HttpServletRequest request ,Long fId) {
		Myfile myfile = fileService.selectById(fId);

		File file = new File(myfile.getfPath());
		if (file.isFile() && file.exists()) {
			//file.delete();
		}
		int rows = fileService.delete(fId);
	    if(rows > 0){			
	        return "OK";
	    }else 
	    	return "FAIL";
	}

}
public ModelAndView openReportlist1(HttpSession session ,@ModelAttribute("openReport") OpenReport openReport ,
                                                            @RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
		PageHelper.startPage(pageNum, PAGE_SIZE);
		Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
		List<OpenReport>list = openReportService.findOpenReportBytIdAndAgree1(openReport, teacher.gettId(),"待通过");
		PageInfo<OpenReport> pageInfo = new PageInfo<>(list,5);
        ModelAndView mv = new ModelAndView();
        mv.addObject("pageInfo", pageInfo);
        mv.setViewName("views/user/teacher/openReportlist1");
		return mv;
	}
	
	/**
	 * 学生中期检查列表(已审核)
	 */
	@RequestMapping("/teacher/midChecklist.action")
	public ModelAndView midChecklist(HttpSession session ,@ModelAttribute("midCheck") MidCheck midCheck ,
                                                            @RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
		PageHelper.startPage(pageNum, PAGE_SIZE);
		Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
		List<MidCheck>list = midCheckService.findMidCheckBytIdAndAgree(midCheck, teacher.gettId(),"待通过");
		PageInfo<MidCheck> pageInfo = new PageInfo<>(list,5);
        ModelAndView mv = new ModelAndView();
        mv.addObject("pageInfo", pageInfo);
        mv.setViewName("views/user/teacher/midChecklist");
		return mv;
	}
	
	/**
	 * 学生中期检查列表(待审核)
	 */
	@RequestMapping("/teacher/midChecklist1.action")
	public ModelAndView midChecklist1(HttpSession session ,@ModelAttribute("midCheck") MidCheck midCheck ,
                                                            @RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
		PageHelper.startPage(pageNum, PAGE_SIZE);
		Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
		List<MidCheck>list = midCheckService.findMidCheckBytIdAndAgree1(midCheck, teacher.gettId(),"待通过");
		PageInfo<MidCheck> pageInfo = new PageInfo<>(list,5);
        ModelAndView mv = new ModelAndView();
        mv.addObject("pageInfo", pageInfo);
        mv.setViewName("views/user/teacher/midChecklist1");
		return mv;
@Controller
public class StudentController {
	
	private static final int PAGE_SIZE = 5;

	@Autowired
	private StudentService studentService;
	
	@Autowired
	private TitleService titleService;
	@Autowired
	private TeacherService teacherService;
	
	@Autowired
	private SelectTitleService selectTitleService;
	
	@Autowired
	private ProjBookService projBookService;
	
	@Autowired
	private OpenReportService openReportService;
	
	@Autowired
	private MidCheckService midCheckService;
	
	@Autowired
	private ThesisService thesisService;
	
	@Autowired
}
	    if(rows > 0){
	    	String replyMember = replyGroup.getReplyMember();
			int l = replyMember.length();
			String s = replyMember.replaceAll(",","");
			int ll = s.length();
			int cc = l - ll + 1;
			String []member = new String[2];
			for(int i = 0;i < cc;i++) {
				member[i] = replyMember.substring(0, replyMember.indexOf(" "));
				System.out.println("评阅教师"+member[i]);
				replyMember = replyMember.substring(replyMember.indexOf(",") + 1,replyMember.length()-1);
			}
			String replyStudent = replyGroup.getReplyStudent();
			int l1 = replyStudent.length();
			String s1 = replyStudent.replaceAll(",","");
			int l2 = s1.length();
			int c = l1 - l2 + 1;
			String []student = new String[4];
			for(int i = 0;i < c;i++) {
				student[i] = replyStudent.substring(0, replyStudent.indexOf(" "));
				List<Thesis> list = thesisService.findThesisBytIdAndAgreeAndBatch(student[i], "通过",replyGroup.getBatch());
				for(int m = 0;m < list.size();m++) {
					Review review = new Review();
					review.setsId(list.get(m).getsId());
					review.setMemberTId(replyGroup.getReplyLeader().substring(0, replyGroup.getReplyLeader().indexOf(" ")));
					review.setReplyId(replyGroup.getReplyId());
					review.setReviewScore(0);
					review.setReviewType("答辩组长评分");
					reviewService.insertReview(review);
				}
				for(int j = 0;j < cc;j++) {
					for(int k = 0;k < list.size();k++) {
						Review review = new Review();
						review.setsId(list.get(k).getsId());
						review.setMemberTId(member[j]);
						review.setReplyId(replyGroup.getReplyId());
						review.setReviewScore(0);
						review.setReviewType("评阅教师评分");
						reviewService.insertReview(review);
					}
				}
				System.out.println("答辩学生"+student[i]+"所带学生");
Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
		List<Title1>list = titleService.findTitleListBytId11((String)teacher.gettId());
		ScoreProportion scoreProportion = scoreProportionService.getScoreProportion("1");
		PageInfo<Title1> pageInfo = new PageInfo<>(list,10);
		ModelAndView mv = new ModelAndView();
		mv.addObject("pageInfo", pageInfo);
		mv.addObject("scoreProportion", scoreProportion);
		mv.setViewName("views/user/teacher/studentscore");
		return mv;
	}
	
	/**
	 * 修改评语和学生成绩(教师视图)
	 */
	@RequestMapping("/teacher/editStudentScore.action")
	@ResponseBody
	public String studentScore (SelectTitle selectTitle){
		System.out.println(selectTitle.getsId());
		System.out.println(selectTitle.getTitlId());
		System.out.println(selectTitle.gettScore());
		int rows = 0;
		try {
			rows = selectTitleService.updateSelTitle(selectTitle);
		} catch(Exception e) {
			
		}
	    if(rows > 0){
	        return "OK";
	    }else{
	        return "FAIL";
	    }
	}
	
	/**
	 * 向个人信息修改页面跳转(教师)
	 */
	@RequestMapping(value = "/teacher/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/personInfo";
	}
	
	/**
	 * 教师信息修改
	 */
	@RequestMapping(value = "/teacher/editInfo.action")
	@ResponseBody
}
		}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;
			}
		}else if(fType.equals("中期检查")) {
			List<MidCheck> list = midCheckService.findMidCheckBysIdAndAgree(student.getsId(), "待通过");
			if(list.size()!=0) {
				mv.addObject("FAIL", "FAIL1");
				mv.setViewName("views/error");
				return mv;
			}
		}else if(fType.equals("论文")) {
			List<Thesis> list = thesisService.findThesisBysIdAndAgree(student.getsId(), "待通过");
			if(list.size()!=0) {
				mv.addObject("FAIL", "FAIL1");
				mv.setViewName("views/error");
				return mv;
			}
		}else if(fType.equals("附件")) {

			List<ThesisAttachment> list = thesisAttachmentService.findThesisAttachmentBysId(student.getsId());
			if(list.size()!=0) {
				mv.addObject("FAIL", "FAIL1");
				mv.setViewName("views/error");
				return mv;
			}
		}
		student = studentService.findStudent(student.getsId(), student.getsPwd());
		Title title = titleService.findTitleBysId(student.getsId());
		String tId = title.gettId();
	//	String tName = title.gettName();
		String t = tId;
		String s = student.getsId() + student.getsName();
		s = s + fType;

		// 判断所上传文件是否存在
				if (!uploadfile.isEmpty() && uploadfile.size() > 0) {
					//循环输出上传的文件
					for (MultipartFile file : uploadfile) {
						String name1 = t;
						// 获取上传文件的原始名称
						String originalFilename = file.getOriginalFilename();
						System.out.println("上传文件原始文件名是: "+ originalFilename);
						int c = originalFilename.indexOf(".");
						String s1 = originalFilename.substring(c);
						String s2 = originalFilename.substring(0, c);
*/
	@RequestMapping(value = "/admin/toindex.action", method = RequestMethod.GET)
	public String toIndex() {
	    return "views/user/admin/index";
	}
	
	/**
	 * 向教师列表跳转
	 */
	@RequestMapping(value = "/admin/toteacherlist.action")
	public ModelAndView teacherlist(@ModelAttribute("teacher") Teacher teacher,
                                    @RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
		List<Teacher> list = teacherService.Teacherlist(teacher);
		List<BaseDept> list1 = baseDeptService.deptlist();
		PageInfo<Teacher> pageInfo = new PageInfo<>(list,10);
		ModelAndView mv = new ModelAndView();
		mv.addObject("pageInfo", pageInfo);
		mv.addObject("BaseDept", list1);
		mv.setViewName("views/user/admin/teacherlist");
		return mv;
	}
	
	/**
	 * 系部下拉框选中值改变时获取对应专业
	 */
	@RequestMapping(value="/admin/changeDept.action")
	@ResponseBody
	public List<BaseMajor> changeDept(String deptId){
		List<BaseMajor> list = null;
	  try{
		  list = baseMajorService.findMajorBydeptId(deptId);
	  }catch(Exception e){
	     
	  }
	  return list;
	}
	
	/**
	 * 系部下拉框选中值改变时获取对应专业
	 */
	@RequestMapping(value="/admin/changeDept1.action")
	@ResponseBody
	public List<BaseMajor> changeDept1(String dept){
		List<BaseMajor> list = null;
		BaseDept baseDept = baseDeptService.findDeptByName(dept);
	  try{
		  list = baseMajorService.findMajorBydeptId(baseDept.getDeptId());
	  }catch(Exception e){
	     
	  }
	  return list;
	}
PageInfo<Student> pageInfo = new PageInfo<>(list,10);
	    ModelAndView mv = new ModelAndView();
	    mv.addObject("pageInfo", pageInfo);
	    mv.addObject("BaseDept", list1);
	    mv.setViewName("views/user/admin/studentlist");
	    return mv;
	}
	
	/**
	 * 通过sId获取学生信息
	 */
	@RequestMapping("/admin/getStudentBysId.action")
	@ResponseBody
	public Student getStudentBysId(String sId) {
		Student student = studentService.findStudentById(sId);
		   return student;
		}
	 
	/**
	* 修改学生信息
	*/
	@RequestMapping("/admin/updateStudent.action")
	@ResponseBody
	public String updateStudent(Student student) {
		BaseMajor baseMajor = baseMajorService.findMajorById(student.getMajorId());
		student.setMajor(baseMajor.getMajorName());
		int rows = studentService.editInfo(student);
		    if(rows > 0){
		        return "OK";
		    }else{
		        return "FAIL";
		    }
	}
	
	/**
	 * 删除学生
	 */
	@RequestMapping("/admin/deleteStudent.action")
	@ResponseBody
	public String deleteStudent(String sId, int s) {
		int rows = 0;
		try {
			Student student = new Student();
			student.setsId(sId);
			student.setsState(s);
			rows = studentService.editInfo(student);
		} catch(Exception e) {
			
		}
		
		if(rows > 0){
student = studentService.findStudent(student.getsId(), student.getsPwd());
		Title title = titleService.findTitleBysId(student.getsId());
		String tId = title.gettId();
	//	String tName = title.gettName();
		String t = tId;
		String s = student.getsId() + student.getsName();
		s = s + fType;

		// 判断所上传文件是否存在
				if (!uploadfile.isEmpty() && uploadfile.size() > 0) {
					//循环输出上传的文件
					for (MultipartFile file : uploadfile) {
						String name1 = t;
						// 获取上传文件的原始名称
						String originalFilename = file.getOriginalFilename();
						System.out.println("上传文件原始文件名是: "+ originalFilename);
						int c = originalFilename.indexOf(".");
						String s1 = originalFilename.substring(c);
						String s2 = originalFilename.substring(0, c);
						s2 = s;
						originalFilename = s2 + s1;
						//获取上传文件后缀名
						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;
							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);
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());
								openReport.setAgree("待通过");
								openReportService.createOpenReport(openReport);
							}else if(fType.equals("中期检查")) {
}
		int score1 = 0;
		int score2 = 0;
		int count = 0;
		for(int i = 0;i<list.size();i++) {
			if(i == 0) {
				score1 = list.get(i).getReviewScore();
			}else {
				score2 += list.get(i).getReviewScore();
				count++;
			}
		}
		ScoreProportion scoreProportion = scoreProportionService.getScoreProportion("1");
		double replyScore = score1 * scoreProportion.getLeaderScoreProportion() + (score2/count)*(scoreProportion.getReviewScoreProportion());
		DecimalFormat df = new DecimalFormat("#.00");
		replyScore = Double.parseDouble(df.format(replyScore));
		try {
			SelectTitle selectTitle = new SelectTitle();
			selectTitle.setsId(sId);
			selectTitle.setTitlId(titlId);
			selectTitle.setReplyScore(replyScore);
			rows = selectTitleService.updateReplyScore(selectTitle);
		} catch(Exception e) {
			
		}
	    if(rows > 0){
	        return "OK";
	    }else{
	        return "FAIL";
	    }
	}
}
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;
				}

	}
	
	/**
	 * 删除文件
	 */
	@RequestMapping("/file/filedelete.action")
	@ResponseBody
	public String filedelete(HttpSession session,HttpServletRequest request ,Long fId) {
		Myfile myfile = fileService.selectById(fId);

		File file = new File(myfile.getfPath());
		if (file.isFile() && file.exists()) {
			//file.delete();
		}
		int rows = fileService.delete(fId);
	    if(rows > 0){			
	        return "OK";
	    }else 
	    	return "FAIL";
	}

}

java PrintService 网络打印_List


java PrintService 网络打印_课程设计_02


java PrintService 网络打印_mysql_03


java PrintService 网络打印_课程设计_04


java PrintService 网络打印_mysql_05


java PrintService 网络打印_mysql_06