基于javaweb+mysql的ssm考试在线报名管理系统(java+ssm+js+jsp+mysql)

基于javaweb+mysql的ssm考试在线报名管理系统(java+ssm+js+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

基于javaweb+mysql的SSM考试在线报名管理系统(java+ssm+js+jsp+mysql)

项目介绍

考务管理员角色包含以下功能: 考务管理员登录,教务办公室管理,考场管理,考试管理,考场分配管理,报名管理等功能。

管理员角色包含以下功能: 管理员登录,学院管理,班级管理,学生管理,考务管理员管理,管理员管理等功能。

学生角色包含以下功能: 学生登录,查看我的报名,报名考试,密码修改,缴费等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
				sDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
				nowTimeStr = sDateFormat.format(new Date());
				//fileName = fileupload.getOriginalFilename();
				// 获取文件的后缀  
				extName = getExt(fileupload.getOriginalFilename());

				newFileName = nowTimeStr + rannum + extName;
				filePath = savePath + newFileName;
				fileupload.transferTo(new File(filePath));
				return newFileName;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 下载文件
	 * 
	 * @param request
	 * @param response
	 * @param storeName
	 * @param contentType
	 * @param realName
	 * @throws Exception
	 */
	public static void download(HttpServletRequest request, HttpServletResponse response, String storeName, String contentType,
			String realName) throws Exception {
		request.setCharacterEncoding("UTF-8");
		BufferedInputStream bis = null;
		BufferedOutputStream bos = null;
		try {
			String downLoadPath = storeName;

			long fileLength = new File(downLoadPath).length();

			response.setContentType(contentType);
			response.setHeader("Content-disposition", "attachment; filename=" + new String(realName.getBytes("utf-8"), "ISO8859-1"));
			response.setHeader("Content-Length", String.valueOf(fileLength));

			bis = new BufferedInputStream(new FileInputStream(downLoadPath));
			bos = new BufferedOutputStream(response.getOutputStream());
			byte[] buff = new byte[2048];
			int bytesRead;
			while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
				bos.write(buff, 0, bytesRead);

	}

	/**
	 * @MethodName : fillSheet
	 * @Description : 向工作表中填充数据
	 * @param sheet
	 *            工作表
	 * @param list
	 *            数据源
	 * @param fieldMap
	 *            中英文字段对应关系的Map
	 * @param firstIndex
	 *            开始索引
	 * @param lastIndex
	 *            结束索引
	 */
	private static <T> void fillSheet(WritableSheet sheet, List<T> list, LinkedHashMap<String, String> fieldMap, int firstIndex, int lastIndex)
			throws Exception {

		// 定义存放英文字段名和中文字段名的数组
		String[] enFields = new String[fieldMap.size()];
		String[] cnFields = new String[fieldMap.size()];

		// 填充数组
		int count = 0;
		for (Entry<String, String> entry : fieldMap.entrySet()) {
			enFields[count] = entry.getKey();
			cnFields[count] = entry.getValue();
			count++;
		}
		// 填充表头
		for (int i = 0; i < cnFields.length; i++) {
			Label label = new Label(i, 0, cnFields[i]);
			sheet.addCell(label);
		}

		// 填充内容
		int rowNo = 1;
		for (int index = firstIndex; index <= lastIndex; index++) {
			// 获取单个对象
			T item = list.get(index);
			for (int i = 0; i < enFields.length; i++) {
				Object objValue = getFieldValueByNameSequence(enFields[i], item);
				String fieldValue = objValue == null ? "" : objValue.toString();
				Label label = new Label(i, rowNo, fieldValue);
				sheet.addCell(label);
	@RequestMapping(value = "/deleteSysUser.do")
	public String delete(String ids) {
		try {
			service.deleteSysUser(ids);
			MessageUtil.addRelMessage(request, "删除信息成功.", "mainquery");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "删除信息失败.");
			return ERROR;
		}
	}

	@RequestMapping(value = "/addSysUser.do")
	public String add(SysUser bean) {
		try {
			service.addSysUser(bean);
			MessageUtil.addMessage(request, "添加成功.");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "添加失败.");
			return ERROR;
		}

	}

	@RequestMapping(value = "/updateSysUser.do")
	public String update(SysUser bean) {
		try {
			service.updateSysUser(bean);
			MessageUtil.addMessage(request, "更新成功.");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "更新失败.");
			return ERROR;
		}
	}

	@RequestMapping(value = "/querySysUser.do")
	public String query() {
		try {

@Controller
@RequestMapping("/sys")
public class DeptAction extends BaseAction {
	private String		actionname	= "学部";
	private String				actionclass	= "Dept";
	@Autowired
	private DeptService	service;

	@RequestMapping(value = "/add2Dept.do")
	public String add2() {
		request.setAttribute("actionname", actionname);
		request.setAttribute("actionclass", actionclass);
		return "addDept";
	}

	@RequestMapping(value = "/getDept.do")
	public String get(int uid) {
		try {
			Dept bean = service.get(uid);
			request.setAttribute("modifybean", bean);

			request.setAttribute("actionname", actionname);
			request.setAttribute("actionclass", actionclass);
			return "modifyDept";
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "获取信息失败.");
			session.setAttribute(Constant.SESSION_PAGE, page);

			request.setAttribute("actionname", actionname);
			request.setAttribute("actionclass", actionclass);
			return "listSimpleUser";
		} catch (Exception e) {
			e.printStackTrace();
			return ERROR;
		}
	}

}

public class MessageUtil {
	private static final String messageKey = "ActionMessage";
	private static final String confirmMsg = "confirmMsg";
	private static final String forwardUrlKey = "ForwardUrlKey";
	private static final String callbackType = "callbackType";
	private static final String navTabId = "navTabId";// rel="dlg_page"

	public static void addCloseMessage(Map<String, Object> scope, String message) {
		scope.put(messageKey, message);
		scope.put(callbackType, "closeCurrent");
	}
	/**
	 * 关闭当前标签,刷新指定标签
	 * @param scope
	 * @param message 消息提示
	 * @param rel 刷新的标签ID
	 */
	public static void addCloseMessage(Map<String, Object> scope, String message,String rel) {
		scope.put(messageKey, message);
		scope.put(callbackType, "closeCurrent");
		scope.put(navTabId, rel);
	}

	public static void addMessage(Map<String, Object> scope, String message) {
		scope.put(messageKey, message);
	}

	public static void addMessage(Map<String, Object> scope, String message,
			String rel) {
		scope.put(messageKey, message);
		if (StringUtil.isEmpty(rel)) {
			scope.put(navTabId, "navTab");
		} else {
			scope.put(navTabId, rel);
		return str;
	}

}

public class FieldUtil {

	/**
	 * 把fieldValue转换为c类中fieldName属性对应的类型
	 * 
	 * @param c
	 * @param fieldName
	 * @param fieldValue
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("rawtypes")
	public static Object format(Class c, String fieldName, String fieldValue) throws Exception {
		Field f = null;
		if (fieldName.contains(".")) {
			String[] ary = fieldName.split("\\.");
			Class tempclass = c;
			for (int i = 0; i < ary.length - 1; i++) {
				f = tempclass.getDeclaredField(ary[i]);
				tempclass = f.getType();
			}
			f = tempclass.getDeclaredField(ary[ary.length - 1]);
		} else {
			f = c.getDeclaredField(fieldName);
		}

		String type = f.getType().getSimpleName();
		if (type.equals("int") || type.equals("Integer")) {
			return Integer.valueOf(fieldValue);
		} else if (type.equals("long") || type.equals("Long")) {
			return Long.valueOf(fieldValue);
		} else if (type.equals("float") || type.equals("Float")) {
			return Float.valueOf(fieldValue);
			e.printStackTrace();
		}
	}

	/**
	 * @MethodName : listToExcel
	 * @Description : 导出Excel(可以导出到本地文件系统,也可以导出到浏览器,可自定义工作表大小)
	 * @param list
	 *            数据源
	 * @param fieldMap
	 *            类的英文属性和Excel中的中文列名的对应关系 如果需要的是引用对象的属性,则英文属性使用类似于EL表达式的格式 如:list中存放的都是student,student中又有college属性,而我们需要学院名称,则可以这样写 fieldMap.put("college.collegeName","学院名称")
	 * @param sheetName
	 *            工作表的名称
	 * @param sheetSize
	 *            每个工作表中记录的最大个数
	 * @param out
	 *            导出流
	 * @throws ExcelException
	 */
	public static <T> void listToExcel(List<T> list, LinkedHashMap<String, String> fieldMap, String sheetName, int sheetSize, OutputStream out)
			throws ExcelException {

		if (list.size() == 0 || list == null) {
			throw new ExcelException("数据源中没有任何数据");
		}

		if (sheetSize > 65535 || sheetSize < 1) {
			sheetSize = 65535;
		}

		// 创建工作簿并发送到OutputStream指定的地方
		WritableWorkbook wwb;
		try {
			wwb = Workbook.createWorkbook(out);

			// 因为2003的Excel一个工作表最多可以有65536条记录,除去列头剩下65535条
			// 所以如果记录太多,需要放到多个工作表中,其实就是个分页的过程
			// 1.计算一共有多少个工作表
			double sheetNum = Math.ceil(list.size() / new Integer(sheetSize).doubleValue());

			// 2.创建相应的工作表,并向其中填充数据
			for (int i = 0; i < sheetNum; i++) {
				// 如果只有一个工作表的情况
				if (1 == sheetNum) {
					WritableSheet sheet = wwb.createSheet(sheetName, i);
					fillSheet(sheet, list, fieldMap, 0, list.size() - 1);

					// 有多个工作表的情况
				} else {
					WritableSheet sheet = wwb.createSheet(sheetName + (i + 1), i);

					// 获取开始索引和结束索引
					int firstIndex = i * sheetSize;
					int lastIndex = (i + 1) * sheetSize - 1 > list.size() - 1 ? list.size() - 1 : (i + 1) * sheetSize - 1;
	public String add2() {
		request.setAttribute("actionname", actionname);
		request.setAttribute("actionclass", actionclass);
		return "addClazz";
	}

	@RequestMapping(value = "/getClazz.do")
	public String get(int uid) {
		try {
			Clazz bean = service.get(uid);
			request.setAttribute("modifybean", bean);

			request.setAttribute("actionname", actionname);
			request.setAttribute("actionclass", actionclass);
			return "modifyClazz";
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "获取信息失败.");
			return ERROR;
		}
	}

	@RequestMapping(value = "/deleteClazz.do")
	public String delete(String ids) {
		try {
			service.deleteAll(ids);
			MessageUtil.addRelMessage(request, "操作成功.", "mainquery");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "操作失败.");
			return ERROR;
		}
	}

	@RequestMapping(value = "/addClazz.do")
	public String add(Clazz bean) {
		try {
			service.add(bean);
			MessageUtil.addMessage(request, "添加成功.");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "添加失败.");
			return ERROR;
		}

	}

	@RequestMapping(value = "/updateClazz.do")
	public String update(Clazz bean) {
	public String login(String username, String password, String loginType, String checkcode) throws Exception {
		log.info(username + " " + password + " " + loginType);
		String errorMessage = "登录失败,请稍候重试";
		try {
			String code = (String) session.getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY);
			if (code == null) {
				request.getSession(false).invalidate();
				return "redirect:/index.jsp";
			} else {
			}
			checkcode = StringUtil.stringVerification(checkcode);
			do {
				if (!code.toLowerCase().equals(checkcode.toLowerCase())) {
					errorMessage = "验证码错误";
					break;
				}
				username = StringUtil.stringVerification(username).toLowerCase();
				MD5 md = new MD5();
				password = md.getMD5ofStr(password);
				Object bean = sysUserService.login(username, password, loginType);
				if (bean == null) {
					errorMessage = "账号或者密码错误";
					break;
				}

				SessionBean sb = new SessionBean();
				sb.setUser(bean);
				session.setAttribute(Constant.SESSION_BEAN, sb);

				if (loginType.equals(SysUser.class.getSimpleName())) {
					return "main";
				}
				if (loginType.equals(SimpleUser.class.getSimpleName())) {
					SimpleUser temp = (SimpleUser) bean;
					if (temp.getType().equals("未激活")) {
						errorMessage = "账号未激活, 请登陆邮箱激活账号: " + temp.getUserEmail();
						SpringMail sm = new SpringMail();
						Mail m = new Mail();
						m.setTitle("账号激活");
						String content = "请点击下面的链接激活账号<br/><br/>";
						String href = "http://localhost:8080/xs/com/activeAccount.do?uid=" + temp.getId();
						content += "<a href=\"" + href + "\">" + "点击激活" + "<a>";
						m.setContext(content);
	@RequestMapping(value = "/add2Teacher.do")
	public String add2() {
		request.setAttribute("actionname", actionname);
		request.setAttribute("actionclass", actionclass);
		return "addTeacher";
	}

	@RequestMapping(value = "/getTeacher.do")
	public String get(int uid) {
		try {
			Teacher bean = service.get(uid);
			request.setAttribute("modifybean", bean);

			request.setAttribute("actionname", actionname);
			request.setAttribute("actionclass", actionclass);
			return "modifyTeacher";
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "获取信息失败.");
			return ERROR;
		}
	}

	@RequestMapping(value = "/deleteTeacher.do")
	public String delete(String ids) {
		try {
			service.deleteTeacher(ids);
			MessageUtil.addRelMessage(request, "删除信息成功.", "mainquery");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "删除信息失败.");
			return ERROR;
		}
	}

	@RequestMapping(value = "/addTeacher.do")
	public String add(Teacher bean) {
		try {
			service.addTeacher(bean);
			MessageUtil.addMessage(request, "添加成功.");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			MessageUtil.addMessage(request, "添加失败.");
			return ERROR;
	}

	@RequestMapping(value = "/update2Password.do")
	public String toSelf() {
		return "msg/changepassword";
	}

	@RequestMapping(value = "/updateSysUserPassword.do")
	public String updateSysUserPassword(String oldpassword, String password) {
		SysUser user = getSysUser();
		user = sysUserService.get(user.getId());
		MD5 md = new MD5();
		oldpassword = md.getMD5ofStr(oldpassword);

		if (!user.getUserPassword().equals(oldpassword)) {
			MessageUtil.addMessage(request, "旧密码错误.");
			return ERROR;
		}

		password = md.getMD5ofStr(password);
		user.setUserPassword(password);

		sysUserService.updateAll(user);

		MessageUtil.addMessage(request, "修改成功.");
		return SUCCESS;
	}

	@RequestMapping(value = "/updateSimpleUserPassword.do")
	public String updateSimpleUserPassword(String oldpassword, String password) {
		SimpleUser user = getSimpleUser();
		user = simpleUserService.get(user.getId());
		MD5 md = new MD5();
		oldpassword = md.getMD5ofStr(oldpassword);

		if (!user.getUserPassword().equals(oldpassword)) {
			MessageUtil.addMessage(request, "旧密码错误.");
			return ERROR;
		}

		password = md.getMD5ofStr(password);
		user.setUserPassword(password);

		simpleUserService.updateAll(user);

		MessageUtil.addMessage(request, "修改成功.");
		return SUCCESS;
			fieldMap.put("出生地", "born");
			fieldMap.put("家庭地址", "homeAddress");
			fieldMap.put("备注", "note");
			//			List<Student> list = 	ExcelUtil.excelToList(in, sheetName, Student.class, fieldMap,
			//					new String[] { "学生编号" });
			//			for(Student s: list)
			//			{
			//				System.out.println(s);
			//			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * @MethodName : listToExcel
	 * @Description : 导出Excel(可以导出到本地文件系统,也可以导出到浏览器,可自定义工作表大小)
	 * @param list
	 *            数据源
	 * @param fieldMap
	 *            类的英文属性和Excel中的中文列名的对应关系 如果需要的是引用对象的属性,则英文属性使用类似于EL表达式的格式 如:list中存放的都是student,student中又有college属性,而我们需要学院名称,则可以这样写 fieldMap.put("college.collegeName","学院名称")
	 * @param sheetName
	 *            工作表的名称
	 * @param sheetSize
	 *            每个工作表中记录的最大个数
	 * @param out
	 *            导出流
	 * @throws ExcelException
	 */
	public static <T> void listToExcel(List<T> list, LinkedHashMap<String, String> fieldMap, String sheetName, int sheetSize, OutputStream out)
			throws ExcelException {

		if (list.size() == 0 || list == null) {
			throw new ExcelException("数据源中没有任何数据");
		}

		if (sheetSize > 65535 || sheetSize < 1) {
			sheetSize = 65535;
		}

		// 创建工作簿并发送到OutputStream指定的地方
		WritableWorkbook wwb;
		try {
			wwb = Workbook.createWorkbook(out);

			// 因为2003的Excel一个工作表最多可以有65536条记录,除去列头剩下65535条
			// 所以如果记录太多,需要放到多个工作表中,其实就是个分页的过程
			// 1.计算一共有多少个工作表
			double sheetNum = Math.ceil(list.size() / new Integer(sheetSize).doubleValue());

			// 2.创建相应的工作表,并向其中填充数据
			for (int i = 0; i < sheetNum; i++) {
				// 如果只有一个工作表的情况
				if (!pathdir.exists()) {
					pathdir.mkdirs();
				}
				Random r = new Random();

				int rannum = (int) (r.nextDouble() * (99999 - 10000 + 1)) + 10000;
				sDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
				nowTimeStr = sDateFormat.format(new Date());
				//fileName = fileupload.getOriginalFilename();
				// 获取文件的后缀  
				extName = getExt(fileupload.getOriginalFilename());

				newFileName = nowTimeStr + rannum + extName;
				filePath = savePath + newFileName;
				fileupload.transferTo(new File(filePath));
				return newFileName;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public static String uploadFile(MultipartFile fileupload, long sizeLimit, String serverPath) {
		String filePath = null;
		String newFileName = null;
		try {
			if (fileupload != null && fileupload.getSize() > 0) {//存在文件上传

				String extName = "";
				String nowTimeStr = "";
				SimpleDateFormat sDateFormat;

				String savePath = "resource";
				savePath = serverPath + File.separator + savePath + File.separator;
				File pathdir = new File(savePath);
				if (!pathdir.exists()) {
					pathdir.mkdirs();
				}
				Random r = new Random();

				int rannum = (int) (r.nextDouble() * (99999 - 10000 + 1)) + 10000;
				sDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
					return "main";
				}

			} while (false);

		} catch (Exception e) {
			e.printStackTrace();
		}
		session.setAttribute("signErrorMessage", errorMessage);
		return "redirect:/index.jsp";
	}

	@RequestMapping(value = "/reg.do")
	public String add(SimpleUser bean) {
		try {
			SimpleUser temp = simpleUserService.findByUname(bean.getUname());
			if (temp != null) {
				putSessionValue("signErrorMessage", "很遗憾,账号已经被使用.");
			} else {
				bean.setUserGender("男");
				simpleUserService.addSimpleUser(bean);
				putSessionValue("signErrorMessage", "恭喜您! 注册成功.");
			}
		} catch (Exception e) {
			e.printStackTrace();
			putSessionValue("signErrorMessage", "很遗憾,注册失败.");
		}

		return "redirect:/reg.jsp";

	}

	@RequestMapping(value = "/activeAccount.do")
	public String activeAccount(int uid) {
		try {
			SimpleUser temp = simpleUserService.get(uid);
			simpleUserService.updateActivity(temp);
			session.setAttribute("signErrorMessage", "账号激活成功");
		} catch (Exception e) {
			e.printStackTrace();
			session.setAttribute("signErrorMessage", "账号激活失败");
		}
		return "redirect:/index.jsp";

		if (index > 0) {
			return name.substring(index);
		}
		return "";
	}

	public static String uploadFile(HttpServletRequest request, String pname) {
		MultipartHttpServletRequest mrequest = (MultipartHttpServletRequest) request;
		MultipartFile fileupload = mrequest.getFile(pname);
		String newFileName = null;
		try {
			if (fileupload != null && fileupload.getSize() > 0) {//存在文件上传

				String extName = "";
				String nowTimeStr = "";
				SimpleDateFormat sDateFormat;
				String savePath = request.getSession().getServletContext().getRealPath("/resource") + File.separator;
				File pathdir = new File(savePath);
				if (!pathdir.exists()) {
					pathdir.mkdirs();
				}
				Random r = new Random();

				int rannum = (int) (r.nextDouble() * (99999 - 10000 + 1)) + 10000;
				sDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
				nowTimeStr = sDateFormat.format(new Date());
				//fileName = fileupload.getOriginalFilename();
				// 获取文件的后缀  
				extName = getExt(fileupload.getOriginalFilename());

				newFileName = nowTimeStr + rannum + extName;
				fileupload.transferTo(new File(savePath, newFileName));
				return newFileName;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public static String uploadFile(HttpServletRequest request, String pname, String savePath) {
		MultipartHttpServletRequest mrequest = (MultipartHttpServletRequest) request;
		MultipartFile fileupload = mrequest.getFile(pname);
		String filePath = null;
		String newFileName = null;
		try {
			if (fileupload != null && fileupload.getSize() > 0) {//存在文件上传

				String extName = "";
				String nowTimeStr = "";
				SimpleDateFormat sDateFormat;
		if (StringUtil.isEmpty(rel)) {
			scope.put(navTabId, "navTab");
		} else {
			scope.put(navTabId, rel);
		}
	}
}

@Controller
@RequestMapping("/sys")
public class ExamRoomAction extends BaseAction {
	private String			actionname	= "考场分配";
	private String			actionclass	= "ExamRoom";
	@Autowired
	private ExamRoomService	service;

	@Autowired
	private ExamService		examService;

	@Autowired
	private RoomService		roomService;

	@RequestMapping(value = "/add2ExamRoom.do")
	public String add2() {
		putRequestValue("list1", examService.selectAll());
		putRequestValue("list2", roomService.selectAll());
		request.setAttribute("actionname", actionname);
		request.setAttribute("actionclass", actionclass);
		return "addExamRoom";
	}

	@RequestMapping(value = "/getExamRoom.do")
	public String get(int uid) {
		try {

@Controller
@RequestMapping("/com")
public class LoginAction extends BaseAction {
	@Autowired
	private SysUserService		sysUserService;

	@Autowired
	private SimpleUserService	simpleUserService;
	@Autowired
	private TeacherService		teacherService;

	@RequestMapping(value = "/menu.do")
	@ResponseBody
	public Object menu() {

		int index = 0;

		List<MenuBean> list = new ArrayList<MenuBean>();
		if (getSessionUser() instanceof SysUser) {
			MenuBean m1 = new MenuBean("系统管理");
			m1.addChild(new SubMenu("navtab" + (index++), "学部管理", "navtab", request.getContextPath() + "/sys/queryDept.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "班级管理", "navtab", request.getContextPath() + "/sys/queryClazz.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "学生管理", "navtab", request.getContextPath() + "/sys/querySimpleUser.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "考务管理员管理", "navtab", request.getContextPath() + "/sys/queryTeacher.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "管理员管理", "navtab", request.getContextPath() + "/sys/querySysUser.do"));

			list.add(m1);
		}
		if (getSessionUser() instanceof Teacher) {
			MenuBean m1 = new MenuBean("系统管理");
			m1.addChild(new SubMenu("navtab" + (index++), "教务办公室管理", "navtab", request.getContextPath() + "/sys/queryOffice.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "考场管理", "navtab", request.getContextPath() + "/sys/queryRoom.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "考试管理", "navtab", request.getContextPath() + "/sys/queryExam.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "考场分配管理", "navtab", request.getContextPath() + "/sys/queryExamRoom.do"));
			m1.addChild(new SubMenu("navtab" + (index++), "报名管理", "navtab", request.getContextPath() + "/sys/queryExamStudentAll.do"));

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值