最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

基于Java SSM框架實(shí)現(xiàn)簡易的評教系統(tǒng)

 更新時(shí)間:2022年02月07日 09:25:11   作者:編程指南針  
這篇文章主要介紹了通過Java SSM框架實(shí)現(xiàn)一個(gè)簡易的評教系統(tǒng)的示例代碼,文中的代碼講解詳細(xì),感興趣的小伙伴可以了解一下

介紹

項(xiàng)目編號:BS-GX-014

數(shù)據(jù)庫:mysql

開發(fā)工具:IDEA / ECLIPSE

開發(fā)技術(shù):SSM 框架

本系統(tǒng)基于SSM框架實(shí)現(xiàn)。主要包含三個(gè)角色,管理員,老師,學(xué)生。管理員主要管理學(xué)生,老師,課程。學(xué)生可以進(jìn)行選課,選完課后可以對任課老師評價(jià)。老師可以查看自己的評價(jià)信息。

效果圖

部分展示功能如下:

管理員角色:

學(xué)生角色:

老師角色:

部分核心代碼

package one.controller;
 
import java.util.List;	
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
 
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
 
import one.domain.Admin;
import one.domain.Curriculum;
import one.domain.Evaluate;
import one.domain.PageBean;
import one.domain.Student;
import one.domain.Teacher;
import one.service.AdminService;
import one.service.CurriculumService;
import one.service.ManyTableService;
import one.service.StudentService;
import one.service.TeacherService;
import one.vo.Details;
import one.vo.ManyTable;
import one.vo.Tea_Curri;
 
@Controller
public class AdminController {
	
	@Resource(name="manyTableServiceImpl")
	private ManyTableService mts;
	
	@Resource(name="studentServiceImpl")
	private StudentService stus;
	
	@Resource(name="teacherServiceImpl")
	private TeacherService teas;
	
	@Resource(name="adminServiceImpl")
	private AdminService adms;
	
	@Resource(name="curriculumServiceImpl")
	private CurriculumService curs;
 
	@RequestMapping("/seetea")
	public String seetea(Model model) throws Exception{
		List<Tea_Curri> listtea_curri = mts.gettea_curri();
		model.addAttribute("listtea_curri", listtea_curri);
		return "admin/seetea.jsp";	
	}
	
	
	@RequestMapping("/seedetails")
	public String seedetails(int cid,Model model) throws Exception{
		List<Details> listdetails = mts.getdetails(cid);
		int sum=0;
		int flag=0;
		for(Details det:listdetails){
			if(det.getEscore()==null){
				continue;
			}
			sum+=det.getEscore();
			flag++;
		}
		if(flag==0){
			return  "pjnotfinish.jsp";
		}
		double avg=sum/flag;
		int b=(int) (avg/10);
		String grade;
		switch(b){
		case 10:grade="非常優(yōu)秀";break;
		case 9:grade="優(yōu)秀";break;
		case 8:grade="良好";break;
		case 7:grade="中等";break;
		case 6:grade="及格";break;
		default:grade="不合格";
		}
		model.addAttribute("grade", grade);
		model.addAttribute("avg", avg);
		model.addAttribute("listdetails", listdetails);
		return "admin/details.jsp";
		
	}
	
	
	@RequestMapping("/viewstu")
	public String viewstu(Model model,int currPage) throws Exception{
		int pageSize=5;
		int count = stus.getcount();
		int totalPage=(int) Math.ceil((count*1.0/pageSize));
		if(currPage<=0){
			currPage=1;
		}
		if(currPage>=totalPage){
			currPage=totalPage;
		}
		PageBean<Student> pb = stus.getfenyestu(currPage, pageSize);
//		List<Student> listallstu = stus.getallstu();
		List<Student> liststu = pb.getList();
		model.addAttribute("pb", pb);
		model.addAttribute("liststu", liststu);
		return "admin/viewstu.jsp";
		
	}
	
	
	@RequestMapping("/viewtea")
	public String viewtea(Model model,int currPage) throws Exception{
		int pageSize=5;
		int count = teas.getcount();
		int totalPage=(int) Math.ceil((count*1.0/pageSize));
		if(currPage<=0){
			currPage=1;
		}
		if(currPage>=totalPage){
			currPage=totalPage;
		}
		PageBean<Teacher> pb = teas.getfenyetea(currPage, pageSize);
//		List<Teacher> listalltea = teas.getalltea();
		List<Teacher> listtea = pb.getList();
		model.addAttribute("pb", pb);
		model.addAttribute("listtea",listtea);
		return "admin/viewtea.jsp";
		
	}
	
	@RequestMapping("/addstu")
	public String viewtea(Student stu,Model model) throws Exception{
		Student getstu = stus.getstu(stu.getSid());
		if(getstu==null){
			stus.insertstu(stu);
			model.addAttribute("succ", "添加成功");
		}else{
			model.addAttribute("err", "已存在該編號的學(xué)生");
		}
		return "admin/addstu.jsp";
		
	}
	
	
	
	@RequestMapping("/addtea")
	public String viewtea(Teacher tea,Model model) throws Exception{
		Teacher gettea = teas.gettea(tea.getTid());
		if(gettea==null){
			teas.inserttea(tea);
			model.addAttribute("succ", "添加成功");
		}else{
			model.addAttribute("err", "已存在該編號的教師");
		}
		return "admin/addtea.jsp";
		
	}
	
	//點(diǎn)擊查看課程
	@RequestMapping("viewcurri")
	public String viewcurri(Model model,int currPage) throws Exception{
		int pageSize=10;
		int count = curs.getcount();
		int totalPage=(int) Math.ceil((count*1.0/pageSize));
		if(currPage<=0){
			currPage=1;
		}
		if(currPage>=totalPage){
			currPage=totalPage;
		}
		PageBean<Curriculum> pb = curs.getfenyecur(currPage, pageSize);
		List<Curriculum> listcur = pb.getList();
		model.addAttribute("pb", pb);
		model.addAttribute("listcur",listcur);
		return "admin/viewcurri.jsp";
		
	}
	
	
	//修改密碼,點(diǎn)擊提交
		@RequestMapping("/admuppwd")
		public String uppwd(String oldpwd,String newpwd,HttpServletRequest request,Model model)throws Exception{
			HttpSession session = request.getSession();
			Admin adm=(Admin) session.getAttribute("adm");
			if(adm.getApassword().equals(oldpwd)){
				adm.setApassword(newpwd);
				adms.uppwd(adm);
			}else{
				model.addAttribute("pwderr","你的原始密碼有誤");
				return "admin/updatepwd.jsp";
			}
			return "admin/uppwdsuccess.jsp";
			
		}
	
		
		
	//點(diǎn)擊添加課程功能
		@RequestMapping("addcurri")
		public String addcurri(Model model) throws Exception{
			List<Teacher> listalltea = teas.getalltea();
			model.addAttribute("listtea",listalltea);
			return "admin/addcurri.jsp";
				
		}
		
	//填寫課程信息后,點(diǎn)擊提交
		@RequestMapping("submitcurri")
		public String submitcurri(Curriculum cur,Model model) throws Exception{
			Curriculum curri = curs.getbyid(cur.getCid());
			if(curri==null){
				curs.addcur(cur);
				model.addAttribute("succ", "添加成功");
			}else{
				model.addAttribute("err", "該編號的課程已存在");
			}
			List<Teacher> listalltea = teas.getalltea();
			model.addAttribute("listtea",listalltea);
			return "admin/addcurri.jsp";
			
		}
	
		
		//點(diǎn)擊學(xué)生選課
		@RequestMapping("stuselectcur")
		public String stuselectcur(Model model,int currPage)throws Exception{
			int pageSize=10;
			int count = stus.getcount();
			int totalPage=(int) Math.ceil((count*1.0/pageSize));
			if(currPage<=0){
				currPage=1;
			}
			if(currPage>=totalPage){
				currPage=totalPage;
			}
			PageBean<Student> pb = stus.getfenyestu(currPage, pageSize);
//			List<Student> listallstu = stus.getallstu();
			List<Student> liststu = pb.getList();
			model.addAttribute("pb", pb);
			model.addAttribute("liststu", liststu);
			return "admin/stuselectcur.jsp";
		}
		
		
		
		//點(diǎn)擊教師任課
		@RequestMapping("teaselectcur")
		public String teaselectcur(Model model,int currPage)throws Exception{
			int pageSize=10;
			int count = teas.getcount();
			int totalPage=(int) Math.ceil((count*1.0/pageSize));
			if(currPage<=0){
				currPage=1;
			}
			if(currPage>=totalPage){
				currPage=totalPage;
			}
			PageBean<Teacher> pb = teas.getfenyetea(currPage, pageSize);
			List<Teacher> listalltea = pb.getList();
			model.addAttribute("pb", pb);
			model.addAttribute("listtea",listalltea);
			return "admin/teaselectcur.jsp";
		}
		
		
		//點(diǎn)擊選課詳情
		@RequestMapping("selectcurdetails")
		public String selectcurdetails(Model model,String ssid,String sname)throws Exception{
			List<ManyTable> liststu_curbystuid = mts.getstu_curbystuid(ssid);
			if(liststu_curbystuid.size()==0){
				model.addAttribute("sname", sname);
				return "admin/noselectcur.jsp";
			}
			model.addAttribute("liststu_curbystuid", liststu_curbystuid);
			model.addAttribute("sname", sname);
			return "admin/stucurdetails.jsp";
			
		}
		
		//點(diǎn)擊教師任課詳情
		@RequestMapping("teacurdetails")
		public String teacurdetails(Model model,String tid,String tname)throws Exception{
			List<Curriculum> listcurbytid = curs.getcurbytid(tid);
			if(listcurbytid.size()==0){
				model.addAttribute("tname", tname);
				return "admin/teanocur.jsp";
			}
			model.addAttribute("listcurbytid", listcurbytid);
			model.addAttribute("tname", tname);
			model.addAttribute("tid", tid);
			return "admin/teacurdetails.jsp";
				
		}
		
		
		
		
		//修改學(xué)生信息
		@RequestMapping("updatestu")
		public String updatestu(Student stu,Model model)throws Exception{
			stus.updatestu(stu);
			List<Student> listallstu = stus.getallstu();
			model.addAttribute("liststu", listallstu);
			return "/viewstu?currPage=1";
			
		}
		
		
		//修改教師信息
		@RequestMapping("updatetea")
		public String updatetea(Teacher tea,Model model)throws Exception{
			teas.updatetea(tea);
			List<Teacher> listalltea = teas.getalltea();
			model.addAttribute("listtea",listalltea);
			return "/viewtea?currPage=1";
			
		}
		
		
		//刪除學(xué)生
		@RequestMapping("/delstu")
		public String  delstu(HttpServletRequest request)throws Exception{
			String sid = request.getParameter("sid");
			stus.delstu(sid);
			return "/viewstu?currPage=1";
			
		}
		
		//刪除老師
		@RequestMapping("/deltea")
		public String deltea(String tid)throws Exception{
			teas.deltea(tid);
			return "/viewtea?currPage=1";
			
		}
		
		//刪除課程
		@RequestMapping("/deletecurriculumbyid")
		public String deletecurriculumbyid(int cid)throws Exception{
			curs.deletecur(cid);
			return "/viewcurri?currPage=1";	
		}
		
		//點(diǎn)擊修改課程
		@RequestMapping("/updatecurr")
		public String updatecurr(Model model)throws Exception{
			List<Teacher> listalltea = teas.getalltea();
			model.addAttribute("listtea",listalltea);
			return "admin/updatecurr.jsp";
				
		}
		
		
		//課程里點(diǎn)擊確認(rèn)修改
		@RequestMapping("/querenxiugai")
		public String querenxiugai(Model model,Curriculum curr){
			curs.querenxiugai(curr);
			return "viewcurri?currPage=1";
		}
		
		//按姓名查詢學(xué)生
		@RequestMapping("/nameselect")
		public String nameselect(String name,Model model)throws Exception{
			List<Student> liststu = stus.findbyname(name);
			if(liststu.size()==0){
				return "admin/NewFile1.jsp";
			}
			model.addAttribute("liststu", liststu);
			return "admin/NewFile2.jsp";	
		}
		
		
		//按姓名查詢老師
				@RequestMapping("/tnameselect")
				public String tnameselect(String name,Model model)throws Exception{
					List<Teacher> listtea = teas.findteabyname(name);
					if(listtea.size()==0){
						return "admin/NewFile3.jsp";
					}
					model.addAttribute("listtea", listtea);
					return "admin/NewFile4.jsp";	
				}
}
package one.controller;
 
import java.util.Date;
import java.util.List;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
 
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
 
import one.domain.Curriculum;
import one.domain.Evaluate;
import one.domain.Student;
import one.domain.Studentandcurriculum;
import one.service.CurriculumService;
import one.service.EvaluateService;
import one.service.ManyTableService;
import one.service.StudentService;
import one.vo.ManyTable;
 
@Controller
public class StudentController {
	
	@Resource(name="studentServiceImpl")
	private StudentService stus;
	
	@Resource(name="curriculumServiceImpl")
	private CurriculumService curs;
	
	@Resource(name="evaluateServiceImpl")
	private EvaluateService evaService;
	//修改密碼,點(diǎn)擊提交
	@RequestMapping("/stuuppwd")
	public String uppwd(String oldpwd,String newpwd,HttpServletRequest request,Model model)throws Exception{
		HttpSession session = request.getSession();
		Student stu=(Student) session.getAttribute("stu");
		if(stu.getSpassword().equals(oldpwd)){
			stu.setSpassword(newpwd);
			stus.uppwd(stu);
		}else{
			model.addAttribute("pwderr","你的原始密碼有誤");
			return "student/updatepwd.jsp";
		}
		return "student/uppwdsuccess.jsp";
		
	}
	
	//學(xué)生點(diǎn)擊進(jìn)行評教
	@RequestMapping("/aa")
	public String allpj(HttpServletRequest request,Model model) throws Exception{
		HttpSession session = request.getSession();
		Student stu = (Student) session.getAttribute("stu");
		List<ManyTable> listpj =  mts.getall(stu.getSid());
		if(listpj.size()==0){
			return "student/nocurr.jsp";
		}else{
		model.addAttribute("listpj", listpj);
		return "student/allpingjiao.jsp";	
		}
	}
	
	
	
	@Resource(name="manyTableServiceImpl")
	private ManyTableService mts;
	
	@Resource(name="evaluateServiceImpl")
	private EvaluateService evas;
	
	//學(xué)生提交評教
	@RequestMapping("/subpj")
	public String subpj(HttpServletRequest request,int eid,String advise,Model model)throws Exception{
		int  a = Integer.parseInt(request.getParameter("1"));
		int  b = Integer.parseInt(request.getParameter("2"));
		int  c = Integer.parseInt(request.getParameter("3"));
		int  d = Integer.parseInt(request.getParameter("4"));
		int  e = Integer.parseInt(request.getParameter("5"));
		int  f = Integer.parseInt(request.getParameter("6"));
		int  g = Integer.parseInt(request.getParameter("7"));
		int  h = Integer.parseInt(request.getParameter("8"));
		int  i = Integer.parseInt(request.getParameter("9"));
		int  j = Integer.parseInt(request.getParameter("10"));
		int sum=a+b+c+d+e+f+g+h+i+j;
		if(advise==""){
			advise=null;
		}
		Date date=new Date();
		Evaluate eva=new Evaluate();
		eva.setEid(eid);
		eva.setEscore(sum);
		eva.setEcomment(advise);
		eva.setEdate(date);
		evas.uppj(eva);
		HttpSession session = request.getSession();
		Student stu = (Student) session.getAttribute("stu");
		List<ManyTable> listpj =  mts.getall(stu.getSid());
		model.addAttribute("listpj", listpj);
		return "student/allpingjiao.jsp";
	}
	
	//點(diǎn)擊添加選課
	@RequestMapping("addmycur")
	public String addmycur(Model model)throws Exception{
		List<Curriculum> listallcur = curs.getallcur();
		model.addAttribute("listallcur", listallcur);
		return "student/addmycur.jsp";
			
	}
	
	
	@RequestMapping("stuaddcur")
	public String stuaddcur(HttpSession session,Model model,int scid ) throws Exception{
		Student stu = (Student) session.getAttribute("stu");
		Studentandcurriculum stucur=new Studentandcurriculum();
		stucur.setScid(scid);
		System.out.println(stu.getSid());
		stucur.setSsid(stu.getSid());
		Studentandcurriculum myselect = stus.findmyselect(stucur);
		if(myselect==null){
			stus.stuaddcur(stucur);
			Evaluate eva=new Evaluate();
			eva.setEsid(stucur.getSsid());
			eva.setEcid(stucur.getScid());
			evaService.addstuselect(eva);
			model.addAttribute("succ", "添加選課成功!");
		}else{
			model.addAttribute("err", "你已經(jīng)選了該課程!");
		}
		List<Curriculum> listallcur = curs.getallcur();
		model.addAttribute("listallcur", listallcur);
		return "student/addmycur.jsp";
		
	}
	
	
}

到此這篇關(guān)于基于Java SSM框架實(shí)現(xiàn)簡易的評教系統(tǒng)的文章就介紹到這了,更多相關(guān)Java SSM評教系統(tǒng)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Spring框架十一種常見異常的解決方法匯總

    Spring框架十一種常見異常的解決方法匯總

    今天小編就為大家分享一篇關(guān)于Spring框架十一種常見異常的解決方法匯總,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧
    2019-03-03
  • Spring Utils工具類常用方法實(shí)例

    Spring Utils工具類常用方法實(shí)例

    這篇文章主要介紹了Spring Utils工具類常用方法實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-04-04
  • java中TreeMap集合的常用方法詳解

    java中TreeMap集合的常用方法詳解

    本篇文章給大家?guī)淼膬?nèi)容是關(guān)于java中TreeMap集合的常用方法詳解,有一定的參考價(jià)值,有需要的朋友可以參考一下,希望對你有所幫助。下面我們就來學(xué)習(xí)一下吧
    2021-11-11
  • java利用java.net.URLConnection發(fā)送HTTP請求的方法詳解

    java利用java.net.URLConnection發(fā)送HTTP請求的方法詳解

    如何通過Java(模擬瀏覽器)發(fā)送HTTP請求是我們在日常經(jīng)常會遇到的問題,下面這篇文章主要給大家介紹了關(guān)于java利用java.net.URLConnection發(fā)送HTTP請求的相關(guān)資料,文中介紹的非常詳細(xì),需要的朋友可以參考借鑒,下面來一起看看吧。
    2017-05-05
  • 使用springboot跳轉(zhuǎn)到指定頁面和(重定向,請求轉(zhuǎn)發(fā)的實(shí)例)

    使用springboot跳轉(zhuǎn)到指定頁面和(重定向,請求轉(zhuǎn)發(fā)的實(shí)例)

    這篇文章主要介紹了使用springboot跳轉(zhuǎn)到指定頁面和(重定向,請求轉(zhuǎn)發(fā)的實(shí)例),具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2021-12-12
  • spring boot admin 搭建詳解

    spring boot admin 搭建詳解

    本篇文章主要介紹了spring boot admin 搭建詳解,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-04-04
  • 詳解Java如何實(shí)現(xiàn)有效的并發(fā)處理

    詳解Java如何實(shí)現(xiàn)有效的并發(fā)處理

    隨著互聯(lián)網(wǎng)的蓬勃發(fā)展,現(xiàn)代軟件系統(tǒng)對于并發(fā)性能的要求越來越高,如何學(xué)習(xí)和掌握并發(fā)編程技術(shù)成為了Java開發(fā)人員必備的技能之一,本文主要介紹了Java并發(fā)編程的相關(guān)概念、原理和實(shí)踐技巧,感興趣的可以了解下
    2023-11-11
  • Java基礎(chǔ)之命名規(guī)范的詳解

    Java基礎(chǔ)之命名規(guī)范的詳解

    這篇文章主要介紹了Java基礎(chǔ)之命名規(guī)范的詳解,文中有非常詳細(xì)的代碼示例,對正在學(xué)習(xí)Java基礎(chǔ)的小伙伴們有很好地幫助,需要的朋友可以參考下
    2021-05-05
  • Java深入分析了解平衡二叉樹

    Java深入分析了解平衡二叉樹

    平衡二叉樹又被稱為AVL樹(有別于AVL算法),且具有以下性質(zhì):它是一棵空樹或它的左右兩個(gè)子樹的高度差的絕對值不超過1,并且左右兩個(gè)子樹都是一棵平衡二叉樹。本文將詳解介紹一下平衡二叉樹的原理與實(shí)現(xiàn),需要的可以參考一下
    2022-06-06
  • Mybatis實(shí)戰(zhàn)之TypeHandler高級進(jìn)階

    Mybatis實(shí)戰(zhàn)之TypeHandler高級進(jìn)階

    本文主要介紹了自定義的枚舉TypeHandler的相關(guān)知識,具有很好的參考價(jià)值,下面跟著小編一起來看下吧
    2017-02-02

最新評論

遂宁市| 江山市| 牙克石市| 肃北| 昌都县| 濉溪县| 始兴县| 基隆市| 北宁市| 河南省| 临高县| 二手房| 清苑县| 藁城市| 德惠市| 富裕县| 苏州市| 巴彦淖尔市| 海阳市| 自贡市| 廉江市| 上饶县| 建宁县| 浮梁县| 仪征市| 黄骅市| 南木林县| 托里县| 新和县| 贡觉县| 衡阳市| 齐齐哈尔市| 潜山县| 镇原县| 忻城县| 盘山县| 三台县| 宝应县| 安康市| 扶沟县| 石柱|