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

下载本文档

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

文档简介

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

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

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

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

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

6、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 doLogin() Userinfo uu= userService.check

7、User(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.getRequest().getSession().setAttribu

8、te("MENU_STRING", menuString); return "main" else return "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<Userinfo> list = commonDao.li

9、st(hql, args);if(list!=null && list.size()>0)uu = list.get(0);return uu;public List list(String hql, Object args) List list= this.getHibernateTemplate().find(hql,args);return list;查询信息功能代码:public String toList()SPageBean spb = new SPageBean();HttpServletRequest request = ServletActionCont

10、ext.getRequest();int offset = 0;if (request.getParameter("pager.offset") = null) offset = 0; else offset = Integer.parseInt(request.getParameter("pager.offset");int maxPageItems;if (request.getAttribute("maxPageItems") = null) maxPageItems = 5; else maxPageItems = Integ

11、er.parseInt(request.getParameter("maxPageItems");spb.setOffset(offset);spb.setPageSize(maxPageItems);infoService.getList(spb);request.setAttribute("SPB", spb);return "list"public void getList(SPageBean spb) String hql="from Userinfo"commonDao.listByPage(hql, s

12、pb);public void listByPage(String hql, SPageBean spb) final String hql1=hql;final SPageBean spb1=spb;if(hql!=null)int total=(Integer) this.getHibernateTemplate().execute(new HibernateCallback() public Object doInHibernate(Session sess) throws HibernateException,SQLException String qString="&quo

13、t;if(hql1.toLowerCase().indexOf("select ")!=-1)int idx=hql1.toLowerCase().indexOf("from");qString="select count(*) "+hql1.substring(idx,hql1.length();elseqString="select count(*) "+hql1;Query cQuery=sess.createQuery(qString);cQuery.setCacheable(true);long o= (

14、Long)cQuery.uniqueResult();int ii=(int)o;return ii;);spb.setTotal(total);List data=(List)this.getHibernateTemplate().execute(new HibernateCallback() public Object doInHibernate(Session sess) throws HibernateException,SQLException Query query= sess.createQuery(hql1);query.setFirstResult(spb1.getOffse

15、t();query.setMaxResults(spb1.getPageSize();return query.list(););spb.setDatas(data);public class SPageBean private int offset;private int pageSize;private int total;private List datas;public int getTotal() return total;public void setTotal(int total) this.total = total;public List getDatas() return

16、datas;public void setDatas(List datas) this.datas = datas;public int getOffset() return offset;public void setOffset(int offset) this.offset = offset;public int getPageSize() return pageSize;public void setPageSize(int pageSize) this.pageSize = pageSize;上传课题功能代码:public String toadd()return "add

17、"public String doadd()if(taskService.doAdd(task)= true)SPageBean spb = new SPageBean();HttpServletRequest request = ServletActionContext.getRequest();int offset = 0;if (request.getParameter("pager.offset") = null) offset = 0; else offset = Integer.parseInt(request.getParameter("p

18、ager.offset");int maxPageItems;if (request.getAttribute("maxPageItems") = null) maxPageItems = 5; else maxPageItems = Integer.parseInt(request.getParameter("maxPageItems");spb.setOffset(offset);spb.setPageSize(maxPageItems);taskService.getTaskinfo(spb);ServletActionContext.g

19、etRequest().setAttribute("SPB1", spb);return "list"elsereturn "add"public boolean doAdd(TaskInfo t) Serializable ret = commonDao.add(t);return ret!=null;管理员模块管理员对角色管理功能:public class RoleAction extends ActionSupportprivate IRoleService roleService;private IRightService r

20、ightService;private Roleinfo role;public void setRoleService(IRoleService roleService) this.roleService = roleService;public void setRightService(IRightService rightService) this.rightService = rightService;public Roleinfo getRole() return role;public void setRole(Roleinfo role) this.role = role;pub

21、lic String toList()List<Roleinfo> roles= roleService.getList();ServletActionContext.getRequest().setAttribute("ROLES", roles);return "list"public String toAssign()List<Rightinfo> rights= rightService.getAllRights();Roleinfo r = roleService.getRoleWithRights(role.getRo

22、leId();for(Rightinfo right:rights)if(r.getRights().contains(right)right.setChecked("checked");ServletActionContext.getRequest().setAttribute("ROLE", r);ServletActionContext.getRequest().setAttribute("RIGHTS",rights);return "assign"public String doAssign() thro

23、ws ExceptionHttpServletRequest request=ServletActionContext.getRequest();String newRights=request.getParameterValues("CheckBox_Rights");roleService.updateRoleRights(role.getRoleId(),newRights);HttpServletResponse response=ServletActionContext.getResponse();response.sendRedirect("role!

24、toAssign.action?role.roldId="+role.getRoleId()+"&message=ok");return null;public class RightServiceImpl_H implements IRightServiceprivate ICommonDAO commonDao;public void setCommonDao(ICommonDAO commonDao) monDao = commonDao;public List<Rightinfo> getAllRights() String hql=&

25、quot;from Rightinfo"List<Rightinfo> list = commonDao.list(hql);return list;管理员对用户管理功能:(增、删、改、查)public String delete()int uid = Integer.parseInt(ServletActionContext.getRequest().getParameter("userid");boolean flag = userService.delete(uid);if(flag)return "list1"elseret

26、urn "list"/编辑用户public String toedit()int uid=Integer.parseInt(ServletActionContext.getRequest().getParameter("userid");Userinfo uu = userService.detail(uid);ServletActionContext.getRequest().setAttribute("USER2", uu);return "edit"public String edit()boolean fl

27、ag = userService.update(user);if(flag)return "list"elsereturn "edit_error"public String detail()int uid=Integer.parseInt(ServletActionContext.getRequest().getParameter("userid");Userinfo uu = userService.detail(uid);ServletActionContext.getRequest().setAttribute("U

28、SER1", uu); return "detail" public String add()if(userService.addUser(user)= true)List<Userinfo> user = userService.list();ServletActionContext.getRequest().setAttribute("USERS", user);return "list"elsereturn "add"public String toadd()return "a

29、dd"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); String menuString=buildDTreeMenuString

30、(r); ServletActionContext.getRequest().getSession().setAttribute("MENU_STRING", menuString); return "main" else return "input" public boolean addUser(Userinfo u) Serializable ret = commonDao.add(u);return ret!=null;public List list() String hql = "from Userinfo"List<Userinfo> list = commonDao.list(hql);return list;public Userinfo detail(int userid) Userinfo uu=null;String hql="from Userinfo u left outer join

温馨提示

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

评论

0/150

提交评论