




已阅读5页,还剩34页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
湖 南 文 理 学 院 课程设计题目: 超市管理系统 系 别 计算机科学与技术 班 级 计科12102 学生姓名 罗巍 杨欢 杨沁铠 唐振 学 号 201217010223 指导教师 谭文学 课程设计进行地点: 第三实验楼a617 任 务 下 达 时 间: 2014 年 5 月 21 日 起止日期: 2014 年 5 月 21 日起至 2014 年 6月 21 日止 摘 要 随着小型超市规模的发展不断扩大,商品数量急剧增加,有关商品的各种信息量也成倍增长,传统的人工记忆方式也慢慢的无法适应形势的变化。随着信息技术的发展,计算机已被广泛的用于社会的各个领域,成为推动社会发展的技术动力。而在计算机应用中,软件的作用十分突出,软件已经发展成为信息技术的核心,主导着信息产品的开发和信息技术市场的进一步的开拓。软件产业已成为社会信息化进程中的一个战略性产业。在软件技术的应用中软件的开发技术尤其是应用型软件产品的开发技术成了重中之重。不断开发适应用户需求、市场需要的新型软件产品。随着社会的发展,软件也在不断的更新换代。由于有些超市里对商品的进货、售出及商品的基本信息等的一些繁琐处理都是通过手工进行记载并进行处理的,对商品信息的处理工作量特别大,不仅浪费大量的人力物力,而且还很容易出错,更重要的是为了方便顾客,超市需要时时刻刻对商品对各种信息进行统计分析。 一直以来人们使用传统人工的方式管理超市的各项工作, 这种管理方式存在着许多缺点, 如: 效率低、保密性差, 另外时间一长, 将产生大量的冗余文件和数据, 这给查找、统计、更新和维护工作都带来了很大的困难。然而大型的超市管理系统功能过于强大而造成操作繁琐降低了小超市的工作效率。如果有这样一套完整的小型超市管理系统软件,只需点击几下鼠标就可完成所需操作,那样就会大大的提高超市员工的工作效率和管理水平,并能进一步提高超市的工作效率并使超市实施规范化管理。鉴于小型超市管理中存在的诸多问题, 我们在此次课程设计中以小型超市管理系统为研究课题,对此系统进行了全面的设计。超市管理系统由顾客、采购员、销售员、经理的管理界面四部分组成。 超市管理系统应该能够为用户提供充足的信息和快捷的查询手段。一个完整系统的设计,当然就离不开后台环境的支持,在此次设计中,我们主要以sqlsever数据库作为基础,实行此系统的开发。目 录一、系统需求分析- 1 -1.1系统名称:- 1 -1.2系统介绍:- 1 -1.3开发背景- 1 -1.4.系统面向的用户群体- 1 -1.5开发环境- 1 -二、系统总体设计- 2 -2.1系统功能结构图- 2 -三、系统详细设计- 2 -3.1数据库实体e-r图设计- 2 -3.2数据库表的设计- 4 -3.3物理设计文档- 6 -3.4详细设计- 10 -四、系统总结- 20 -五、系统设计心得体会- 21 -六、参考文献- 21 -一、系统需求分析1.1系统名称:小型超市管理系统1.2系统介绍:界面设计简洁、友好、美观大方操作简单、快捷方便数据存储安全、可靠信息分类清晰、准确强大的查询功能、保证数据查询的灵活性提供销售排行,为管理员提供真实的数据信息提供灵活、方便的权限设置功能,使整个系统的管理分工明确对用户的输入的数据,系统进行严格的数据检验,尽可能排人为错误1.3开发背景随着现代科学技术的迅猛发展,计算机技术已经渗透到各个领域,成为各行业必不可少的工具,特别是internet技术的推广和信息高速公路的建立,使it产业在市场竞争中越发显示出其独特的优势,步入信息化时代,有巨大的数据信息等待加工处理和传输,这使得对数据库的进一步开发和利用显得尤为迫切。作为国内市场的一些中小型超市,它们在信息化过程中的步伐要落后于大中型超市,而对于这些企业的资源管理,信息的存储和处理也显得迫切需要,要适应市场竞争,就需要有高效的处理方式和管理方法,因此加快超市的信息化进程是必不可少的。我国的超市在20世纪90年代初期形成,现在已经成为我国零售业的一种重要形态,为国民经济的发展发挥了重要的作用。随着经济的快速发展,超市的经营管理也变得愈加复杂,早期的售货员站柜台的形式早已不能满足现有销售业的发展,这样就迫切地需要引入新的管理技术。1.4.系统面向的用户群体主要是中小型超市使用者,该消费群体具有以下特征:1超市日常管理人工化居多,工作效率较低;2超市日常交易额较小,货物流通较小,不愿花高价购进大型超市管理系统。因此,该消费群体对产品的功能性需求并不高,只需满足前台销售系统、后台货物管理即可。1.5开发环境eclipse+mysql二、系统总体设计2.1系统功能结构图 小超市管理系统是一个专门针对小型的商店和超市的智能化、自动化的管理系统。其功能总框图如图2-1所示。 顾客注册登陆界面 采购员登陆顾客登陆经理登录销售员登陆分项查询增加订单更改订单查看销售信息查看进货信息购买商品查看销售员信息查看所有订单浏览某种商品浏览所有商品 图2-1 系统功能总框图 三 数据库代码和界面3.1数据库表的设计(1) 顾客信息表(buye)字段名类型长度约束中文名buyeridint顾客编号buyergoodsnamevarchar50not null购买商品名称buyergoodsnumbevarchar50not null购买商品数量buyermanufacturervarchar50not null商品生产厂家buyerdatevarchar50not null购买日期buyerstatusvarchar45not null购买状态buyernamevarchar45not null顾客姓名create table buyer_table (buyerid int identity (1, 1) not null ,buyergoodsname varchar (50) collate chinese_prc_ci_as null ,buyergoodsnumber varchar (50) collate chinese_prc_ci_as null ,buyermanufacturer varchar (50) collate chinese_prc_ci_as null ,buyerdate varchar (50) collate chinese_prc_ci_as null ,buyerstatus varchar (50) collate chinese_prc_ci_as null ,buyername varchar (50) collate chinese_prc_ci_as null ) on primary(2) 商品信息表(goodsinfo )字段名类型长度字段约束中文名goodsidint商品编号goodsnamevarchar50not null商品名称goodsnumberint商品数量goodsproductvarchar 50not null生产厂家goodspricefloat6商品价格goodssizevarchar 50not null商品规格create table goodsinfo (goodsid int not null ,goodsname varchar (50) collate chinese_prc_ci_as null ,goodsnumber int null ,goodsproduct varchar (50) collate chinese_prc_ci_as null ,goodsprice float null ,goodssize varchar (50) collate chinese_prc_ci_as null ) on primarygo(3)用户信息表( t_user)字段名类型长度约束中文名useridint用户编号usernamevarchar50not null用户名字userpasswordvarchar50not null用户密码useraddress varchar50not null用户住址userauthorityvarchar50not null用户权限usergendervarchar10not null用户性别userageintnot null用户年龄create table t_user (userid int identity (1, 1) not null ,username varchar (50) collate chinese_prc_ci_as null ,userpassword varchar (50) collate chinese_prc_ci_as null ,useraddress varchar (50) collate chinese_prc_ci_as null ,userauthority varchar (50) collate chinese_prc_ci_as null ,usergender varchar (10) collate chinese_prc_ci_as null ,userage int null ) on primarycreate table user (userid int identity (1, 1) not null ,username varchar (50) collate chinese_prc_ci_as null ,userpassword varchar (50) collate chinese_prc_ci_as null ,useraddress varchar (50) collate chinese_prc_ci_as null ,userauthority varchar (50) collate chinese_prc_ci_as null ,usergender varchar (10) collate chinese_prc_ci_as null ,userage int null ) on primarygo(4)销售信息表(vendition)字段名类型长度约束中文名venditionidint销售员编号goodsnamevarchar50not null商品名称goodscustomnumbervarchar50not null销售数量customernamevarchar50not null消费者名字venditiondatevarchar50not null销售数量goodssize varchar45not null商品规格 goodspricefloatnot null商品价格create table vendition_table (venditionid int identity (1, 1) not null ,goodsname varchar (50) collate chinese_prc_ci_as null ,goodscustomnumber varchar (50) collate chinese_prc_ci_as null ,customername varchar (50) collate chinese_prc_ci_as null ,venditiondate varchar (50) collate chinese_prc_ci_as null ,goodssize varchar (50) collate chinese_prc_ci_as null ,goodsprice float null ) on primary 3.2连接数据库string drivername=com.microsoft.jdbc.sqlserver.sqlserverdriver; string dburl=jdbc:sqlserver:/localhost:1433;databasename=supermarket; string username=sa; /默认用户名 string userpwd=123; /密码 四、系统模块功能介绍 3.1 登录功能介绍 登录功能是进入系统必须经过的验证过程,其主要功能是验证使用者的身份,确认使用者的权限,从而在使用软件过程中能安全地控制系统数据,即不同的工作人员有不同的权限,每个使用人员不得跨越其权限操作软件,可以避免不必要的数据丢失事件发生。 登录的界面如图2-2所示登陆成功!4.1.1登陆界面源代码public class logincs extends jdialog implements actionlistener/声明在程序中要用到的方法 private jpanel panel1 = new jpanel(); private borderlayout borderlayout1 = new borderlayout(); private jpanel jpanel1 = new jpanel(); private xylayout xylayout1 = new xylayout(); private jlabel jlabel1 = new jlabel();/添加一个标签控件 private jlabel jlabel2 = new jlabel(); private jtextfield jtextfield1 = new jtextfield();/添加一个文本框 private jbutton jbutton1 = new jbutton();/添加一个按钮控件 private jbutton jbutton2 = new jbutton(); private jpasswordfield jpasswordfield1 = new jpasswordfield(); private database database1 = new database(); private jlabel jlabel3 = new jlabel(); private jlabel jlabel4 = new jlabel(); private jlabel jlabel5 = new jlabel(); private titledborder titledborder1; private titledborder titledborder2; private jlabel jlabel6 = new jlabel(); public logincs(frame frame, string title, boolean modal) super(frame, title, modal); try jbinit(); pack(); catch(exception ex) ex.printstacktrace(); public logincs() this(null, , false); private void jbinit() throws exception titledborder1 = new titledborder(); titledborder2 = new titledborder(); panel1.setlayout(borderlayout1); jpanel1.setlayout(xylayout1); jlabel1.setforeground(color.blue);/标签控件的字体颜色 jlabel1.settext(用户名); /标签标题 jlabel2.setforeground(color.blue); jlabel2.settext(密码); jbutton1.setforeground(uimanager.getcolor(list.selectionbackground);/按钮控件字体颜色 jbutton1.setborder(borderfactory.createraisedbevelborder();/按钮外观 jbutton1.settext(登录);/按钮标题 jbutton1.addactionlistener(this);/加入按钮事件 jbutton2.setforeground(uimanager.getcolor(menu.selectionbackground); jbutton2.setborder(borderfactory.createraisedbevelborder(); jbutton2.settooltiptext(); jbutton2.settext(取消); jbutton2.addactionlistener(this); jpanel1.setborder(borderfactory.createetchedborder(); jpanel1.setminimumsize(new dimension(600, 600);/设置面板大小 jpanel1.setpreferredsize(new dimension(400, 325); jpasswordfield1.setborder(titledborder1); jpasswordfield1.settooltiptext(); database1.setconnection(new com.borland.dx.sql.dataset.connectiondescriptor(jdbc:odbc:supermarket, sa, 123, false, sun.jdbc.odbc.jdbcodbcdriver); this.setresizable(false); this.settitle(登录); jlabel3.setbackground(color.yellow);/标签背景颜色 jlabel3.setforeground(color.black); jlabel3.setborder(borderfactory.createetchedborder(); jlabel3.settext( 小型超市管理系统); jlabel4.setborder(borderfactory.createetchedborder(); jlabel4.settext( 制作人:l,t,y,y); jlabel5.setborder(borderfactory.createetchedborder(); jlabel5.settooltiptext(); jlabel5.settext(版本号: 2014.5.30); jtextfield1.setborder(titledborder2); jlabel6.setborder(borderfactory.createetchedborder(); getcontentpane().add(panel1); panel1.add(jpanel1, borderlayout.west); jpanel1.add(jlabel3, new xyconstraints(-1, 0, 395, 30); jpanel1.add(jlabel5, new xyconstraints(274, 30, 121, 32); jpanel1.add(jlabel4, new xyconstraints(127, 32, 143, 30); jpanel1.add(jpasswordfield1, new xyconstraints(143, 196, 132, 24); jpanel1.add(jtextfield1, new xyconstraints(143, 136, 132, 24); jpanel1.add(jlabel2, new xyconstraints(23, 195, 60, 25); jpanel1.add(jlabel1, new xyconstraints(23, 134, 60, 25); jpanel1.add(jlabel6, new xyconstraints(-2, 65, 396, 191); jpanel1.add(jbutton1, new xyconstraints(90, 274, 68, 28); jpanel1.add(jbutton2, new xyconstraints(193, 275, 69, 28); public void actionperformed(actionevent e) string drivername=com.microsoft.jdbc.sqlserver.sqlserverdriver; string dburl=jdbc:sqlserver:/localhost:1433;databasename=supermarket; string username=sa; /默认用户名 string userpwd=123; /密码 statement stmt=null; resultset rs =null; connection dbconn=null; if(e.getsource() = jbutton1) /得到界面单击事件 try string userauthority = null ; / string username = null ; string userpassword = null ; string testname = jtextfield1.gettext().tostring() ;/从jtextfield1中得到用户名 string testpassword = string.valueof(jpasswordfield1.getpassword() ;/从jpassword中得到用户密码 /statement sql = database1.createstatement() ; /打开statement对象 try class.forname(drivername).newinstance(); catch (instantiationexception e1) / todo auto-generated catch blocke1.printstacktrace(); catch (illegalaccessexception e1) / todo auto-generated catch blocke1.printstacktrace(); catch (classnotfoundexception e1) / todo auto-generated catch blocke1.printstacktrace(); dbconn=drivermanager.getconnection(dburl,username,userpwd); stmt = dbconn.createstatement(); rs = stmt.executequery(select username,userpassword , userauthority from t_user where username = +testname+) ; /执行sql语句,从数据库当中选择用户名,密码,和权限。 while(rs.next() / username = rs.getstring(username) ; /从数据库当中得到用户名 userpassword = rs.getstring(userpassword) ;/从数据库当中得到密码 userauthority = rs.getstring(userauthority) ;/从数据库当中得到权限 verifyuser(username,userpassword,testpassword,userauthority); /调用verifyuser方法 cancel() ;/退出 catch(sqlexception ex)ex.printstacktrace(); /exit the system else if(e.getsource() = jbutton2) cancel(); void cancel() dispose(); /验证用户名以及密码 void verifyuser(string username , string userpassword , string testpassword, string userauthority) if(username = null) /判断用户名是否为空 joptionpane.showmessagedialog(null,用户名不存在,请先注册,verify user,joptionpane.default_option); /抛出对话框 else if(userpassword.equals(testpassword) = false) /判断密码是否相等 joptionpane.showmessagedialog(null,您输入的密码不正确,请重试,verify password , joptionpane.default_option); /抛出对话框 else joptionpane.showmessagedialog(null,success,joptionpane.default_option); / verifyuserauthority(userauthority) ;/进行权限判断 /验证用户权限 void verifyuserauthority(string userauthority) if(userauthority.equals(admin)/如果用户为admin,则弹出管理员界面 adminwindow adminwindow = new adminwindow() ; /设置对话框 dimension dlgsize = adminwindow.getpreferredsize(); dimension frmsize = getsize(); point loc = getlocation(); adminwindow.setlocation(frmsize.width - dlgsize.width) / 2 + loc.x, (frmsize.height - dlgsize.height) / 2 + loc.y); adminwindow.setmodal(true); adminwindow.pack(); adminwindow.show();/显示对话框 else if (userauthority.equals(customer)/如果用户为customer /弹出顾客登录界面 customerwindow customerwindow =new customerwindow() ; /设置对话框的大小 dimension dlgsize = customerwindow.getpreferredsize(); dimension frmsize = getsize(); point loc = getlocation(); customerwindow.setlocation(frmsize.width - dlgsize.width) / 2 + loc.x, (frmsize.height - dlgsize.height) / 2 + loc.y); customerwindow.setmodal(true); customerwindow.pack(); customerwindow.show(); else if (userauthority.equals(buyer) buyerwindow buyerwindow =new buyerwindow() ; dimension dlgsize = buyerwindow.getpreferredsize(); dimension frmsize = getsize(); point loc = getlocation(); buyerwindow.setlocation(frmsize.width - dlgsize.width) / 2 + loc.x, (frmsize.height - dlgsize.height) / 2 + loc.y); buyerwindow.setmodal(true); buyerwindow.pack(); buyerwindow.show(); else if (userauthority.equals(saler) saleswindow saleswindow =new saleswindow() ; dimension dlgsize = saleswindow.getpreferredsize(); dimension frmsize = getsize(); point loc = getlocation(); saleswindow.setlocation(frmsize.width - dlgsize.width) / 2 + loc.x, (frmsize.height - dlgsize.height) / 2 + loc.y); saleswindow.setmodal(true); saleswindow.pack(); saleswindow.show(); else if (userauthority.equals(manager) managementwindow managementwindow =new managementwindow() ; dimension dlgsize = managementwindow.getpreferredsize(); dimension frmsize = getsize(); point loc = getlocation(); managementwindow.setlocation(frmsize.width - dlgsize.width) / 2 + loc.x, (frmsize.height - dlgsize.height) / 2 + loc.y); managementwindow.setmodal(true); managementwindow.pack(); managementwindow.show(); 4.2 顾客注册界面注册成功!3.2.2顾客注册源代码public class registration extends jdialog implements actionlistener string drivername=com.microsoft.jdbc.sqlserver.sqlserverdriver; string dburl=jdbc:sqlserver:/localhost:1433;databasename=supermarket; string username=sa; /默认用户名 string userpwd=123; /密码 statement stmt=null; resultset rs =null; connection dbconn=null; private jpanel panel1 = new jpanel(); private borderlayout borderlayout1 = new borderlayout(); private jpanel jpanel1 = new jpanel(); private xylayout xylayout1 = new xylayout(); private jlabel jlabel1 = new jlabel(); private jlabel jlabel2 = new jlabel(); private jlabel jlabel3 = new jlabel(); private jlabel jlabel4 = new jlabel(); private jtextfield jtextfield1 = new jtextfield(); private jtextfield jtextfield2 = new jtextfield(); private jtextfield jtextfield3 = new jtextfield(); private jtextfield jtextfield4 = new jtextfield(); private jlabel jlabel5 = new jlabel(); private jlabel jlabel6 = new jlabel(); private jlabel jlabel7 = new jlabel(); private jtextfield jtextfield5 = new jtextfield(); private jpasswordfield jtextfield6 = new jpasswordfield(); private jpasswordfield jtextfield7 = new jpasswordfield(); private jbutton jbutton1 = new jbutton(); private jbutton jbutton2 = new jbutton(); public registration(frame frame, string title, boolean modal) super(frame, title, modal); try jbinit(); pack(); catch(exception ex) ex.printstacktrace(); public registration() this(null, , false); private void jbinit() throws exception panel1.setlayout(borderlayout1); jpanel1.setlayout(xylayout1); jlabel1.settext(姓名); jlabel2.settext(年龄); jlabel3.settext(性别); jlabel4.settext(类别); jlabel5.settext(请输入密码); jlabel6.settext(请再输一遍); jlabel7.settext(家庭住址); jbutton1.settext(确定); jbutton1.addactionlistener(new java.awt.event.actionlistener() public void actionperformed(actionevent e) jbutton1_actionperformed(e); ); jbutton2.settext(取消); jbutton2.addactionlistener(new java.awt.event.actionlistener() public void actionperformed(actionevent e) jbutton2_actionperformed(e); ); jpanel1.setpreferredsize(new dimension(400, 300); jtextfield4.settext(customer); getcontentpane().add(panel1); panel1.add(jpanel1, borderlayout.center); jpanel1.add(jtextfield1, new xyconstraints(80,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 老厂退休考试题及答案
- 教师招聘之《幼儿教师招聘》能力提升试题打印含答案详解(典型题)
- 2025年教师招聘之《幼儿教师招聘》题库试题含答案详解(b卷)
- 课程改革考试题及答案
- 绢纺精炼操作工主管竞选考核试卷及答案
- 咖啡学徒考试题及答案
- 课件无法播放显示要登陆问题
- 警示标识考试题及答案
- 课件文案制作指南
- 集群通信系统机务员专业知识考核试卷及答案
- 肝性脑病(课件)
- 【名校】《三思而后行》 完整版课件
- 公司内部程序文件(格式模版)
- 泛光施工招标文件
- 旅游策划实务整套课件完整版电子教案课件汇总(最新)
- DB23∕T 2661-2020 地热能供暖系统技术规程
- 人工挖孔桩施工监测监控措施
- 国家职业技能标准 (2021年版) 6-18-01-07 多工序数控机床操作调整工
- 办公楼加层改造施工组织设计(100页)
- 渗透检测培训教材(1)
- 空调专业常用英文词汇
评论
0/150
提交评论