




已阅读5页,还剩29页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
枣 庄 学 院信息科学与工程学院课程设计任务书 题 目: 客户信息管理系统 姓 名: 桑得水 学 号: 201212140421 专业班级: 网络工程(物联网) 课 程: java web 指导教师: 李钢 职称: 讲 师 完成时间: 2014年 5 月-2014年 6月枣庄学院信息科学与工程学院制2014年6 月20日课程设计任务书及成绩评定课程设计的任务和具体要求课程设计要求设计一个用java web开发基于b/s架构的管理系统,页面至少6个以上,应能反应出学生综合利用java web知识和数据库知识完成一定的设计任务的能力,反映出学生理论联系实践的动手能力。具体要求如下:(1)明确所要开发系统的设计任务;(2)做好需求分析,合理选择设计方案;(3)页面静态部分可用dreamweaver开发实现(4)动态页面部分可用jsp、servlet、javabean等实现;(5)后台数据库可采用mysql、oracle、sql server等实现;(6)在编写程序过程中应注意相关文档的编写;(7)认真撰写课程设计总结报告。指导教师签字: _ 日期: 指导教师评语成绩:_ 指导教师签字: 日期: 课程设计所需软件、硬件等n 硬件环境: cpu,主频1ghz以上;内存512m以上; 硬盘30g以上;1024768显示分辨率n 软件环境: microsoft windows xp或以上版本 ; eclipse; jdk1.6; tomcat6.0; mysql课程设计进度计划起至日期工作内容备注参考文献、资料索引序号文献、资料名称编著者出版单位1 沈应逵. java web数据库系统应用开发与实例.北京:人民邮电出版社,2009目 录一、 前言1二、 课程设计内容与目标2三、 系统设计23.1 系统特点23.2 功能设计23.3 用户界面草图33.4 页面迁移图4 3.5 页面功能设计5四、 数据库设计64.1 数据库表64.2 数据库操作图7五、 功能模块的详细设计85.1 程序目录结构图85.2 数据库访问模块85.3 共通servlet的处理95.4 登录模块14 5.5 页面导航设计155.6 客户资料维护模块175.7 客户来电信息模块235.8 客户回访信息模块255.9 客户重要信息提示模块27六、 对本系统开发的思考总结29ii一课程设计目的课程设计是一项重要的实践性教学环节,在教师的指导下,以学生为中心,充分调动学生的积极性和能动性,重视学生自学能力的培养。java web 数据库系统应用开发与实例是为教育技术学本科专业开设的专业选修课程,课程的主要目标是要求学生掌握基本的web应用程序开发和设计的流程及相关的技术技能。本课程在讲解相关理论知识的基础上,按照一定的组织原则和现有实验条件安排了一定数量的实验,通过这些实验使学生初步掌握开发和设计web数据库系统的基本方法和基本技能。然而由于这些实验是分时分批按一定的技术种类和实验目的实施的,固然可以有目的地训练和培养学生某个方面技能,但明显的不连续性使学生不能从整体上把握如何系统地开发和设计一个完整web数据库系统应用程序。通过本课程设计可以较好地解决这个问题。通过本课程设计可以使学生充分认识开发和设计web应用程序的的重要性和复杂性,充分了解web应用程序的设计和开发的基本过程,掌握常用的web开发技术,充分把握各项技术的特点和应用领域以及各项技术之间的相互关系,进一步体会各项技术在web应用程序中地位和作用从而对各种技术有比较清醒的认识,在此基础上习得web开发技术平台的选择能力。二课程设计内容与目标课题名称:客户信息管理系统 设计目标:本系统模拟企业对于客户信息的管理,操作人员可以添加、修改客户信息,针对客户来电进行记录,并对客户的重要信息进行提醒,等等。设计方法:jsp、mysql动态网页制作工具配合相关技术(如html、css、javascript、xml等)设计要求:利用web应用程序的客户端开发技术(包括jsp、html、css、javascript、html、xml、mysql等)设计一个符合要求的java web数据库应用系统,并实现用户交互功能的设计,达到java web应用程序可用性和易用性目标。开发模式:mvc模式。mvc模式的目的就是实现web系统的职能分工。 model层实现系统中的业务逻辑,通常可以用javabean或ejb来实现。 view层用于与用户的交互,通常用jsp来实现。 controller层是model与view之间沟通的桥梁,它可以分派用户的请求并选择恰当的视图以用于显示,同时它也可以解释用户的输入并将它们映射为模型层可执行的操作。开发工具:windows7,eclispe,jdk1.7,tomcat7.0、mysql5.53、 系统设计1、系统特点 本系统尝试从一些简单的层面对于企业客户信息的管理进行一种探索,针对企业和客户的交流行为进行系统化管理,力求做到客户信息的准确、快捷和可追溯性。本系统包括3个主要层面,客户信息维护、客户来电记录和客户回访记录。2、功能设计4个模块(1)客户资料信息维护模块 客户信息输入、修改和删除。(2)客户来电信息模块 来电信息添加和来电信息查询。(3)客户回访信息模块 回访信息添加和回访信息查询。(4) 客户重要信息提示模块用例图usecase3、用户界面草图登录草图导航页面草图其它功能见后面操作效果图4、页面迁移图从页面迁移图中可以看出,本系统的页面迁移基本上发生在模块内部,整体比较简单而清晰5、页面功能设计所有页面的pageid和对应页面的jsp文件名及所对应的功能4、 数据库设计1、数据库表(1)用户表user(2)客户信息表customer(3)客户来电表 incomecall(4)客户回访表 feedbackcall2、数据库操作图5、 功能模块的详细设计1、程序目录结构图2、数据库访问模块 数据库的设计是需要针对每个模块而不是每个页面进行设置数据库模块,所有的数据访问类duser、dincome、dcustomer、dfeedback、dremind从同一个父类dcommom继承,该父类提供了一个方法getdbconnection来获取数据库的链接。dcommon代码public class dcommon public connection getdbconnection( ) /尝试连接数据库 try /载入mysql的jdbc驱动类 class.forname(commonconst.db_driver_classname); connectionconn=drivermanager.getconnection ( commonconst.db_conn_string );/获得数据库连接 return conn; catch(exception ex) ex.printstacktrace(); return null; 3、共通servlet的处理 本系统中一旦代码出现了异常,将直接向上抛出,一直抛到共通类servlet进行处理。 在共通servlet中发现异常,将页面跳转到错误处理页面,并把错误信息在页面上显示出来,同时提供一个往登录页面迁移的链接。 对应的共通servlet的相关代码如下:public class commonservlet extends httpservlet /保存各页面id对应的action类的对象 private hashtable hpagehandler = new hashtable(); /配置文件的存放位置 private jxpathcontext configcontext = null; public void init() /取得配置文件,并获得其中的dom元素 string filepath = getinitparameter(configxml); string filerealpath = getservletcontext().getrealpath(filepath); /尝试建立配置文件的dom try org.jdom.input.saxbuilder builder = new saxbuilder(); org.jdom.document pdoc = builder.build(filerealpath ); configcontext = jxpathcontext.newcontext(pdoc); globalobjectprovider.init( configcontext ); catch(exception e) system.out.println(servlet初始化失败!); /初始化共通类以获取页面信息 commonconst.init(); /每一种动作第一次执行的时候,初始化对应的类 public void dopost ( httpservletrequest request, httpservletresponse response ) throws servletexception, ioexception /设置提交表单的中文编码 request.setcharacterencoding(gbk); httpsession mysession = request.getsession(true); /得到用户输入信息 string spageid = request.getparameter(pageid); string sactionid = request.getparameter(actionid); if ( spageid = null | spageid.equals() | sactionid = null | sactionid.equals() ) /非法进入页面,跳转到首页 mysession.invalidate(); response.sendredirect(./login.jsp); return; /如果非法进入页面(登录页面除外) if ( !spageid.equals(s001) & mysession.getattribute(loginuser) = null ) /非法进入页面,跳转到首页 mysession.invalidate(); response.sendredirect(./login.jsp); return; try /根据pageid获得处理对象,如果没有则创建一个对象 object oactionobject = hpagehandler.get( spageid ); if ( oactionobject = null ) /根据配置文件创建一个新对象 string sclassname = (string)configcontext.getvalue( ch08-config/pageid=+spageid+/classname); oactionobject = class.forname( sclassname ).newinstance(); hpagehandler.put( spageid, oactionobject); /取得方法名 string smethodname = (string)configcontext.getvalue( ch08-config/pageid=+spageid+/actionid=+sactionid+/methodname); /生成对应的参数,并调用对应对象的对应方法 /inputdata是根据传入的参数做成的 hashtable inputdata = new hashtable(); enumeration params = request.getparameternames(); while( params.hasmoreelements() string sparaname = (string)params.nextelement(); inputdata.put( sparaname, request.getparameter(sparaname) ); /outputdata是下一个页面的值域,在此只是被初始化 hashtable outputdata = new hashtable(); /生成参数列表 class paratype = class.forname(java.util.hashtable), class.forname(java.util.hashtable), class.forname(javax.servlet.http.httpsession) ; object paraobj = inputdata, outputdata, mysession ; /生成method对象 method invokemethod = oactionobject.getclass().getmethod( smethodname, paratype ); /调用方法 invokemethod.invoke( oactionobject, paraobj ); /根据outputdata的结果决定下一个页面 string snextpageid = (string)outputdata.get(pageid); string srealpagepath = (string)configcontext.getvalue( ch08-config/pageid=+snextpageid+/path); /设置下一个页面的值域 mysession.setattribute( snextpageid, outputdata ); response.sendredirect( srealpagepath ); return; catch(exception e) /页面处理出错,跳转到错误处理页面 e.printstacktrace(); hashtable outputdata = new hashtable(); outputdata.put( exception, e ); /设置错误页面的值域 mysession.setattribute( commonconst.viewid_error, outputdata ); response.sendredirect(./error.jsp); return; public void doget ( httpservletrequest request, httpservletresponse response ) throws servletexception, ioexception dopost( request, response ); 错误页面:4、登录模块由于本系统用户角色只有一种,不存在跳转到不同页面的问题,处理相对简单一些,如果用户登录成功,则将用户信息放到session中,并将页面跳转到导航页面。(1)登录页面控制模块alogin相关代码如下:public class alogin public void dologin ( hashtable inputdata, hashtable outputdata, httpsession mysession ) throws exception /获取输入信息 string susername = (string)inputdata.get(username); string spassword = (string)inputdata.get(password); /校验用户输入信息 luser luser = (luser)globalobjectprovider.getlogicservice(commonconst.logic_key_user); /如果对应的类没有的话,报错并返回login页面 if ( luser = null ) throw new exception(发生了内部错误,请联系技术人员! ); /获取用户信息 user userinfo = luser.getuserinfo( susername, spassword ); if ( userinfo = null ) outputdata.put( pageid, commonconst.viewid_login ); outputdata.put( errmsg, 用户名密码检查失败!请重新输入。 ); outputdata.put( username, susername ); return; else outputdata.put( pageid, commonconst.viewid_menu); /往session中设置用户信息 mysession.setattribute( loginuser, userinfo ); return; (2) 登录效果图5、页面导航设计(1)页面位置信息和页面的pageid息息相关,考虑用一个全局变量来存这个信息,然后通过在共通文件中来访问这个全局变量来获取对应页面的名称。为了达到这个目的设置一个成员变量pageinfo和对应的设置方法init(),对应代码如下: public static hashtable pageinfos = new hashtable(); /数据库相关常量 public static string db_driver_classname = com.mysql.jdbc.driver; public static string db_conn_string = jdbc:mysql:/localhost/ch08?user=root&password=123; /初始化 public static void init() pageinfos.put(s002,目录页面); pageinfos.put(s110,客户资料 客户资料录入页面); pageinfos.put(s120,客户资料 客户资料修改一览页面); pageinfos.put(s121,客户资料 客户资料修改详细页面); pageinfos.put(s130,客户资料 客户资料删除页面); pageinfos.put(s210,客户来电 快速反应条件输入页面); pageinfos.put(s211,客户来电 快速反应结果一览页面); pageinfos.put(s220,客户来电 客户来电信息添加页面); pageinfos.put(s230,客户来电 客户来电信息查找页面); pageinfos.put(s231,客户来电 客户来电信息一览页面); pageinfos.put(s232,客户来电 客户来电信息详细页面); pageinfos.put(s310,客户回访 客户回访信息添加页面); pageinfos.put(s320,客户回访 客户回访信息查找页面); pageinfos.put(s321,客户回访 客户回访信息一览页面); pageinfos.put(s322,客户回访 客户回访信息详细页面); pageinfos.put(s410,客户重要信息提醒页面); /获得页面信息 public static string getpageinfo( string spageid ) return (string)pageinfos.get(spageid); 5.1页面外观设计 为四个模块设计不同颜色风格的css代码.tr_head1 color: black; background-color:#aaccaa;.tr_content1 color: black; background-color:#eeffee; cursor:hand;.tr_head2 color: black; background-color:#ccaaaa;.tr_content2 color: black; background-color:#ffeeee; cursor:hand;.tr_head3 color: black; background-color:#aaaacc;.tr_content3 color: black; background-color:#eeeeff; cursor:hand;.tr_head4 color: black; background-color:#ccccaa;.tr_content4 color: black; background-color:#ffffee; cursor:hand;5.2导航页效果图6、客户资料维护模块(1) 客户资料录入 单击导航页面链接进入客户资料录入页面。注意两个方面:一是页面对应的显示元素和输入元素的颜色和当前模块的颜色想吻合,而是在用户输入信息并单击“登录”按钮时,将客户信息登入数据库,然后页面直接转入修改一览。页面控制类acustomeradd:public class acustomeradd /追加一个客户 public void doregister( hashtable inputdata, hashtable outputdata, httpsession mysession ) throws exception /首先获得要追加的客户详细信息 string srealname = (string)inputdata.get(realname); string ssex = (string)inputdata.get(sex); string sbirthday = (string)inputdata.get(birthday); string sphone = (string)inputdata.get(phone); string scellphone = (string)inputdata.get(cellphone); string saddress = (string)inputdata.get(address); string sstartdate = (string)inputdata.get(startdate); string smemo = (string)inputdata.get(memo); /生成一个customer对象以调用 customer customer = new customer(); customer.setrealname( srealname ); customer.setsex( ssex ); customer.setbirthday( sbirthday ); customer.setphone( sphone ); customer.setcellphone( scellphone ); customer.setaddress( saddress ); customer.setstartdate( sstartdate ); customer.setmemo( smemo ); /调用对应的logic类 lcustomer lcustomer = (lcustomer)globalobjectprovider.getlogicservice(commonconst.logic_key_customer); /添加对应的记录 lcustomer.addcustomer( customer ); /然后重新检索,并将页面迁移到一览页面 vector vcustomers = lcustomer.getallcustomer(); outputdata.put( pageid, commonconst.viewid_customer_list); /往值域中设置当前位置信息 mysession.setattribute(customers, vcustomers ); outputdata.put( pageindex, new integer(0) ); return; 效果图:(2) 客户资料修改public class acustomermodify /修改一个客户信息 public void doregister( hashtable inputdata, hashtable outputdata, httpsession mysession ) throws exception /首先获得要修改的客户详细信息 string scustomerid = (string)inputdata.get(customerid); string srealname = (string)inputdata.get(realname); string ssex = (string)inputdata.get(sex); string sbirthday = (string)inputdata.get(birthday); string sphone = (string)inputdata.get(phone); string scellphone = (string)inputdata.get(cellphone); string saddress = (string)inputdata.get(address); string sstartdate = (string)inputdata.get(startdate); string smemo = (string)inputdata.get(memo); /生成一个customer对象以调用 customer customer = new customer(); customer.setcustomerid( scustomerid ); customer.setrealname( srealname ); customer.setsex( ssex ); customer.setbirthday( sbirthday ); customer.setphone( sphone ); customer.setcellphone( scellphone ); customer.setaddress( saddress ); customer.setstartdate( sstartdate ); customer.setmemo( smemo ); /调用对应的logic类 lcustomer lcustomer = (lcustomer)globalobjectprovider.getlogicservice(commonconst.logic_key_customer); /添加对应的记录 lcustomer.modifycustomer( customer ); /然后重新检索,并将页面迁移到一览页面 vector vcustomers = lcustomer.getallcustomer(); outputdata.put( pageid, commonconst.viewid_customer_list); /往值域中设置当前位置信息 mysession.setattribute(customers, vcustomers ); outputdata.put( pageindex, new integer(0) ); return; (3) 客户资料删除public class acustomerdelete /到首页 public void dofirst( hashtable inputdata, hashtable outputdata, httpsession mysession ) throws exception /首页的index一定为0 outputdata.put( pageid, commonconst.viewid_customer_delete); /往值域中设置当前位置信息 outputdata.put( pageindex, new integer(0) ); return; /到末页 public void dolast( hashtable inputdata, hashtable outputdata, httpsession mysession ) throws exception /首先获得全部客户信息,并计算出最后一页的位置 vector allcustomers = (vector)mysession.getattribute(customers); int imax = allcustomers.size(); int imaxpage = (int)math.ceil(double)imax/20); int iindex = (imaxpage-1)*20; /首页的index一定为0 outputdata.put( pageid, commonconst.viewid_customer_delete); /往值域中设置当前位置信息 outputdata.put( pageindex, new integer(iindex) ); return; /到前页 public void doprev( hashtable inputdata, hashtable outputdata, httpsession mysession ) throws exception /首先获得当前页 string scurpage = (string)inputdata.get(curpage); int icurpage = (new integer(scurpage).intvalue(); int iindex = (icurpage-2)*20; outputdata.put( pageid, commonconst.viewid_customer_delete); /往值域中设置当前位置信息 outputdata.put( pageindex, new integer(iindex) ); return; /到次页 public void donext( hashtable inputdata, hashtable outputdata, httpsession mysession ) throws exception /首先获得当前页 string scurpage = (string)inputdata.get(curpage); int icurpage = (new integer(scurpage).intvalue(); int iindex = icurpage*20; outputdata.put( pageid, commonconst.viewid_customer_de
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 空中楼阁说课课件
- 二零二五年青少年户外拓展训练安全协议
- 二零二五年度大型货物运输与货物包装合同
- 2025版绿色环保住宅租赁合同协议示范文本
- 二零二五年度科技企业孵化器厂房及办公楼场地租赁合同
- 2025版个人住宅抵押贷款合同书家居版
- 2025版凯正源净水器售后服务质量监控协议
- 2025年环保材料试用推广合同协议
- 二零二五年度建筑工程施工进度监理合同
- 二零二五年度绿色能源项目居间合同法第二十三章执行标准
- 上海市房地产登记申请书(初始登记)
- 干挂石材拆除施工方案
- 卒中中心应知应会
- 山西省代县金升铁矿有限公司铁矿资源开发利用、地质环境保护与土地复垦方案
- 2021年新高考全国Ⅱ卷语文真题(含答案)
- 《天黑前的夏天》中水意象解析
- 院感知识PPT完整版
- DB37-T 2401-2022危险化学品岗位安全生产操作规程编写导则
- 2023年小学科学教师招聘考试真题练习试题卷及参考答案
- 劳资专管员任命文件(样本)
- 电子教案与课件:制药过程安全与环保-第5章-制药过程“三废”防治技术
评论
0/150
提交评论