销售管理系统的设计与实现.docx
- 文档编号:24236152
- 上传时间:2023-05-25
- 格式:DOCX
- 页数:28
- 大小:180.49KB
销售管理系统的设计与实现.docx
《销售管理系统的设计与实现.docx》由会员分享,可在线阅读,更多相关《销售管理系统的设计与实现.docx(28页珍藏版)》请在冰豆网上搜索。
销售管理系统的设计与实现
1问题描述
1.1开发环境
(1)运用已学过的知识进行应用系统的开发,掌握软件设计流程。
(2)通过课程设计,使用SSH技术、Java高级语言、SQL语言等开发应系
统,掌握基本的编程方法。
(3)通过课程设计掌握数据库的连接方法,及对数据的查询、修改、插入、
删除等操作。
1.2问题理解和分析
系统主要完成以下功能
(1)向使用者提供商品基本的录入,删除,编辑等基本功能。
(2)向使用者提供商品销售环节中的基本管理功能。
(3)向使用者提供基本的查询功能。
(4)提供打印功能。
2需求分析
2.1需求描述
由于销售管理系统是一个用来帮助使用者管理商品销售流程的软件。
使用者通过对销售过程中所涉及到的商品,订单,销售商等资料的录入,便可以轻松实现商品销售流程的管理。
所以,此系统必须向使用者提供一下一些具体功能:
(1)软件必须向使用者提供商品基本的录入,删除,编辑等基本功能
(2)鉴于商品的不同销售方式(分为订单销售和代理商销售两种形式),软件必须向使用者提供商品销售环节中的基本管理功能,因此必须有订单分销模块和代理商分销模块。
(3)软件必须向使用者提供基本的查询功。
(4)由于是销售管理软件,所以系统安全性必须是要考虑的问题。
因此,必须实现以下两点:
A:
系统操作员机制。
对系统的使用者,按等级开放管理权限,这样可以在一定程度上保证数据库系统的安全性,避免数据被泄漏,非法更改等。
B:
销售数据直接反映了一个销售单位的盈亏状况,鉴于销售数据的重要性,所以必须对这些数据加以保护,在系统崩溃时或者误操作等情况下,可以对数据进行恢复。
这就需要系统提供备份功能。
(5)对于销售数据不能只存储在计算机中,而是需要导出步骤,最后以印刷品的形式出现在使用者面前,该软件设计的最终目的才能得以具体的实现。
所以,打印功能是必不可少的系统功能之一。
2.2系统运行环境
(1)硬件环境。
本系统适用于那种Inter386以上计算机,内存容量为128M,应配备键盘、鼠标、显示器等外部设备。
(2)软件环境。
本系统的设计采用MyEclipse8.5编写。
在Windows7环境下测试通过。
3总体设计
3.1功能模块图
功能模块图如图3-1所示。
图3-1功能模块图
3.2结构设计
系统总流程图如图3-2所示。
图3-2系统流程图
4数据库设计
4.1数据库概念结构设计
E-R模型图如图4-1所示。
图4-1E-R模型图
4.2数据库逻辑结构设计
表名:
liyi(用户表)如表4-1所示。
表4-1用户表
字段名
数据类型
长度
是否允许空值
约束
username
Varchar
16
Notnull
Primarykey
Password
Varchar
16
Notnull
Safety
Char
8
Notnull
表名:
Supplier(供应商表)如表4-2所示。
表4-2供应商表
字段名
数据类型
长度
是否允许空值
约束
Sup_id
Char
5
Notnull
Primarykey
Sup_name
Varchar
16
Notnull
Sup_contact
varChar
16
Notnull
Sup_phone
varChar
15
NotNull
sup_address
Varchar
40
NotNull
表名:
Purchase(进货表)如表4-3所示。
表4-3进货表
字段名
数据类型
长度
是否允许空值
约束
P_id
Char
5
Notnull
Primarykey
P_name
Varchar
20
Notnull
price
Float
Notnull
number
int
Notnull
P_date
Varchar
16
Notnull
Primarykey
sup_id
Char
5
Notnull
Foreignerkey
表名:
sale(销售表)如表4-4所示。
表4-4销售表
字段名
数据类型
长度
是否允许空值
约束
p_id
Char
5
Notnull
Primarykey
price
float
Notnull
number
int
Notnull
total
float
Notnull
S_date
Varchar
16
Notnull
Primarykey
表名:
Return(退货表)如表4-5所示。
表4-5退货表
字段名
数据类型
长度
是否允许空值
约束
p_id
Char
5
Notnull
Primarykey
number
int
Notnull
r_date
varchar
16
Notnull
Primarykey
reason
varchar
50
yes
5系统的详细设计与实现
5.1用户登录模块设计
用户登录模块如图5-1所示。
图5-1用户登录窗口效果图
本窗体的任务是通过用户输入密码判断用户是否是合法的用户.它用于管理员按照用户名和密码进行登录。
以免不相关得人进入系统进行不良的操作,而对系统进行破坏,导致整个系统进行瘫痪。
主要代码:
publicclassLoginDialogextendsJFrame{
privatestaticfinallongserialVersionUID=1L;
privateLoginPanelloginPanel=null;
privateJButtonexitButton=null;
privatestaticStringuserStr;
privateMainFramemainFrame;
publicLoginDialog(){
try{
UIManager.setLookAndFeel(UIManager
.getSystemLookAndFeelClassName());
mainFrame=newMainFrame();
initialize();
}
catch(Exceptione){e.printStackTrace();
}
}
privateJButtongetLoginButton(){
if(loginButton==null){
loginButton=newJButton();
loginButton.setBounds(newRectangle(109,114,48,20));
loginButton.setIcon(newImageIcon(getClass().getResource(
"/res/loginButton.jpg")));
loginButton.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
try{
userStr=userField.getText();
StringpassStr=newString(passwordField.getPassword());
if(!
Dao.checkLogin(userStr,passStr)){
JOptionPane.showMessageDialog(LoginDialog.this,
"用户名与密码无法登录","登录失败",
JOptionPane.ERROR_MESSAGE);
return;
}
}catch(Exceptione1){
e1.printStackTrace();
}
MainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setVisible(true);
mainFrame.getCzyStateLabel().setText(userStr);
setVisible(false);
}
});
}
returnloginButton;
}
5.2销售系统主界面设计
销售系统主界面如图5-2所示。
图5-2销售系统主界面窗口效果图
该窗体是本系统的统筹界面。
它是系统的结构匡架,便于对整个系统的观摩、管理.主要使用Label和panl以及manu等控件实现的。
Image控件使得界面得以美化。
由于每次操作不一定会用到所有的数据库,所以没有必要在每次运行时生成所有的数据库别名。
Session控件提供了动态生成数据库别名的方法,使通过操作选择窗体进行优选择的别名生成成为可能。
主要代码:
packagecom.lzw;
importjava.awt.*;
importjavax.swing.border.BevelBorder;
importcom.lzw.login.LoginDialog;
publicclassMainFrameextendsJFrame{
privatestaticfinallongserialVersionUID=1L;
privateJPanelframeContentPane=null;
privateToolBargetJJToolBarBar(){
if(toolBar==null){
toolBar=newToolBar(getFrameMenuBar());
toolBar.setCursor(newCursor(Cursor.HAND_CURSOR));
}
returntoolBar;
}
protectedMenuBargetFrameMenuBar(){
if(frameMenuBar==null){
frameMenuBar=newMenuBar(getDesktopPane(),getStateLabel());
}
returnframeMenuBar;
}
privateDesktopPanelgetDesktopPane(){
if(desktopPane==null){
desktopPane=newDesktopPanel();
}
returndesktopPane;
}
publicJLabelgetStateLabel(){
if(stateLabel==null){
stateLabel=newJLabel();
stateLabel.setText("当前没有选定窗体");
}
returnstateLabel;
}
publicMainFrame(){
super();
initialize();
}
}//@jve:
decl-index=0:
visual-constraint="6,-5"
5.3商品销售录入模块设计
商品销售录入模块如图5-3所示。
图5-3销售录入窗口效果图
该窗体以图形化的界面,简单直观的向使用者提供商品销售的录入功能,使用者可以快速的将销售记录录入系统,并进行保存。
主要代码:
packagecom.lzw.iframe;
importjava.awt.*;
importjava.awt.event.*;
importcom.lzw.*;
publicclassXiaoShouDanextendsJInternalFrame{
privatefinalJTabletable;
publicXiaoShouDan(){
super();
setMaximizable(true);
setIconifiable(true);
setClosable(true);
getContentPane().setLayout(newGridBagLayout());
piaoHao.setFocusable(false);
setupComponet(piaoHao,1,0,1,140,true);
setupComponet(newJLabel("客户:
"),2,0,1,0,false);
kehu.setPreferredSize(newDimension(160,21));
kehu.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
doKhSelectAction();
}
});
setupComponet(kehu,3,0,1,1,true);
sp=newJComboBox();
sp.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
TbSpinfoinfo=(TbSpinfo)sp.getSelectedItem();
if(info!
=null&&info.getId()!
=null){
updateTable();
}
}
});
table=newJTable();
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
initTable();
tjButton.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
initPiaoHao();
stopTableCellEditing();
for(inti=0;i
TbSpinfoinfo=(TbSpinfo)table.getValueAt(i,0);
if(table.getValueAt(i,0)==null)
return;
}
DefaultTableModelmodel=(DefaultTableModel)table.getModel();
model.addRow(newVector());
}
});
setupComponet(tjButton,4,4,1,1,false);
JButtonsellButton=newJButton("销售");
sellButton.addActionListener(newActionListener(){
if(ysjlStr==null||ysjlStr.isEmpty()){
JOptionPane.showMessageDialog(XiaoShouDan.this,"填写验收结论");
return;
}
if(table.getRowCount()<=0){
JOptionPane.showMessageDialog(XiaoShouDan.this,"填加销售商品");
return;
}
TbSellMainsellMain=newTbSellMain(id,pzsStr,jeStr,
ysjlStr,kehuName,rkDate,czyStr,jsrStr,jsfsStr);
Set
introws=table.getRowCount();
for(inti=0;i TbSpinfospinfo=(TbSpinfo)table.getValueAt(i,0); StringdjStr=(String)table.getValueAt(i,6); StringslStr=(String)table.getValueAt(i,7); Doubledj=Double.valueOf(djStr); Integersl=Integer.valueOf(slStr); TbSellDetaildetail=newTbSellDetail(); detail.setSpid(spinfo.getId()); detail.setTbSellMain(sellMain.getSellId()); set.add(detail); } booleanrs=Dao.insertSellInfo(sellMain); if(rs){ JOptionPane.showMessageDialog(XiaoShouDan.this,"销售完成"); DefaultTableModeldftm=newDefaultTableModel(); table.setModel(dftm); initTable(); pzs.setText("0"); hpzs.setText("0"); hjje.setText("0"); } } }); setupComponet(sellButton,5,4,1,1,false); addInternalFrameListener(newinitTasks()); } privatevoidstopTableCellEditing(){ TableCellEditorcellEditor=table.getCellEditor(); if(cellEditor! =null) cellEditor.stopCellEditing(); } } 5.4商品进货录入模块设计 商品进货录入模块如图5-4 图5-4商品进货录入窗口效果图 该窗体以图形化的界面,简单直观的向使用者提供商品的查询功能,使用者可以通过已知商品信息迅速查询到与此种商品相关的代理商信息,同时,也可用过代理商的信息反查处其代理的商品状况。 主要代码: packagecom.lzw.iframe; importjava.awt.*; importjava.awt.event.*; importjava.beans.PropertyChangeListener; importjava.sql.*; importjava.util.*; privateJComboBoxgysComboBox=null; privateJComboBoxjsrComboBox=null; privateDatejhsjDate=newDate(); privateJTextFieldgetCzyField(){ if(czyField==null){ czyField=newJTextField(); czyField.setEditable(false); czyField.setText(MainFrame.getCzyStateLabel().getText()); } returnczyField; } privateJButtongetRukuButton(){ if(rukuButton==null){ rukuButton=newJButton(); rukuButton.setText("入库"); rukuButton.addActionListener(newjava.awt.event.ActionListener(){ publicvoidactionPerformed(java.awt.event.ActionEvente){ } TbRukuMainruMain=newTbRukuMain(id,pzsStr,jeStr, ysjlStr,gysName,rkDate,czyStr,jsrStr,jsfsStr); Set introws=table.getRowCount(); for(inti=0;i TbSpinfospinfo=(TbSpinfo)table.getValueAt(i,0); if(spinfo==null||spinfo.getId()==null ||spinfo.getId().isEmpty())continue; StringdjStr=(String)table.getValueAt(i,6); StringslStr=(String)table.getValueAt(i,7); Doubledj=Double.valueOf(djStr); Integersl=Integer.valueOf(slStr); TbRukuDetaildetail=newTbRukuDetail(); detail.setTabSpinfo(spinfo.getId()); detail.setTabRukuMain(ruMain.getRkId()); detail.setDj(dj);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 销售 管理 系统 设计 实现