毕业设计选题管理系统_第1页
毕业设计选题管理系统_第2页
毕业设计选题管理系统_第3页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1. 前言每年毕业临近,都有大量的毕业生需要进行毕业设计,这其中的首要关节就是课题的选择,以往指导老 师都是采用人工手写方式给学生们提供相关的课题供学生选择,如果指导老师带领的学生比较多,或者是当 年毕业的学生比较多,这样就容易造成学生的课题选择很混乱,指导教师难于统计学生的课题选择情况等一 系列问题,基于这些传统问题,我们需要一个能够自动统计、实时分配课题的一个管理平台来帮助学生、指 导老师。此系统的开发,主要的目的是使老师能更好的管理课程设计,也能使学生能更好的把自己想要选的课程 正确无误的选出来。使处在选课时期的学生能有条不紊的进行。2. 系统的需求分析2.1 功能需求毕业设计选题管理系

2、统功能要求:1. 毕业设计题目维护和查询:毕业设计题目的添加、修改;按照项目类型、名称、编号等查询;毕业设计 选题查询、登记。2. 指导教师信息维护和查询:指导教师信息的添加、修改、删除,查询;3. 毕业生选题管理:学生选题登记;选题情况查询;4. 毕业生信息的维护和查询。 根据以上各功能模块需求将系统的功能细化为以下几点:(1)前台学生选题学生网上选题:学生登录管理系统进行选题(2)前台教师出题 教师网上出题:教师进入毕业选题出题。 教师管理出题:教师进入系统后对毕业设计题目进行修改和删除。 选题确认:学生选好题目后,教师可以确认该题由选择该题的学生做。(3)后台管理出题及选题情况 用户管理

3、模块:管理员可以对用户进行用户管理,对已存在的用户进行修改,查看等。 角色管理模块:管理员可以对用户的角色进行管理,可以给用户分配角色,对角色分配权限。2.2 开发环境需求操作系统: window7 或更高版本因为毕业设计课题管理系统针对的用户是学生和教师,学生和教师普遍使用 windows 操作系统,所以选 着 windows7 或更高版本的操作系统 web 服务器: apache-tomcat6apache-tomcat6 是开源的免费的 web 服务器,节省开发成本 数据库: MySQLMySQL 是一款免费的数据库,节省成本开发工具: myeclipse8.5myeclipse8.5

4、功能强大的 JavaEE 开发工具,该管理系统选用 JavaEE 开发。3. 系统设计3.1 基本设计概念和处理流程本系统采用结构化分析,设计顺序为自顶向下,层层逐步细化图13.2 软件功能设计图23.2 数据库设计3.2.1 E-R 图图3图4数据库表用户表 (user)字段类型备注useridVarchar ( 20) primary key用户 IDPwdvarchar(32)用户密码roleIdInt外键tnameVarchar(20)姓名sexVarchar(5)性别AgeInt年龄表1课题表 (task)字段类型备注taskIdInt primary key课题 IDtasknam

5、evarchar(20)课题名sflagint状态(是否被选)taskTextvarchar(50)课题内容表2选择课题 (chosetask)字段类型备注ctIdint primary key学生选课题 iduIdvarchar(10)外键taskIdInt课题 ID上传课题 (puttask)表3字段类型备注ptIdint primary key教师上传课题 iduIdvarchar(10)外键taskIdInt课题 ID表4角色表 (roleinfo)字段类型备注roleIdInt primary key角色 IDrolenamevarchar(10)角色名表5权限表 (rightinf

6、o)字段类型备注rightCodevarchar(20)primary key权限rightParentCodevarchar(30)父权限rightTypevarchar(20)rightTextvarchar(50)RightUrlvarchar(30)url 地址RightTipvarchar(50)表6角色权限表( roleright )rr idInt primary key主键rr roleidInt外键 role 表rr rightCodevarchar(20)外键 rightinfo 表表74. 典型功能模块的详细设计和实现过程用户模块登录功能代码:public String

7、doLogin()Userinfo uu= userService .checkUser( user );if (uu!= null )ServletActionContext.getRequest().getSession().setAttribute( USER uu);int roleId=uu.getRoleinfo().getRoleId();Roleinfo r= roleService .getRoleWithRights(roleId);String menuString=buildDTreeMenuString(r);ServletActionContext.getReque

8、st().getSession().setAttribute( MENU_STRING menuString);returnmainelsereturn input ;public Userinfo checkUser(Userinfo u) Userinfo uu= null ;String hql=from Userinfo where userid=? and pwd=?Object args = new Objectu.getUserid(),u.getPwd(); List list =commonDao .list(hql, args);if (list!= null & list

9、.size()0)uu = list.get(0);return uu;public List list(String hql, Object args) List list= this .getHibernateTemplate().find(hql,args); return list;查询信息功能代码:publicString toList()SPageBean spb =new SPageBean();HttpServletRequest request = ServletActionContext.getRequest();int offset = 0;if (request.get

10、Parameter( offset = 0; else offset = I maxPageItems; maxPageItems = 5;pager.offset) = null ) parseInt (request.getParameter(if (request.getAttribute(pager.offsetmaxPageItems ) =);null ) maxPageItems ); else maxPageItems = Integer. parseInt (request.getParameter( spb.setOffset(offset);spb.s

11、etPageSize(maxPageItems); infoService.getList(spb);request.setAttribute( SPB , spb); return list ;public void getList(SPageBean spb) String hql= from Userinfo commonDao .listByPage(hql, spb); publicvoidlistByPage(String hql, SPageBean spb) String hql1=hql;SPageBean spb1=spb;if (hql!= null )finalfina

12、lint total=(Integer)HibernateCallback() public Object doInHibernate(SessionSQLException String qString=this .getHibernateTemplate().execute(sess)throwsif (hql1.toLowerCase().indexOf(int idx=hql1.toLowerCase().indexOf( qString= select count(*) +hql1.substring(idx,hql1.length();else qString= select co

13、unt(*) Query cQuery=sess.createQuery(qString); cQuery.setCacheable( true ); long o= (Long)cQuery.uniqueResult(); int ii=( returnselect +hql1;newHibernateException,); spb.setTotal(total); List data=(List)HibernateCallback() publicii;)!=-1)from);int )o;this .getHibernateTemplate().execute(doInHibernat

14、e(SessionObjectSQLException Query query= sess.createQuery(hql1); query.setFirstResult(spb1.getOffset(); query.setMaxResults(spb1.getPageSize(); return query.list();sess)throwsnewHibernateException,);spb.setDatas(data);public class SPageBean privateintoffsetprivateintpageSizeprivateinttotal ;privateL

15、istdataspublic int getTotal() return total ;public void setTotal( int total) this . total = total; public List getDatas() return datas ;public void setDatas(List datas) this . datas = datas; public int getOffset() return offset ;public void setOffset( int offset) this . offset = offset; public int g

16、etPageSize() return pageSize ;public void setPageSize( int pageSize) this . pageSize = pageSize; 上传课题功能代码:public String toadd()return add ;public String doadd() if ( taskService .doAdd( task )= true )SPageBean spb = new SPageBean();HttpServletRequest request = ServletActionContext.getRequest(); int

17、offset = 0;if(request.getParameter(pager.offset ) = null) offset = 0;else intoffset = Integer.parseInt (request.getParameter(pager.offset);maxPageItems;if (request.getAttribute(maxPageItems) =null ) else maxPageItems =);SPB1 , spb);Integer. parseInt (request.getParameter( maxPageItems spb.setOffset(

18、offset);spb.setPageSize(maxPageItems);taskService .getTaskinfo(spb);ServletActionContext.getRequest().setAttribute( return list ;elsereturn add ;public boolean doAdd(TaskInfo t) Serializable ret = commonDao .add(t);return ret!= null ;管理员模块管理员对角色管理功能:public class RoleAction private IRoleService priva

19、te IRightService extends ActionSupport roleService ;rightService ;private Roleinfo rolepublic void setRoleService(IRoleService roleService) this . roleService = roleService;public void setRightService(IRightService rightService) this . rightService = rightService;public Roleinfo getRole() return rol

20、epublic void setRole(Roleinfo role) this . role = role;public String toList()ROLES , roles);List roles= roleService .getList(); ServletActionContext.getRequest().setAttribute( return list ;public String toAssign() List rights=Roleinfo r = roleServicerightService .getAllRights();.getRoleWithRights(ro

21、le .getRoleId();for(Rightinfo right:rights)if (r.getRights().contains(right)right.setChecked(checked );ServletActionContext.getRequest().setAttribute(ServletActionContext.getRequest().setAttribute(ROLE , r); RIGHTS ,rights);return assignthrows Exceptionpublic String doAssign()HttpServletRequest requ

22、est=ServletActionContext.getRequest();String newRights=request.getParameterValues( roleService .updateRoleRights( role .getRoleId(),newRights); HttpServletResponse response=ServletActionContext.getResponse();CheckBox_Rights);response.sendRedirect( &message=ok returnrole!toAssign.action?role.roldId=+

23、role .getRoleId()+);null publicclassimplements IRightServiceprivatepublicthisRightServiceImpl_HICommonDAO commonDao ;void setCommonDao(ICommonDAO commonDao) . commonDao = commonDao; publicString hql=List list =List getAllRights() from Rightinfo ;commonDao .list(hql);return list;管理员对用户管理功能:增、删、改、查)pu

24、blicString delete()int uid =Integer.parseIntboolean(ServletActionContext.getRequest().getParameter( flag =userService .delete(uid);userid );if (flag)return list1 ; elsereturn list ;/ 编辑用户public String toedit()intuserid );uid=Integer. parseInt (ServletActionContext.getRequest().getParameter(Userinfo

25、uu = userService .detail(uid); ServletActionContext.getRequest().setAttribute( USER2 , uu); return edit ;public String edit()boolean flag = userService .update( user );if (flag)return list ; elsereturn edit_error ;public String detail()intuserid );uid=Integer. parseInt (ServletActionContext.getReque

26、st().getParameter(Userinfo uu = userService .detail(uid); ServletActionContext.getRequest().setAttribute( USER1 , uu); return detail ;public String add()if ( userService .addUser( user )= true ) List user =userService .list();USERS , user);ServletActionContext.getRequest().setAttribute(returnlistels

27、ereturn add ;public String toadd()return add ;public String doLogin()Userinfo uu= userService .checkUser( user );if (uu!= null )ServletActionContext.getRequest().getSession().setAttribute( USER uu);int roleId=uu.getRoleinfo().getRoleId();Roleinfo r= roleService .getRoleWithRights(roleId);MENU_STRING

28、String menuString=buildDTreeMenuString(r);ServletActionContext.getRequest().getSession().setAttribute( menuString);return main ;elsereturn input ;public boolean addUser(Userinfo u) Serializable ret = commonDao .add(u); return ret!= null ;public List list() String hql = from Userinfo ;List list =commonDao .list(hql);return list;public Userinfo detail(Userinfo uu= nullString hql= fromint userid) Userinfo u left outer joinfetchu.rolewhere u.userid=

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论