毕业设计选题管理系统Word文档格式.docx
- 文档编号:17688223
- 上传时间:2022-12-08
- 格式:DOCX
- 页数:21
- 大小:279.73KB
毕业设计选题管理系统Word文档格式.docx
《毕业设计选题管理系统Word文档格式.docx》由会员分享,可在线阅读,更多相关《毕业设计选题管理系统Word文档格式.docx(21页珍藏版)》请在冰豆网上搜索。
因为毕业设计课题管理系统针对的用户是学生和教师,学生和教师普遍使用windows操作系统,所以选着windows7或更高版本的操作系统
web服务器:
apache-tomcat6
apache-tomcat6是开源的免费的web服务器,节省开发成本
数据库:
MySQL
MySQL是一款免费的数据库,节省成本
开发工具:
myeclipse8.5
myeclipse8.5功能强大的JavaEE开发工具,该管理系统选用JavaEE开发。
3.系统设计
3.1基本设计概念和处理流程
本系统采用结构化分析,设计顺序为自顶向下,层层逐步细化。
图1
3.2软件功能设计
图2
3.2数据库设计
3.2.1E-R图
图3
图4
3.2.2数据库表
用户表(user)
字段
类型
备注
userid
Varchar(20)primarykey
用户ID
Pwd
varchar(32)
用户密码
roleId
Int
外键
tname
Varchar(20)
姓名
sex
Varchar(5)
性别
Age
年龄
表1
课题表(task)
taskId
Intprimarykey
课题ID
taskname
varchar(20)
课题名
sflag
int
状态(是否被选)
taskText
varchar(50)
课题内容
表2
选择课题(chosetask)
ctId
intprimarykey
学生选课题id
uId
varchar(10)
表3
上传课题(puttask)
ptId
教师上传课题id
表4
角色表(roleinfo)
角色ID
rolename
角色名
表5
权限表(rightinfo)
rightCode
varchar(20)primarykey
权限
rightParentCode
varchar(30)
父权限
rightType
rightText
RightUrl
varchar(30)
url地址
RightTip
表6
角色权限表(roleright)
rr_id
主键
rr_roleid
外键role表
rr_rightCode
外键rightinfo表
表7
4.典型功能模块的详细设计和实现过程
用户模块
登录功能代码:
publicStringdoLogin()
{
Userinfouu=userService.checkUser(user);
if(uu!
=null)
{
ServletActionContext.getRequest().getSession().setAttribute("
USER"
uu);
introleId=uu.getRoleinfo().getRoleId();
Roleinfor=roleService.getRoleWithRights(roleId);
StringmenuString=buildDTreeMenuString(r);
MENU_STRING"
menuString);
return"
main"
;
}
else
input"
}
publicUserinfocheckUser(Userinfou){
Userinfouu=null;
Stringhql="
fromUserinfowhereuserid=?
andpwd=?
"
Object[]args=newObject[]{u.getUserid(),u.getPwd()};
List<
Userinfo>
list=commonDao.list(hql,args);
if(list!
=null&
&
list.size()>
0)
uu=list.get(0);
returnuu;
publicListlist(Stringhql,Object[]args){
Listlist=this.getHibernateTemplate().find(hql,args);
returnlist;
查询信息功能代码:
publicStringtoList()
SPageBeanspb=newSPageBean();
HttpServletRequestrequest=ServletActionContext.getRequest();
intoffset=0;
if(request.getParameter("
pager.offset"
)==null){
offset=0;
}else{
offset=Integer.parseInt(request.getParameter("
));
intmaxPageItems;
if(request.getAttribute("
maxPageItems"
maxPageItems=5;
maxPageItems=Integer.parseInt(request.getParameter("
spb.setOffset(offset);
spb.setPageSize(maxPageItems);
infoService.getList(spb);
request.setAttribute("
SPB"
spb);
return"
list"
publicvoidgetList(SPageBeanspb){
fromUserinfo"
commonDao.listByPage(hql,spb);
publicvoidlistByPage(Stringhql,SPageBeanspb){
finalStringhql1=hql;
finalSPageBeanspb1=spb;
if(hql!
inttotal=(Integer)this.getHibernateTemplate().execute(newHibernateCallback(){
publicObjectdoInHibernate(Sessionsess)throwsHibernateException,
SQLException{
StringqString="
if(hql1.toLowerCase().indexOf("
select"
)!
=-1)
{
intidx=hql1.toLowerCase().indexOf("
from"
);
qString="
selectcount(*)"
+hql1.substring(idx,hql1.length());
}
else{
+hql1;
QuerycQuery=sess.createQuery(qString);
cQuery.setCacheable(true);
longo=(Long)cQuery.uniqueResult();
intii=(int)o;
returnii;
}
});
spb.setTotal(total);
Listdata=(List)this.getHibernateTemplate().execute(newHibernateCallback(){
Queryquery=sess.createQuery(hql1);
query.setFirstResult(spb1.getOffset());
query.setMaxResults(spb1.getPageSize());
returnquery.list();
spb.setDatas(data);
publicclassSPageBean{
privateintoffset;
privateintpageSize;
privateinttotal;
privateListdatas;
publicintgetTotal(){
returntotal;
publicvoidsetTotal(inttotal){
this.total=total;
publicListgetDatas(){
returndatas;
publicvoidsetDatas(Listdatas){
this.datas=datas;
publicintgetOffset(){
returnoffset;
publicvoidsetOffset(intoffset){
this.offset=offset;
publicintgetPageSize(){
returnpageSize;
publicvoidsetPageSize(intpageSize){
this.pageSize=pageSize;
}
上传课题功能代码:
publicStringtoadd()
add"
publicStringdoadd()
if(taskService.doAdd(task)==true)
SPageBeanspb=newSPageBean();
HttpServletRequestrequest=ServletActionContext.getRequest();
intoffset=0;
if(request.getParameter("
offset=0;
}else{
offset=Integer.parseInt(request.getParameter("
}
intmaxPageItems;
if(request.getAttribute("
maxPageItems=5;
maxPageItems=Integer.parseInt(request.getParameter("
spb.setOffset(offset);
spb.setPageSize(maxPageItems);
taskService.getTaskinfo(spb);
ServletActionContext.getRequest().setAttribute("
SPB1"
publicbooleandoAdd(TaskInfot){
Serializableret=commonDao.add(t);
returnret!
=null;
管理员模块
管理员对角色管理功能:
publicclassRoleActionextendsActionSupport{
privateIRoleServiceroleService;
privateIRightServicerightService;
privateRoleinforole;
publicvoidsetRoleService(IRoleServiceroleService){
this.roleService=roleService;
publicvoidsetRightService(IRightServicerightService){
this.rightService=rightService;
publicRoleinfogetRole(){
returnrole;
publicvoidsetRole(Roleinforole){
this.role=role;
publicStringtoList()
Roleinfo>
roles=roleService.getList();
ServletActionContext.getRequest().setAttribute("
ROLES"
roles);
publicStringtoAssign()
Rightinfo>
rights=rightService.getAllRights();
Roleinfor=roleService.getRoleWithRights(role.getRoleId());
for(Rightinforight:
rights)
if(r.getRights().contains(right))
{
right.setChecked("
checked"
ROLE"
r);
RIGHTS"
rights);
assign"
publicStringdoAssign()throwsException
HttpServletRequestrequest=ServletActionContext.getRequest();
String[]newRights=request.getParameterValues("
CheckBox_Rights"
roleService.updateRoleRights(role.getRoleId(),newRights);
HttpServletResponseresponse=ServletActionContext.getResponse();
response.sendRedirect("
role!
toAssign.action?
role.roldId="
+role.getRoleId()+"
message=ok"
returnnull;
publicclassRightServiceImpl_HimplementsIRightService{
privateICommonDAOcommonDao;
publicvoidsetCommonDao(ICommonDAOcommonDao){
monDao=commonDao;
publicList<
getAllRights(){
fromRightinfo"
list=commonDao.list(hql);
管理员对用户管理功能:
(增、删、改、查)
publicStringdelete()
intuid=Integer.parseInt(ServletActionContext.getRequest().getParameter("
userid"
booleanflag=userService.delete(uid);
if(flag)
list1"
//编辑用户
publicStringtoedit()
intuid=Integer.parseInt(ServletActionContext.getRequest().getParameter("
Userinfouu=userService.detail(uid);
USER2"
edit"
publicStringedit()
booleanflag=userService.update(user);
edit_error"
publicStringdetail()
USER1"
detail"
publicStringadd()
if(userService.addUser(user)==true)
List<
user=userService.list();
USERS"
user);
publicStringtoadd()
publicStringdoLogin()
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 毕业设计 选题 管理 系统