package com.ysj.core.web.controller;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ysj.core.po.BaseDept;
import com.ysj.core.po.BaseMajor;
import com.ysj.core.po.MidCheck;
import com.ysj.core.po.OpenReport;
import com.ysj.core.po.ProjBook;
import com.ysj.core.po.ReplyGroup;
import com.ysj.core.po.Review;
import com.ysj.core.po.Review1;
import com.ysj.core.po.ScoreProportion;
import com.ysj.core.po.SelectTitle;
import com.ysj.core.po.Student;
import com.ysj.core.po.Teacher;
import com.ysj.core.po.Thesis;
import com.ysj.core.po.ThesisAttachment;
import com.ysj.core.po.Title;
import com.ysj.core.po.Title1;
import com.ysj.core.service.BaseMajorService;
import com.ysj.core.service.MidCheckService;
import com.ysj.core.service.OpenReportService;
import com.ysj.core.service.ProjBookService;
import com.ysj.core.service.ReplyGroupService;
import com.ysj.core.service.ReviewService;
import com.ysj.core.service.ScoreProportionService;
import com.ysj.core.service.SelectTitleService;
import com.ysj.core.service.StudentService;
import com.ysj.core.service.TeacherService;
import com.ysj.core.service.ThesisAttachmentService;
import com.ysj.core.service.ThesisService;
import com.ysj.core.service.TitleService;
@Controller
public class TeacherController {
private static final int PAGE_SIZE = 5;
@Autowired
private TeacherService teacherService;
@Autowired
private BaseMajorService baseMajorService;
@Autowired
private TitleService titleService;
@Autowired
private StudentService studentService;
@Autowired
private SelectTitleService selectTitleService;
@Autowired
private ProjBookService projBookService;
@Autowired
private OpenReportService openReportService;
@Autowired
private MidCheckService midCheckService;
@Autowired
private ThesisService thesisService;
@Autowired
private ThesisAttachmentService thesisAttachmentService;
@Autowired
private ReplyGroupService replyGroupService;
@Autowired
private ReviewService reviewService;
@Autowired
private ScoreProportionService scoreProportionService;
@InitBinder
protected void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
/**
* 向教师权限选择页面跳转
*/
@RequestMapping(value = "/teacher/roleset.action", method = RequestMethod.GET)
public String roleset(HttpSession session) {
return "views/user/teacher/roleset";
}
/**
* 向教师主页面跳转
*/
@RequestMapping(value = "/teacher/toindex.action", method = RequestMethod.GET)
public ModelAndView toIndex(HttpSession session) {
Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
int sum = titleService.findTitleSum1(teacher.gettId(),"已审批");
int s = selectTitleService.findSelTitleListByState2(teacher.gettId(),"同意");
int s1 = selectTitleService.findSelTitleListByState2(teacher.gettId(),"待同意");
int sumProjBook = 0;
int sumOpenReport = 0;
int sumMidCheck = 0;
int sumThesis = 0;
List<ProjBook> list = projBookService.findProjBookBytIdAndAgree1(null, teacher.gettId(), "通过");
if(list!=null) {
sumProjBook = list.size();
}
List<OpenReport> list1 = openReportService.findOpenReportBytIdAndAgree1(null, teacher.gettId(), "通过");
if(list1!=null) {
sumOpenReport = list1.size();
}
List<MidCheck> list2 = midCheckService.findMidCheckBytIdAndAgree1(null, teacher.gettId(), "通过");
if(list2!=null) {
sumMidCheck = list2.size();
}
List<Thesis> list3 = thesisService.findThesisBytIdAndAgree1(null, teacher.gettId(), "通过");
if(list3!=null) {
sumThesis = list3.size();
}
ModelAndView mv = new ModelAndView();
mv.addObject("sum", sum);
mv.addObject("s", s);
mv.addObject("s1", s1);
mv.addObject("sumProjBook", sumProjBook);
mv.addObject("sumOpenReport", sumOpenReport);
mv.addObject("sumMidCheck", sumMidCheck);
mv.addObject("sumThesis", sumThesis);
mv.setViewName("views/user/teacher/index");
return mv;
}
/**
* 向教师课题页面跳转
*/
@RequestMapping(value = "/teacher/totitlelist.action")
public ModelAndView totitlelist(HttpSession session, @ModelAttribute("title") Title title,
@RequestParam(value="pageNum",required=false,defaultValue="1") int pageNum) {
// pageNo 页码 pageSize 每页记录数
PageHelper.startPage(pageNum, PAGE_SIZE);
Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
List<Title1>list = titleService.findTitleListBytId(title ,(String)teacher.gettId());
List <BaseMajor> list1 = baseMajorService.findMajorBydeptId(teacher.getDeptId());
PageInfo<Title1> pageInfo = new PageInfo<>(list,5);
ModelAndView mv = new ModelAndView();
mv.addObject("title", title);
mv.addObject("BaseMajor", list1);
mv.addObject("pageInfo", pageInfo);
mv.setViewName("views/user/teacher/titlelist");
return mv;
}
/**
* 获取选题学生信息
*/
@RequestMapping(value = "/teacher/getStudentInfoById.action")
@ResponseBody
public Student getStudentInfoById(String sId) {
Student student = studentService.findStudentById(sId);
return student;
}
/**
* 删除课题(教师)
*/
@RequestMapping(value = "/teacher/titledelete.action")
@ResponseBody
public String titledelete(Long titlId) {
int rows = titleService.deleteTitle(titlId);
if(rows > 0){
return "OK";
}else{
return "FAIL";
}
}
/**
* 教师申请新课题
*/
@RequestMapping("/teacher/createTitle.action")
@ResponseBody
public String createTitle(Title title,HttpSession session) {
Teacher teacher = (Teacher)session.getAttribute("USER_INFO");
title.settId(teacher.gettId());
title.setTitlState("待审批");
title.setSelState("未被选择");
int rows = titleService.createTitle(title);
if(rows > 0){
return "OK";
}else{
return "FAIL";
}
}
/**
* 学生申请新课题
*/
@RequestMapping("/teacher/createTitle1.action")
@ResponseBody
public String createTitle1(Title title) {
String sId = title.getsId();
title.setTitlState("待指导教师审批");
title.setSelState("已被选择");
title.setsId(null);
int rows = titleService.createTitle(title);
System.out.println(title.getTitlId());
if(rows > 0){
SelectTitle selectTitle = new SelectTitle();
selectTitle.setsId(sId);
selectTitle.setTitlId(title.getTitlId());
selectTitle.setSeltitlState("待同意");
selectTitleService.createSelectTitle(selectTitle);
return "OK";
}else{
return "FAIL";
}
}
/**
* 向选题学生页面跳转
*/
@RequestMapping(value = "/teacher/toSelecttitlelist.action")
public ModelAndView toSelecttitlelist(HttpSession session, @ModelAttribu
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
一、项目简述 功能包括: 该系统不错分为学生,教师,管理员,教导主任四种角 色,包括学生管理,教师管理,学生选题,教师选题,主 任审核,管理员审核,开题报告,中期检查,论文提交, 文件管理等等非常不错。 二、项目运行 环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持) 项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
资源推荐
资源详情
资源评论
收起资源包目录
Java项目:毕业设计管理系统(java+SSM+jsp+mysql+maven) (661个子文件)
TeacherController.class 35KB
TeacherExample$GeneratedCriteria.class 28KB
StudentExample$GeneratedCriteria.class 25KB
ReplyGroupExample$GeneratedCriteria.class 18KB
TeacherExample$Criteria.class 18KB
FileController.class 16KB
SelectTitleExample$GeneratedCriteria.class 15KB
StudentExample$Criteria.class 15KB
StudentController.class 15KB
AdminController.class 15KB
TitleExample$GeneratedCriteria.class 14KB
CommentsExample$GeneratedCriteria.class 13KB
ReviewExample$GeneratedCriteria.class 12KB
MyfileExample$GeneratedCriteria.class 12KB
ThesisExample$GeneratedCriteria.class 11KB
ScoreProportionExample$GeneratedCriteria.class 11KB
ReplyGroupExample$Criteria.class 10KB
BaseMajorExample$GeneratedCriteria.class 10KB
OpenReportExample$GeneratedCriteria.class 9KB
ProjBookExample$GeneratedCriteria.class 9KB
SelectTitleExample$Criteria.class 9KB
BaseDeptExample$GeneratedCriteria.class 8KB
TitleExample$Criteria.class 8KB
ThesisAttachmentExample$GeneratedCriteria.class 8KB
MidCheckExample$GeneratedCriteria.class 8KB
CommentsExample$Criteria.class 8KB
ReviewExample$Criteria.class 7KB
MyfileExample$Criteria.class 7KB
ThesisExample$Criteria.class 6KB
AdminExample$GeneratedCriteria.class 6KB
ScoreProportionExample$Criteria.class 6KB
BaseMajorExample$Criteria.class 6KB
TitleServiceImpl.class 6KB
SelectTitleServiceImpl.class 5KB
OpenReportExample$Criteria.class 5KB
ProjBookExample$Criteria.class 5KB
BaseDeptExample$Criteria.class 4KB
Review1.class 4KB
TeacherServiceImpl.class 4KB
StudentServiceImpl.class 4KB
ThesisAttachmentExample$Criteria.class 4KB
MidCheckExample$Criteria.class 4KB
Title1.class 4KB
Thesis.class 4KB
ThesisServiceImpl.class 4KB
Teacher.class 4KB
CommentsController.class 4KB
OpenReport.class 4KB
ProjBook.class 4KB
OpenReportServiceImpl.class 4KB
MidCheck.class 4KB
ProjBookServiceImpl.class 3KB
MidCheckServiceImpl.class 3KB
Title.class 3KB
ThesisAttachment.class 3KB
AdminExample$Criteria.class 3KB
Student.class 3KB
UserController.class 3KB
BaseDeptServiceImpl.class 3KB
WordToPdf.class 3KB
TitleMapper.class 3KB
MyFileServiceImpl.class 3KB
ThesisAttachmentServiceImpl.class 3KB
BaseMajorServiceImpl.class 3KB
SelectTitle.class 3KB
SelectTitleMapper.class 2KB
ThesisMapper.class 2KB
LoginInterceptor.class 2KB
ReplyGroup.class 2KB
ReviewServiceImpl.class 2KB
ThesisAttachmentExample$Criterion.class 2KB
ScoreProportionExample$Criterion.class 2KB
SelectTitleExample$Criterion.class 2KB
ThesisAttachmentExample.class 2KB
ReplyGroupExample$Criterion.class 2KB
OpenReportExample$Criterion.class 2KB
BaseMajorExample$Criterion.class 2KB
BaseDeptExample$Criterion.class 2KB
ProjBookExample$Criterion.class 2KB
CommentsExample$Criterion.class 2KB
MidCheckExample$Criterion.class 2KB
ScoreProportionExample.class 2KB
StudentExample$Criterion.class 2KB
TeacherExample$Criterion.class 2KB
ThesisExample$Criterion.class 2KB
ReviewExample$Criterion.class 2KB
MyfileExample$Criterion.class 2KB
OpenReportMapper.class 2KB
TitleExample$Criterion.class 2KB
AdminExample$Criterion.class 2KB
SelectTitleExample.class 2KB
MidCheckMapper.class 2KB
ProjBookMapper.class 2KB
ReplyGroupExample.class 2KB
OpenReportExample.class 2KB
BaseMajorExample.class 2KB
CommentsExample.class 2KB
MidCheckExample.class 2KB
BaseDeptExample.class 2KB
ProjBookExample.class 2KB
共 661 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- qq_225874272022-06-29用户下载后在一定时间内未进行评价,系统默认好评。
- lijian9962022-10-18资源很不错,内容和描述一致,值得借鉴,赶紧学起来!
beyondwild
- 粉丝: 9872
- 资源: 4912
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Java开发的动画效果丰富的NewTvWidget-UI设计源码
- 基于C++语言开发的ssar(SRE SAR)工具家族全新设计源码
- 基于Python实现的wanggejiaoyi网格交易策略设计源码
- 基于PaddlePaddle的Python声纹识别设计源码
- 基于Python、HTML、JavaScript、CSS的Bangwodai设计源码架构
- 基于Python技术的体育网站爬虫设计源码
- 基于JDK17+SpringBoot3.2.7+SpringSecurity3.2.7的JWT多策略认证与Redis黑名单管理设计源码
- 基于SpringBoot和Layui框架的Java投票系统设计源码
- 基于Java和Lua的多语言数学库设计源码
- 基于Flink框架的Vue农业信息推荐系统设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功