java超市管理系统课程设计报告Word文档格式.docx
- 文档编号:19253732
- 上传时间:2023-01-04
- 格式:DOCX
- 页数:63
- 大小:60.93KB
java超市管理系统课程设计报告Word文档格式.docx
《java超市管理系统课程设计报告Word文档格式.docx》由会员分享,可在线阅读,更多相关《java超市管理系统课程设计报告Word文档格式.docx(63页珍藏版)》请在冰豆网上搜索。
一、系统需求分析-1-
1.1系统名称:
-1-
1.2系统介绍:
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.3开发背景
随着现代科学技术的迅猛发展,计算机技术已经渗透到各个领域,成为各行业必不可少的工具,特别是Internet技术的推广和信息高速公路的建立,使IT产业在市场竞争中越发显示出其独特的优势,步入信息化时代,有巨大的数据信息等待加工处理和传输,这使得对数据库的进一步开发和利用显得尤为迫切。
作为国内市场的一些中小型超市,它们在信息化过程中的步伐要落后于大中型超市,而对于这些企业的资源管理,信息的存储和处理也显得迫切需要,要适应市场竞争,就需要有高效的处理方式和管理方法,因此加快超市的信息化进程是必不可少的。
我国的超市在20世纪90年代初期形成,现在已经成为我国零售业的一种重要形态,为国民经济的发展发挥了重要的作用。
随着经济的快速发展,超市的经营管理也变得愈加复杂,早期的售货员站柜台的形式早已不能满足现有销售业的发展,这样就迫切地需要引入新的管理技术。
1.4.系统面向的用户群体
主要是中小型超市使用者,该消费群体具有以下特征:
1超市日常管理人工化居多,工作效率较低;
2超市日常交易额较小,货物流通较小,不愿花高价购进大型超市管理系统。
因此,该消费群体对产品的功能性需求并不高,只需满足前台销售系统、后台货物管理即可。
1.5开发环境
Eclipse+mysql
二、系统总体设计
2.1系统功能结构图
小超市管理系统是一个专门针对小型的商店和超市的智能化、自动化的管理系统。
其功能总框图如图2-1所示。
图2-1系统功能总框图
三、系统模块功能介绍
3.1登录功能介绍
登录功能是进入系统必须经过的验证过程,其主要功能是验证使用者的身份,确认使用者的权限,从而在使用软件过程中能安全地控制系统数据,即不同的工作人员有不同的权限,每个使用人员不得跨越其权限操作软件,可以避免不必要的数据丢失事件发生。
登录的界面如图2-2所示
登陆成功!
!
packageuml_supermarket;
importjava.awt.*;
importjavax.swing.*;
import
importjava.sql.*;
/**
*<
p>
Title:
<
/p>
Description:
Copyright:
Copyright(c)2003<
Company:
*@authorunascribed
*@version1.0
*/
publicclassLogincsextendsJDialogimplementsActionListener{
//声明在程序中要用到的方法
privateJPanelpanel1=newJPanel();
privateBorderLayoutborderLayout1=newBorderLayout();
privateJPaneljPanel1=newJPanel();
privateXYLayoutxYLayout1=newXYLayout();
privateJLabeljLabel1=newJLabel();
//添加一个标签控件
privateJLabeljLabel2=newJLabel();
privateJTextFieldjTextField1=newJTextField();
//添加一个文本框
privateJButtonjButton1=newJButton();
//添加一个按钮控件
privateJButtonjButton2=newJButton();
privateJPasswordFieldjPasswordField1=newJPasswordField();
privateDatabasedatabase1=newDatabase();
privateJLabeljLabel3=newJLabel();
privateJLabeljLabel4=newJLabel();
privateJLabeljLabel5=newJLabel();
privateTitledBordertitledBorder1;
privateTitledBordertitledBorder2;
privateJLabeljLabel6=newJLabel();
publicLogincs(Frameframe,Stringtitle,booleanmodal){
super(frame,title,modal);
try{
jbInit();
pack();
}
catch(Exceptionex){
ex.printStackTrace();
publicLogincs(){
this(null,"
"
false);
privatevoidjbInit()throwsException{
titledBorder1=newTitledBorder("
);
titledBorder2=newTitledBorder("
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(newDimension(600,600));
//设置面板大小
jPanel1.setPreferredSize(newDimension(400,325));
jPasswordField1.setBorder(titledBorder1);
jPasswordField1.setToolTipText("
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("
——版本号
jTextField1.setBorder(titledBorder2);
jLabel6.setBorder(BorderFactory.createEtchedBorder());
getContentPane().add(panel1);
panel1.add(jPanel1,BorderLayout.WEST);
jPanel1.add(jLabel3,newXYConstraints(-1,0,395,30));
jPanel1.add(jLabel5,newXYConstraints(274,30,121,32));
jPanel1.add(jLabel4,newXYConstraints(127,32,143,30));
jPanel1.add(jPasswordField1,newXYConstraints(143,196,132,24));
jPanel1.add(jTextField1,newXYConstraints(143,136,132,24));
jPanel1.add(jLabel2,newXYConstraints(23,195,60,25));
jPanel1.add(jLabel1,newXYConstraints(23,134,60,25));
jPanel1.add(jLabel6,newXYConstraints(-2,65,396,191));
jPanel1.add(jButton1,newXYConstraints(90,274,68,28));
jPanel1.add(jButton2,newXYConstraints(193,275,69,28));
publicvoidactionPerformed(ActionEvente){
;
StringuserName="
sa"
//默认用户名
StringuserPwd="
123"
//密码
Statementstmt=null;
ResultSetrs=null;
ConnectiondbConn=null;
if(e.getSource()==jButton1)//得到界面单击事件
{
try{
StringuserAuthority=null;
//StringuserName=null;
StringuserPassword=null;
StringtestName=jTextField1.getText().toString();
//从jTextField1中得到用户名
StringtestPassword=String.valueOf(jPasswordField1.getPassword());
//从jPassword中得到用户密码
//Statementsql=database1.createStatement();
//打开Statement对象
Class.forName(driverName).newInstance();
}catch(InstantiationExceptione1){
//TODOAuto-generatedcatchblock
e1.printStackTrace();
}catch(IllegalAccessExceptione1){
}catch(ClassNotFoundExceptione1){
}
dbConn=DriverManager.getConnection(dbURL,userName,userPwd);
stmt=dbConn.createStatement();
rs=stmt.executeQuery("
SELECTuserName,userPassword,userAuthorityFROMT_userWHEREuserName='
+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(SQLExceptionex){ex.printStackTrace();
}
//exittheSystem
elseif(e.getSource()==jButton2){
cancel();
voidcancel()
dispose();
//验证用户名以及密码
voidverifyUser(StringuserName,StringuserPassword,StringtestPassword,StringuserAuthority)
if(userName==null)//判断用户名是否为空
JOptionPane.showMessageDialog(null,"
用户名不存在,请先注册"
"
verifyuser"
JOptionPane.DEFAULT_OPTION);
//抛出对话框
else
if(userPassword.equals(testPassword)==false)//判断密码是否相等
您输入的密码不正确,请重试"
verifypassword"
JOptionPane.DEFAULT_OPTION);
else{
success"
//
verifyUserAuthority(userAuthority);
//进行权限判断
//验证用户权限
voidverifyUserAuthority(StringuserAuthority){
if(userAuthority.equals("
admin"
))//如果用户为admin,则弹出管理员界面
AdminWindowadminWindow=newAdminWindow();
//设置对话框
DimensiondlgSize=adminWindow.getPreferredSize();
DimensionfrmSize=getSize();
Pointloc=getLocation();
adminWindow.setLocation((frmSize.width-dlgSize.width)/2+loc.x,(frmSize.height-dlgSize.height)/2+loc.y);
adminWindow.setModal(true);
adminWindow.pack();
adminWindow.show();
//显示对话框
elseif(userAuthority.equals("
customer"
))//如果用户为customer
//弹出顾客登录界面
CustomerWindowcustomerWindow=newCustomerWindow();
//设置对话框的大小
DimensiondlgSize=customerWindow.getPreferredSize();
customerWindow.setLocation((frmSize.width-dlgSize.width)/2+loc.x,(frmSize.height-dlgSize.height)/2+loc.y);
customerWindow.setModal(true);
customerWindow.pack();
customerWindow.show();
buyer"
))
BuyerWindowbuyerWindow=newBuyerWindow();
DimensiondlgSize=buyerWindow.getPreferredSize();
buyerWindow.setLocation((frmSize.width-dlgSize.width)/2+loc.x,(frmSize.height-dlgSize.height)/2+loc.y);
buyerWindow.setModal(true);
buyerWindow.pack();
buyerWindow.show();
saler"
)){
SalesWindowsalesWindow=newSalesWindow();
DimensiondlgSize=salesWindow.getPreferredSize();
salesWindow.setLocation((frmSize.width-dlgSize.width)/2+loc.x,(frmSize.height-dlgSize.height)/2+loc.y);
salesWindow.setModal(true);
salesWindow.pack();
salesWindow.show()
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 超市 管理 系统 课程设计 报告