共有三个角色:管理员、教师、学生。
管理员功能有:学生管理、教师管理、评教管理、指标管理、课程管理等。
教师功能有:学生管理、指标管理、课程管理。
学生功能有:评教管理。
jdk1.8、mysql5.x、maven3.5\3.6、idea
@authority(roles = {role.teacher})@controller@requestmapping("/teacher")public class teachercontroller {@autowiredteacherrvice teacherrvice;@autowiredsubjectrvice subjectrvice;@requestmapping(value = {"", "/loginpage"})public string loginpage() {return "teacher/login";}@getmapping("/index")public string homepage() {return "teacher/public-teacher-index";}@getmapping("/updatepwd")public string updatepwd() {return "teacher/teacherinfo/updatepwd";}@getmapping("/teacherinfo")public string teacherinfo() {return "teacher/teacherinfo/teacherinfo";}@getmapping("/modifyinfo")public string modifyinfo() {return "teacher/teacherinfo/updateinfo";}@getmapping("/workapprovalinfo")public string workinfo() {return "teacher/workapproval/winfo";}@getmapping("/workapprovaldata")public string workdata() {return "teacher/workapproval/wdata";}@getmapping("/eworkdata")public string eworkdata() {return "teacher/workapproval/ewdata";}//填写表格页面@getmapping("/term_debriefing")public string termdebriefing() {return "teacher/fillouttable/termdebriefing";}@getmapping("/year_debriefing")public string yeardebriefing() {return "teacher/fillouttable/yeardebriefing";}@getmapping("/annual_asssment")public string annualasssment() {return "teacher/fillouttable/annualasssment";}@getmapping("/work_load")public string workload() {return "teacher/fillouttable/workload";}@getmapping("/technical_personnel")public string technicalpersonnel() {return "teacher/fillouttable/technicalpersonnel";}@getmapping("/term_business")public string termbusiness() {return "teacher/fillouttable/termbusiness";}//查看表格页面@getmapping("/show_year_debriefing")public string showyeardebriefing() {return "teacher/showtable/yeardebriefing";}@getmapping("/show_term_debriefing")public string showtermdebriefing() {return "teacher/showtable/termdebriefing";}@getmapping("/show_annual_asssment")public string showannualasssment() {return "teacher/showtable/annualasssment";}@getmapping("/show_technical_personnel")public string showtechnicalpersonnel() {return "teacher/showtable/technicalpersonnel";}@getmapping("/show_workload")public string showworkload() {return "teacher/showtable/workload";}@getmapping("/exit")public string exit(httprvletrespon respon) {//将cookie 中的token 置空cookie cookie = new cookie("token", null);cookie.tpath("/");respon.addcookie(cookie);return "redirect:/";}//打印页面@getmapping("/print_term_debriefing")public string printyeardebriefing(long year, string term, model model) {model.addattribute("year", year);model.addattribute("term", term);return "teacher/showtable/print/termdebriefing";}@getmapping("/print_year_debriefing")public string printtermdebriefing(long year, model model) {model.addattribute("year", year);return "teacher/showtable/print/yeardebriefing";}@getmapping("/login")@responbodypublic msg login(string name, string pwd, httpssion httpssion, httprvletrespon respon) throws parexception {name = name.trim();int flag = teacherrvice.teacherdl(name, pwd);if (flag == 200) {ur ur = new ur();//-1表示为超管ur.tid(0l);ur.trole("teacher");ur.turname(name);//生成token 存到 cookiecookie cookie = new cookie("token", tokenutil.createtoken(ur));//该cookie无法被js读取cookie.thttponly(true);cookie.tpath("/");respon.addcookie(cookie);teacher teacher = teacherrvice.lectteacher(name);httpssion.tattribute("teacherinfo", teacher);httpssion.tmaxinactiveinterval(3600);}return msg.success().add("info", flag);}//教师信息修改//修改教师密码@postmapping("/teacherupdetpwd")@responbodypublic msg fun6(string oldpwd, string newpwd, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");int flag = teacherrvice.teacherupdetpwd(teacher.geturname(), oldpwd, newpwd);return msg.success().add("flag", flag);}//修改教师信息@postmapping("/teacherupdeteinfo")@responbodypublic msg updateinfo(string name, string gender, httpssion httpssion) {teacherwithblobs teacher = (teacherwithblobs) httpssion.getattribute("teacherinfo");teacher.tname(name);teacher.tgender(gender);teacherrvice.teacherupdateinfo(teacher);return msg.success();}//教师出差模块//查询所有教师出差申请信息@getmapping("/lect_work_all")@responbodypublic msg fun1(httpssion httpssion) {teacherwithblobs teacher = (teacherwithblobs) httpssion.getattribute("teacherinfo");list<workapprovalwithblobs> list = teacherrvice.lectteacherworkall(teacher.getid());return msg.success().add("workinfo", list);}//查询申请成功教师出差申请@getmapping("/lect_work_success")@responbodypublic msg fun2(httpssion httpssion) {teacherwithblobs teacher = (teacherwithblobs) httpssion.getattribute("teacherinfo");list<workapprovalwithblobs> list = teacherrvice.lectworksuccess(teacher.getid());return msg.success().add("workinfo", list);}//查询申请失败教师出差申请@getmapping("/lect_work_failed")@responbodypublic msg fun3(httpssion httpssion) {teacherwithblobs teacher = (teacherwithblobs) httpssion.getattribute("teacherinfo");list<workapprovalwithblobs> list = teacherrvice.lectworkfailed(teacher.getid());return msg.success().add("workinfo", list);}//查询已提交教师出差申请@getmapping("/lect_work_submitted")@responbodypublic msg fun4(httpssion httpssion) {teacherwithblobs teacher = (teacherwithblobs) httpssion.getattribute("teacherinfo");list<workapprovalwithblobs> list = teacherrvice.lectworksubmitted(teacher.getid());return msg.success().add("workinfo", list);}//删除申请失败的教师出差@postmapping("/delete_work")@responbodypublic msg deletework(long id) {teacherrvice.deleteworkbyid(id);return msg.success();}//加载报告填写页面@getmapping("/fillworkapproval")public string fun5(long id, model model) throws parexception {workapprovalwithblobs workapproval = teacherrvice.lectworkbyid(id);simpledateformat sdf = new simpledateformat("yyyy/mm/dd");string start = sdf.format(workapproval.getbegindate());string end = sdf.format(workapproval.getenddate());string time = start + " - " + end;model.addattribute("workapproval", workapproval);model.addattribute("time", time);return "teacher/workapproval/fillwdata";}//上传出差报告@postmapping("/fill_in_w")@responbodypublic msg fun7(@requestparam("id_work") long idwork, @requestparam("news") string news, @requestparam("flag") integer flag,@requestparam("file") multipartfile file) throws ioexception {//判断file的值是否为空if (file.impty()) {return msg.error();}string filename = file.getoriginalfilename();// 获取上传文件的原名int size = (int) file.getsize();system.out.println(filename + "-->" + size);file path = new file(resourceutils.geturl("target").getpath());string savepath = path.getabsolutepath() + "\\class\\static\\model";string savefilename = savepath + "\\" + filename;// string path = "d:/test";//文件保存路径file targetfile = new file(savepath);if (!targetfile.getparentfile().exists()) { //判断文件父目录是否存在targetfile.getparentfile().mkdir();}file.transferto(new file(targetfile, filename)); // 开始接受文件workapprovaldata workapprovaldata = new workapprovaldata();workapprovaldata.tidworkapproval(idwork);workapprovaldata.tnews(news);workapprovaldata.tdatarar(savefilename);//flag == 0 公有 flag == 1私有workapprovaldata.tflag(flag);teacherrvice.inrtworddata(workapprovaldata);return msg.success();}//查看出差报告@getmapping("/lect_work_data")@responbodypublic msg fun8(integer pn, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");pagehelper.startpage(pn, 9);list<workapprovaldata> list = teacherrvice.lectworkdata(teacher.getidction());pageinfo page = new pageinfo(list, 5);return msg.success().add("datainfo", page);}//出差附件下载@requestmapping(value = "/file_download")public responentity<byte[]> downloadfile(string dataid, httprvletrequest req, httprvletrespon respon) throws ioexception {workapprovaldata workapprovaldata = null;if (dataid != null) {long id = long.valueof(dataid);workapprovaldata = teacherrvice.lectworkdatabyid(id);}if (workapprovaldata != null) {string filepath = workapprovaldata.getdatarar();//设置文件路径file file = new file(filepath);if (!file.exists()) {file.mkdirs();}string filename = file.getname();httpheaders headers = new httpheaders();headers.tcontenttype(mediatype.multipart_form_data);string encodefilename = urlencoder.encode(filename, standardcharts.utf_8.tostring());headers.tcontentdispositionformdata("attachment", encodefilename);return new responentity<byte[]>(fileutils.readfiletobytearray(file),headers, httpstatus.created);}return null;}//学期述职@postmapping("/upload_term_debriefing")@responbodypublic msg fun9(string year, string term, string teachingtask, string scientificrearch,string otherwork, string winaward, string summary, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");debriefingwithblobs debriefingwithblobs = new debriefingwithblobs();debriefingwithblobs.tidteacher(teacher.getid()灵耀x2pro);debriefingwithblobs.tyear(long.parlong(year));debriefingwithblobs.tterm(term);debriefingwithblobs.tteachingtask(teachingtask);debriefingwithblobs.tachievementsinscientificrearch(scientificrearch);debriefingwithblobs.totherwork(otherwork);debriefingwithblobs.twinaward(winaward);debriefingwithblobs.tsummary(summary);int flag = teacherrvice.lecttermdebriefingflag(teacher.getid(), long.parlong(year), term);if (flag == 1) {teacherrvice.updatetermdebriefing(debriefingwithblobs);} el {int i = teacherrvice.inrttermdebriefing(debriefingwithblobs);}return msg.success();}// 工作量表相关@getmapping("/wordload")public string wordloadpage() {return "teacher/table/workload";}@getmapping("/wordloaddata")@responbodypublic msg wordloaddata(@requestparam("year") string year,@requestparam("trem") string trem) {teacher teacher = (teacher) request.getssion().getattribute("teacherinfo");return msg.success().add("teacher", teacher).add("workloaddto", teacherrvice.getworkload(teacher.getid(), year, trem));}private static final logger logger = loggerfactory.getlogger(teachercontroller.class);@autowiredhttprvletrequest request;@postmapping("/wordload")@responbodypublic msg wordloadsave(@requestbody workloaddto workloaddto) {teacher teacher = (teacher) request.getssion().getattribute("teacherinfo");// logger.info("{}",workloaddto);teacherrvice.saveworkload(workloaddto, teacher);return msg.success();}// 教师业务表@getmapping("/business")public string businesspage() {return "teacher/table/business";}@getmapping("/businessdata")@responbodypublic msg businessdata(@requestparam("year") string year,@requestparam("trem") string trem) {teacher teacher = (teacher) request.getssion().getattribute("teacherinfo");return teacherrvice.getbusiness(teacher.getid(), year, trem).add("teacher", teacher);}@postmapping("/business")@responbodypublic msg savebusiness(@requestbody businessdto businessdto) {teacher teacher = (teacher) request.getssion().getattribute("teacherinfo");return msg.sqlchange((int) teacherrvice.savebusiness(businessdto, teacher));}//年度述职@postmapping("/upload_year_debriefing")@responbodypublic msg fun10(string year, string teachingtask, string scientificrearch,string otherwork, string winaward, string summary, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");debriefingyearwithblobs debriefingyear = new debriefingyearwithblobs();debriefingyear.tidteacher(teacher.getid());debriefingyear.tyear(long.parlong(year));debriefingyear.tteachingtask(teachingtask);debriefingyear.tachievementsinscientificrearch(scientificrearch);debriefingyear.totherwork(otherwork);debriefingyear.twinaward(winaward);debriefingyear.tsummary(summary);long flag = teacherrvice.lectyeardebriefingflag(teacher.getid(), long.parlong(year));if (flag == 1) {teacherrvice.updateyeardebriefing(debriefingyear);} el {int i = teacherrvice.inrtyeardebriefing(debriefingyear);}return msg.success();}//查询年度述职中年份@getmapping("/lect_debriefing_year")@responbodypublic msg fun11() {list<debriefingyear> list = teacherrvice.lectdebriefingbyyear();// 把年份排序collections.sort(list, new comparator<debriefingyear>() {@overridepublic int compare(debriefingyear o1, debriefingyear o2) {return (int) (o2.getyear() - o1.getyear());}});return msg.success().add("year", list);}//查询指定年份的年度述职信息@getmapping("/lect_debriefing_year_info")@responbodypublic msg fun12(long year, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");debriefingyearwithblobs debriefingyear = teacherrvice.lectyeardebriefinginfo(teacher.getid(), year);return msg.success().add("debriefinginfo", debriefingyear);}//查询学期述职中年份@getmapping("lect_debriefing_term")@responbodypublic msg fun13() {list<debriefing> list = teacherrvice.lectdebriefingtermbyyear();list<long> temp = new arraylist<>();//去除重复的年份for (debriefing s : list) {if (!temp.contains(s.getyear())) {temp.add(s.getyear());}}return msg.success().add("year", temp);}//查询指定年份的学期述职信息@getmapping("/lect_debriefing_term_info")@responbodypublic msg fun14(long year, string term, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");debriefingwithblobs debriefing = teacherrvice.lecttermdebriefinginfo(teacher.getid(), year, term);return msg.success().add("debriefinginfo", debriefing);}//年度考核@postmapping("/upload_annual_asssment")@responbodypublic msg fun15(string personalsummary, string year, string remark, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");annualasssmentwithblobs asssment = new annualasssmentwithblobs();asssment.tidteacher(teacher.getid());asssment.tpersonalsummary(personalsummary);asssment.tyear(year);asssment.tremark(remark);long flag = teacherrvice.lectannualasssmentflag(teacher.getid(), year);if (flag == 1) {int i = teacherrvice.updateannualasssment(asssment);} el {int i = teacherrvice.inrtannualasssment(asssment);}return msg.success();}//年度专业技术人员考核表@postmapping("/upload_technical_personnel")@responbodypublic msg fun16(string year, string mainachievements, string attendance, string rewardsandpunishments, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");technicalpersonnelwithblobs technicalpersonnelwithblobs = new technicalpersonnelwithblobs();technicalpersonnelwithblobs.tidteacher(teacher.getid());technicalpersonnelwithblobs.tyear(year);technicalpersonnelwithblobs.tmainachievements(mainachievements);technicalpersonnelwithblobs.tattendance(attendance);technicalpersonnelwithblobs.trewardsandpunishments(rewardsandpunishments);long flag = teacherrvice.lecttechnicalpersonnelflag(teacher.getid(), long.parlong(year));if (flag == 1) {int i = teacherrvice.updatetechnicalpersonnel(technicalpersonnelwithblobs);} el {int i = teacherrvice.inrttechnicalpersonnel(technicalpersonnelwithblobs);}return msg.success();}//查询年度考核年份@getmapping("/lect_annual_asssment")@responbodypublic msg fun17(httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");list<annualasssment> list = teacherrvice.lectannualasssmentbyyear(teacher.getid());if (list.impty()) {return msg.fail();} el {return msg.success().add("year", list);}}//查询指定年度考核信息@getmapping("/lect_annualasssment_year_info")@responbodypublic msg fun18(long year, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");annualasssmentwithblobs asssment = teacher排球教案rvice.lectannualasssmentinfo(teacher.getid(), year);return msg.success().add("asssmentinfo", asssment);}//查询度专业技术人员考核表年份@getmapping("/lect_technical_personnel_year")@responbodypublic msg fun18(httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");list<technicalpersonnel> list = teacherrvice.lecttechnicalpersonnelbyyear(teacher.getid());if (list.impty()) {return msg.fail();} el {return msg.success().add("year", list);}}//查询度专业技术人员考核表信息@getmapping("/lect_technicalpersonnel_year_info")@responbodypublic msg fun19(long year, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");technicalpersonnelwithblobs technicalpersonnelwithblobs = teacherrvice.lecttechnicalpersonnelinfo(teacher.getid(), year);return msg.success().add("technicalpersonnel", technicalpersonnelwithblobs);}// 毕业设计内容// 加载上传课题页面@getmapping("/upload_topic_page")public string uploadtopic(modelmap modelmap, httpssion httpssion) {teacherwithblobs teacher = (teacherwithblobs) httpssion.getattribute("teacherinfo");list<projecttype> projecttypes = teacherrvice.lect_allprojecttype();list<projectsource> projectsources = teacherrvice.lect_allprojectsource();list<specialty> specialties = teacherrvice.lect_allspecialty(teacher.getidction());modelmap.addattribute("projecttypes", projecttypes);modelmap.addattribute("projectsources", projectsources);modelmap.addattribute("specialties", specialties);return "teacher/graduation/upload";}// 上传课题@postmapping("/up_project")@responbodypublic msg fun20(string projectname, long idprojecttype, long idprojectsource, string marchspecialty, string teachernames, @requestparam("file") multipartfile file, httprvletrequest request, httpssion httpssion) throws ioexception {if (file == null) {return msg.fail().add("msg","文件上传失败");}if(teacherrvice.lectprojectbyname(projectname).size()>0){system.out.println("上传失败");return msg.fail().add("msg","课题名已存在");}teacher teacher = (teacher) httpssion.getattribute("teacherinfo");rvletcontext rvletcontext = request.getssion().getrvletcontext();string uploadfilename = file.getoriginalfilename(); // 获取上传文件的原名system.out.pr兰芝补水眼霜intln(uploadfilename);uploadfilename = uploadfilename.substring(uploadfilename.lastindexof(file.parator) + 1);system.out.println(uploadfilename);file path = new file(resourceutils.geturl("target").getpath());string savepath =path.getabsolutepath() + file.parator+"class+"+file.parator+"static"+file.parator+"model"+file.parator + teacher.getid();string savefilename = savepath +file.parator + uploadfilename;file dirs = new file(savepath);//判断路径是否存在,如果不存在就创建一个if (!dirs.exists()) {dirs.mkdirs();}file.transferto(new file(dirs, uploadfilename)); // 开始接受文件system.out.println(teachernames);projectwithblobs project = new projectwithblobs();project.tprojectname(projectname);project.tidprojecttype(idprojecttype);project.tidprojectsource(idprojectsource);project.tidteacher(teacher.getid());project.tfilepath(savefilename);project.tmarchspecialty(marchspecialty.trim());project.tteachernames(teachernames);project.tlectcount(0);project.tlectflag(0);project.tverifyprojectflag(0);project.treleaflag(0);int i = teacherrvice.inrt_project(project);return msg.success();}//查看自己的课题发布记录@getmapping("/cxmyproject")public string fun21(modelmap modelmap, httpssion httpssion) {teacherwithblobs teacher = (teacherwithblobs) httpssion.getattribute("teacherinfo");list<projecttype> projecttypes = teacherrvice.lect_allprojecttype();list<projectsource> projectsources = teacherrvice.lect_allprojectsource();list<specialty> specialties = teacherrvice.lect_allspecialty(teacher.getidction());modelmap.addattribute("projecttypes", projecttypes);modelmap.addattribute("projectsources", projectsources);modelmap.addattribute("specialties", specialties);list<project> projects = teacherrvice.lectteacherproject(teacher.getname());for (int i = 0; i < projects.size(); i++) {if (projects.get(i).getverifyprojectflag() == 0) projects.get(i).tprojectzt("未审核");el if (projects.get(i).getverifyprojectflag() == 1) projects.get(i).tprojectzt("审核未通过");el projects.get(i).tprojectzt("审核通过");}modelmap.addattribute("myproject", projects);return "teacher/graduation/ction_xq/index";}// 发布或取消发布已审核通过的课题@postmapping("/fb_project")@responbodypublic string fun8(long project_id, string pd,httpssion httpssion) {int s = integer.parint(pd);teacherrvice.updateprojectfb(project_id, s);if (s == 0) {teacherrvice.deletelectedall(project_id);teacherrvice.updateprojectcount(project_id);}map<string, string> map = new hashmap<string, string>();map.put("pd", "" + 1);return jsonobject.tojsonstring(map);}@postmapping("del_project")@responbodypublic msg deleteproject(long id) {teacherrvice.deleteproject(id);return msg.success();}@postmapping("/updatesubject")@responbodypublic msg updateproject(long id, string projectname, long idprojecttype, long idprojectsource, string marchspecialty, string teachernames, @requestparam(value = "file", required = fal) multipartfile file, httprvletrequest request, httpssion httpssion) throws ioexception {//拼接 teachernames 字段teacherwithblobs teacher = (teacherwithblobs) request.getssion().getattribute("teacherinfo");string teachername = teacher.getname();if (teachernames == null || teachernames.trim().length() == 0) {teachernames = teachername;} el {teachernames = teachername + "&" + teachernames;}subjectwithblobs subject = null;//文件大小 为 0 则表示 文件没上传long size = file.getsize();//不更新课题文件情况if (file == null || size == 0) {subject = new subjectwithblobs();subject.tid(id);subject.tprojectname(projectname);subject.tidprojecttype(idprojecttype);subject.tidprojectsource(idprojectsource);subject.tmarchspecialty(marchspecialty);subject.tteachernames(teachernames);//修改后状态置 0subject.tlectflag(0);subject.tverifyprojectflag(0);subject.treleaflag(0);subjectrvice.updatesubjectbyid(subject);return msg.success();} el {//获取课题subjectwithblobs subject1 = subjectrvice.getsubjectbyid(id);//获取课题路径string oldpath = subject1.getfilepath();file oldfile = new file(oldpath);//如果文件存在则删除if (oldfile.exists()) {//删除成功if (oldfile.delete()) {} el {return msg.fail();}}rvletcontext rvletcontext = request.getssion().getrvletcontext();string uploadfilename = file.getoriginalfilename(); // 获取上传文件的原名uploadfilename = uploadfilename.substring(uploadfilename.lastindexof(file.parator) + 1);file path = new file(resourceutils.geturl("target").getpath());// string savepath = path.getabsolutepath() + "\\class\\static\\model\\" + teacher.getid();// string savefilename = savepath + "\\" + uploadfilename;string savepath =path.getabsolutepath() + file.parator+"class+"+file.parator+"static"+file.parator+"model"+file.parator + teacher.getid();string savefilename = savepath +file.parator + uploadfilename;file dirs = new file(savepath);//判断路径是否存在,如果不存在就创建一个if (!dirs.exists()) {dirs.mkdirs();}file.transferto(new file(dirs, uploadfilename)); // 开始接受文件subjectwithblobs project = subject1;project.tprojectname(projectname);project.tidprojecttype(idprojecttype);project.tidprojectsource(idprojectsource);project.tfilepath(savefilename);project.tmarchspecialty(marchspecialty.trim());project.tteachernames(teachernames);//修改后状态置 0project.tlectflag(0);project.tverifyprojectflag(0);project.treleaflag(0);int i = subjectrvice.updatesubjectbyid(project);return msg.success();}}@getmapping("/getsubjectbyid")@responbodypublic msg getss(long id) {subjectwithblobs subject = subjectrvice.getsubjectbyid(id);system.out.println(subject);subject.tfilepath(subject.getfilepath().substring(subject.getfilepath().lastindexof("\\") + 1));string[] teachers = subject.getteachernames().split("&");string teacher2 = "";if (teachers.length >= 2) {teacher2 = teachers[teachers.length - 1];}subject.tteachernames(teacher2);return msg.success().add("subject", subject);}//查看自己所在教研室的课题发布记录@getmapping("/cxallproject")public string fun7(modelmap modelmap, httpssion httpssion) {teacher teacher = (teacher) httpssion.getattribute("teacherinfo");list<project> projects = teacherrvice.lecctionproject(teacher.getctionname());for (int i = 0; i < projects.size(); i++) {if (projects.get(i).getverifyprojectflag() == 0) projects.get(i).tprojectzt("未审核");el if (projects.get(i).getverifyprojectflag() == 1) projects.get(i).tprojectzt("审核未通过");el projects.get(i).tprojectzt("审核通过");}modelmap.addattribute("allproject", projects);return "teacher/graduation/ction_xq/subjectinfoto";}}
@controllerpublic class logincontroller {private static final logger logger = loggerfactory.getlogger(logincontroller.class);@autowiredadminrvice adminrvice;@getmapping("/cs")public string cs() {return "cs";}@getmapping("/login")public string login() {return "login";}@postmapping("/login")@responbodypublic msg login(string name, string pwd, httpssion httpssion) {name = name.trim();// logger.info("{}--{}",name,pwd);return adminrvice.login(name, pwd, httpssion);}}
@authority(roles = {role.admin, role.sadmin})@controller@requestmapping("/admin")public class admincontroller {private static final logger logger = loggerfactory.getlogger(admincontroller.class);@autowiredadminrvice adminrvice;@autowiredadminmapper adminmapper;@autowiredcollegervice collegervice;@autowiredctionrvice ctionrvice;@autowiredspecialtyrvice specialtyrvice;@autowiredclassrvice classrvice;@autowiredteacherrvice teacherrvice;@autowiredstudentrvice studentrvice;@autowiredsubjectrvice subjectrvice;@autowiredexcelrvice excelrvice;@autowiredsubjectrelationstudentmapper subjectrelationstudentmapper;@autowiredhttprvletrequest request;@autowiredhttprvletrespon respon;@autowiredhttpssion ssion;@modelattribute("id_institute")public long getroleinfo() {ur ur = (ur) request.getattribute("ur");// logger.info("ur:{}",ur);if (ur != null) {if (ur.getrole().equals("admin")) {institute institute = collegervice.lectcollege(adminmapper.lectbyprimarykey(ur.getid()).getidinstitute());return institute.getid();}if (ur.getrole().equals("sadmin")) {return -1;}return 0;} el {return 0;}}// admin index page 子管首页@getmapping(value = {"", "/index"})public string index() {ur ur = (ur) request.getattribute("ur");// logger.info("index ur:{}",ur);//这部分还是用了ssion存储部分信息 后续可能修改//根据 ur的id 判断 渲染页面if (ur.getid() == -1) {logger.info("超级管理员登录");ssion.tattribute("institutename", "超级管理员");ssion.tattribute("role", "sadmin");ssion.tattribute("urname", ur.geturname());return "admin/public-admin-index";}institute institute = collegervice.lectcollege(adminmapper.lectbyprimarykey(ur.getid()).getidinstitute());system.out.println(institute.getinstitutename());ssion.tattribute("institutename", institute.getinstitutename());ssion.tattribute("role", "admin");ssion.tattribute("urname", ur.geturname());return "admin/public-admin-index";}// exit 退出登录@getmapping("/exit")public string exit(httpssion httpssion) {//将cookie 中的token 置空cookie cookie = new cookie("token", null);cookie.tpath("/");respon.addcookie(cookie);return "login";}// login 在单独controller// updatepwd 更新密码@getmapping("/updatepwd")public string updatepwd() {return "admin/updatepwd";}@postmapping("/updatepwd")@responbodypublic msg updatepwd(@requestbody admin admin,httpssion httpssion) {ur ur = (ur) request.getattribute("ur");adminrvice.updatepwdbyurname(ur.geturname(),admin.getpwd());return msg.success();}// 教研室@getmapping("/ctionmanagement")public string ction() {return "admin/department/ctionmanagement";}@getmapping("/ctions")@responbodypublic msg getctions(@modelattribute("id_institute") long id_institute) {return msg.success().add("ctions", ctionrvice.getctions(id_institute));}@deletemapping("/ction")@responbodypublic msg delction(@requestbody ction ction) {return msg.sqlchange((int) ctionrvice.delction(ction));}@putmapping("/ction")@responbodypublic msg updatection(@requestbody @validated ction ction, @modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) ctionrvice.updatection(ction, ction.getctionname(), id_institute));}@postmapping("/ction")@responbodypublic msg addction(@requestbody @validated ction ction, @modelattribute("id_institute") long id_institute) {return msg.sqlchange((int) ctionrvice.addction(ction, id_institute));}// 专业方向@getmapping("/specialtymanagement")public string specialty() {return "admin/department/specialtymanagement";}@getmapping("/specialtys")@responbodypublic msg getspecialtys(@requestparam integer offt,@requestparam(required = fal) long ctionid,@requestparam(required = fal) string keyword,@modelattribute("id_institute") long id_institute) {long total = specialtyrvice.getspecialtycount(offt, keyword, ctionid, id_institute);return msg.success().add("specialtys", specialtyrvice.getspecialtys(offt, keyword, ctionid, id_institute)).add("total", total);}@responbody@deletemapping("/specialty")public msg delspecialty(@requestbody specialty specialty,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) specialtyrvice.delspecialty(specialty, id_institute));}@responbody@putmapping("/specialty")public msg putspecialty(@requestbody @validated({update.class}) specialty specialty,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) specialtyrvice.putspecialty(specialty, id_institute));}@responbody@postmapping("/specialty")public msg postspecialty(@requestbody @validated({add.class}) specialty specialty,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) specialtyrvice.postspecialty(specialty, id_institute));}// 班级@getmapping("/classmanagement")public string class() {return "admin/department/classmanagement";// //获取管理员的 学院id// public static long getidinstitute(modelmap modelmap) {// subadmin subadmin = (subadmin) modelmap.get("admin");// return subadmin.getidinstitute();// }}@responbody@getmapping("/class")public msg getclass(@requestparam("offt") integer offt,@requestparam(required = fal) long specialtyid,@requestparam(required = fal) string keyword,@modelattribute("id_institute") long id_institute) {long total = classrvice.getclasscount(offt, keyword, specialtyid, id_institute);return msg.success().add("class", classrvice.getclass(offt, keyword, specialtyid, id_institute)).add("total", total);}@responbody@deletemapping("/class")public msg delclass(@requestbody myclass myclass,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) classrvice.delclass(myclass, id_institute));}@responbody@putmapping("/class")public msg putclass(@requestbody @validated({one.class}) myclass myclass,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) classrvice.putclass(myclass, id_institute));}@responbody@postmapping("/class")public msg postclass(@requestbody @validated({one.class}) myclass myclass,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) classrvice.postclass(myclass, id_institute));}// 课题综合管理@getmapping("/sourcemanagement")public string source() {return "admin/subject/sourcemanagement";}@responbody@getmapping("/sources")public msg getsources() {return msg.success().add("sources", subjectrvice.lectsubjectsources());}@responbody@postmapping("/source")public msg addsource(@requestbody @validated subjectsource source) throws myexception {return msg.sqlchange((int) subjectrvice.inrtsubjectsource(source.getsourcename()));}@responbody@deletemapping("/source")public msg delsource(@requestbody subjectsource source) throws myexception {return msg.sqlchange(subjectrvice.delsubjectsource(source.getid()));}@responbody@putmapping("/source")public msgbreath updatesource(@requestbody @validated subjectsource source) {return msg.sqlchange(subjectrvice.updatesubjectsource(source));}//课题类型@getmapping("/typemanagement")public string subjecttype() {return "admin/subject/typemanagement";}@responbody@getmapping("/sujecttypes")public msg gettype() {return msg.success().add("sujecttypes", subjectrvice.lectsubjecttypes());}@responbody@postmapping("/sujecttype")public msg addtype(@requestbody @validated subjecttype type) throws myexception {return msg.sqlchange((int) subjectrvice.inrtsubjecttype(type.gettypename()));}@responbody@deletemapping("/sujecttype")public msg deltype(@requestbody subjecttype type) throws myexception {return msg.sqlchange(subjectrvice.delsubjecttype(type.getid()));}@responbody@putmapping("/sujecttype")public msg updatetype(@requestbody @validated subjecttype type) {return msg.sqlchange(subjectrvice.updatesubjecttype(type));}//课题管理@getmapping("/subjectmanagement")public string subject() {return "admin/subject/subjectmanagement";}@responbody@getmapping("/subjects")public msg getsubjects(@requestparam integer offt,@requestparam(required = fal) long ctionid,@requestparam(required = fal) string keyword,@modelattribute("id_institute") long id_institute) {long total = subjectrvice.lectsubjectscount(offt, keyword, ctionid, id_institute);return msg.success().add("subjects", subjectrvice.lectsubjects(offt, keyword, ctionid, id_institute)).add("total", total);}@responbody@postmapping("/subject")public msg addsubject(@requestbody @validated(add.class) subjectwithblobs subject,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) subjectrvice.inrtsubject(subject, id_institute));}@responbody@deletemapping("/subject")public msg delsubject(@requestbody subjectwithblobs subject,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange(subjectrvice.delsubject(subject, id_institute));}@responbody@putmapping("/subject")public msg updatesubject(@requestbody @validated(update.class) subjectwithblobs subject,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange(subjectrvice.updatesuject(subject, id_institute));}//get学生选题的状态@getmapping("/srs")@responbodypublic msg getlectsubjected(@modelattribute("id_institute") long id_institute) {system.out.println(subjectrvice.getlectsubjected(null, id_institute));return msg.success().add("srs", subjectrvice.getlectsubjected(null, id_institute));}//get 选某个课题的所有学生@getmapping("/studentsbysubject")@responbodypublic msg getstuentbysubject(@requestparam("id") long id,@modelattribute("id_institute") long id_institute) {return subjectrvice.getstuentbysubject(id, id_institute);}// 教师管理 增删改查@getmapping("/teachermanagement")public string teacher() {return "admin/basicinfo/teachermanagement";}@responbody@getmapping("/teachers")public msg getteachers(@requestparam integer offt,@requestparam(required = fal) long ctionid,@requestparam(required = fal) string keyword,@modelattribute("id_institute") long id_institute) {long total = teacherrvice.lectteacherscount(offt, keyword, ctionid, id_institute);return msg.success().add("teachers", teacherrvice.lectteachers(offt, keyword, ctionid, id_institute)).add("total", total);}@responbody@deletemapping("/teacher")public msg delteacher(@requestbody teacherwithblobs teacher,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) teacherrvice.delteacher(teacher, id_institute));}@responbody@postmapping("/teacher")public msg addteacher(@requestbody @validated(add.class) teacherwithblobs teacher,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) teacherrvice.addteacher(teacher, id_institute));}@responbody@putmapping("/teacher")public msg updateteacher(@requestbody @validated({update.class}) teacherwithblobs teacher,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) teacherrvice.updateteacher(teacher, id_institute));}//教师批量教师导入@postmapping("/teacherexcel")@responbodypublic msg addteacherexcel(@requestparam("excel") multipartfile excelfile,@modelattribute("id_institute") long id_institute) throws myexception, ioexception {return excelrvice.teacherexcelimport(excelfile, id_institute);}//教师批量导入模板@getmapping("/teacherexceldemo")public void getteacherexceldemo(httprvletrespon respon) throws ioexception {excelrvice.teacherexceldownload(respon);}// 学生管理@getmapping("/studentmanagement")public string student() {return "admin/basicinfo/studentmanagement";}@responbody@getmapping("/students")public msg getstudents(@requestparam integer offt,@requestparam(required = fal) long classid,@requestparam(required = fal) long specialtyid,@requestparam(required = fal) string keyword,@modelattribute("id_institute") long id_institute) throws myexception {long total = studentrvice.lectstudentscount(offt, keyword, classid, specialtyid, id_institute);return msg.success().add("students", studentrvice.lectstudents(offt, keyword, classid, specialtyid, id_institute)).add("total", total);}@responbody@deletemapping("/student")public msg delstudent(@requestbody studentwithblobs student,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) studentrvice.delstudent(student, id_institute));}@responbody@postmapping("/student")public msg addstudent(@requestbody @validated(add.class) studentwithblobs student,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) studentrvice.addstudent(student, id_institute));}@responbody@putmapping("/student")public msg updatestudent(@requestbody @validated({update.class}) studentwithblobs student,@modelattribute("id_institute") long id_institute) throws myexception {return msg.sqlchange((int) studentrvice.updatestudent(student, id_institute));}// 批量导入模板@getmapping("/studentexceldemo")public void getstudentexceldemo(httprvletrespon respon) throws ioexception {excelrvice.studentexceldownload(respon);}//批量学生导入@postmapping("/studentexcel")@responbodypublic msg addstudentexcel(@requestparam("excel") multipartfile excelfile,@modelattribute("id_institute") long id_institute) throws myexception, ioexception {return excelrvice.studentexcelimport(excelfile, id_institute);}// 生成一览表//课题一览表@getmapping("/subjectexcel")public void getsubjectexcel(httprvletrespon respon,httprvletrequest request,@modelattribute("id_institute") long id_institute) throws ioexceptio大写字母n {excelrvice.subjectexceldownload(respon, request, id_institute);}}
以上就是java+springboot设计实现评教系统的详细内容,更多关于java springboot评教系统的资料请关注www.887551.com其它相关文章!
本文发布于:2023-04-04 07:09:12,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/5b5329f0e9fa22dd90784f78c96e28fe.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:java+SpringBoot设计实现评教系统.doc
本文 PDF 下载地址:java+SpringBoot设计实现评教系统.pdf
留言与评论(共有 0 条评论) |