JAVA课程设计产品销售管理系统.docx

上传人:b****6 文档编号:5814772 上传时间:2023-01-01 格式:DOCX 页数:48 大小:230.12KB
下载 相关 举报
JAVA课程设计产品销售管理系统.docx_第1页
第1页 / 共48页
JAVA课程设计产品销售管理系统.docx_第2页
第2页 / 共48页
JAVA课程设计产品销售管理系统.docx_第3页
第3页 / 共48页
JAVA课程设计产品销售管理系统.docx_第4页
第4页 / 共48页
JAVA课程设计产品销售管理系统.docx_第5页
第5页 / 共48页
点击查看更多>>
下载资源
资源描述

JAVA课程设计产品销售管理系统.docx

《JAVA课程设计产品销售管理系统.docx》由会员分享,可在线阅读,更多相关《JAVA课程设计产品销售管理系统.docx(48页珍藏版)》请在冰豆网上搜索。

JAVA课程设计产品销售管理系统.docx

JAVA课程设计产品销售管理系统

课程设计说明书

课程名称:

Java程序设计课程设计

设计项目:

产品销售管理系统

学生姓名:

学号:

专业:

软件工程

班级:

指导教师:

_

 

2017年2月

1、任务与具体要求

建立数据库:

产品库(产品ID、名称、规格等),销售员库(销售员ID、姓名、性别、电话等),销售记录库(销售日期、销售产品ID、售出数量、单价、销售员ID等)。

实现对销售数据的输入、查询、修改与维护(例如操作员管理、数据备份等)等功能。

 

二、设计说明书包括的内容

需求分析、系统功能结构、软硬件环境、开发工具、数据库结构设计、各个功能模块的详细实现方法、系统测试数据与结果、设计体会、参考文献等

三、应完成的图纸

系统功能结构框架图、各功能模块窗口界面图、算法流程图、测试结果图等

 

四、评语及成绩

 

指导教师(签字)_____________

________年____月日

1问题概述

设计一个产品销售管理系统,以解决传统产品信息管理方式的诸多不便和弊端。

2系统需求分析

在客户的日常管理中,经常需要对产品的相关信息进行处理,采用传统的手工记录,查询方式,显然有很多不便,如多次的增、删、改可能使记录变得混乱,为今后的信息提取带来很多麻烦。

为了解决这一问题,可采用现代化的手段——计算机进行系统的管理。

这样可大大提高管理的质量和效率,并且使客户的日常管理也从手工操作中解脱出来,减少纸制材料的数量,对日常信息的查询、方便、快捷。

因此,基于这些方面的考虑,决定开发本系统。

3系统概要设计

3.1系统的主要功能

系统的主要功能是实现基本的客户的数据管理和维护。

主要包括:

(1)添加:

添加产品信息记录

(2)显示:

显示产品信息记录

(3)删除:

删除产品信息记录

(4)查询:

查询产品信息记录

(5)修改:

修改产品信息记录

(6)保存:

将产品保存到数据库

3.2系统的总体结构

产品数据库管理:

显示全部产品信息:

将全部的产品信息打印出来

添加产品记录信息:

添加新的产品记录信息

更新产品记录信息:

将已经添加的产品信息进行更新

删除产品记录信息:

将已经添加的产品记录删除

销售员数据库管理:

显示全部销售员息:

将全部的产品信息打印出来

查询销售员信息:

通过ID查询销售员并将其信息打印出来

添加销售员记录信息:

添加新的销售员信息

更新销售员记录信息:

将已经添加的销售员信息进行更新

删除销售员记录信息:

将已经添加的销售员记录删除

销售记录数据库管理:

显示全部销售记录信息:

将全部的销售记录信息打印出来

查询销售记录信息:

查询销售记录并将其信息打印出来

添加销售记录信息:

添加新的销售记录信息

更新销售记录信息:

将已经添加的销售记录信息进行更新

删除销售记录信息:

将已经添加的销售记录删除

3.3系统软硬件环境

本程序所适用的计算机系统软硬件环境要求为:

硬件环境:

Pentium III 500以上内存:

256M 

软件环境:

WindowsXP 及以上

3.4数据结构设计

客户信息数据结构类型如下:

销售记录包括销售日期、销售产品ID、售出数量、单价、销售员ID,定义方式如下:

privateStringsalesDate;

privateIntegerproductID;

privateStringsalesVolumes;

privateStringsalesPrice;

privateIntegersalesID;

产品信息包括产品ID、名称、规格,定义方式如下:

privateintproductID;

privateStringproductName;

privateStringproductSpecifications;

销售员信息包括销售员ID、姓名、性别、电话,定义方式如下:

privateintsalespersonID;

privateStringsalespersonName;

privateintsalespersonPhone;

4系统的详细设计

首先声明了三个类分别存储三种不同的数据库的信息如下,再通过一系列对数据库的操作实现对数据的增、删、改、查。

4.1产品信息管理

功能实现:

通过使用SQL语句对数据库的操作进行对产品信息的管理

代码实现:

packageProductSystemOne;

importjava.sql.*;

importjava.util.*;

//对产品的Dao

publicclassProductDao{

//对产品库的查询操作;

publicListquery()throwsSQLException{

Connectionconn=DBUtil.getConnection();//链接数据库

Statementstmt=conn.createStatement();

Stringsql="select*fromproductdate";

ResultSetrs=stmt.executeQuery(sql);

ListproductList=newArrayList();

ProductDateproductDate=null;

while(rs.next()){

productDate=newProductDate();

productDate.setProductID(rs.getInt("ProductID"));

productDate.setProductName(rs.getString("productName"));

productDate.setProductSpecifications(rs.getString("productSpecifications"));

productList.add(productDate);

}

returnproductList;

}

//对产品库进行ID查询

publicListqueryEvery(intPID)throwsSQLException{

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="select*fromproductdatewhereproductID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,PID);

ResultSetrs=pst.executeQuery();

ListproductList=newArrayList();

ProductDateproductDate=null;

while(rs.next()){

productDate=newProductDate();

productDate.setProductID(rs.getInt("ProductID"));

productDate.setProductName(rs.getString("productName"));

productDate.setProductSpecifications(rs.getString("productSpecifications"));

productList.add(productDate);

}

returnproductList;

}

publicvoidaddProduct(intPID,StringPNAME,StringPSPECIFICATIONS)throwsSQLException{//对数据库的添加操作

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="insertintoproductdatevalues(?

?

?

)";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,PID);

pst.setString(2,PNAME);

pst.setString(3,PSPECIFICATIONS);

pst.executeUpdate();

}

//输入你要更新产品的ID,进行修改你的产品信息

publicvoidupdateProduct(intPID,StringPNAME,StringPSPECIFICATIONS)throwsSQLException{//更新

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="updateproductdatesetproductName=?

productSpecifications=?

whereproductID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setString(1,PNAME);

pst.setString(2,PSPECIFICATIONS);

pst.setInt(3,PID);

pst.executeUpdate();

}

//输入你要删除的产品的ID进行删除操作

publicvoiddelProduct(intPID)throwsSQLException{//删除

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="deletefromproductdatewhereproductID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,PID);

pst.executeUpdate();

}

}

4.2销售员信息管理

功能实现:

通过使用SQL语句对数据库的操作进行对销售员信息的管理

代码实现:

packageProductSystemOne;

importjava.sql.Connection;

importjava.sql.PreparedStatement;

importjava.sql.ResultSet;

importjava.sql.SQLException;

importjava.sql.Statement;

importjava.util.ArrayList;

importjava.util.Iterator;

importjava.util.List;

publicclassSalespersonDateDao{

//对产品库的查询操作;

publicListquery()throwsSQLException{

Connectionconn=DBUtil.getConnection();//链接数据库

Statementstmt=conn.createStatement();

Stringsql="select*fromsalespersondate";

ResultSetrs=stmt.executeQuery(sql);

ListsaleSpersonList=newArrayList();

SalespersonDatesaleSpersonDate=null;

while(rs.next()){

saleSpersonDate=newSalespersonDate();

saleSpersonDate.setSalespersonID(rs.getInt("salespersonID"));

saleSpersonDate.setSalespersonName(rs.getString("salespersonName"));

saleSpersonDate.setSalespersonPhone(rs.getInt("salespersonPhone"));

saleSpersonList.add(saleSpersonDate);

}

returnsaleSpersonList;

}

//对产品库进行ID查询

publicListqueryEvery(intSID)throwsSQLException{

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="select*fromsalespersondatewheresalespersonID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,SID);

ResultSetrs=pst.executeQuery();

ListsaleSpersonList=newArrayList();

SalespersonDatesaleSpersonDate=null;

while(rs.next()){

saleSpersonDate=newSalespersonDate();

saleSpersonDate.setSalespersonID(rs.getInt("salespersonID"));

saleSpersonDate.setSalespersonName(rs.getString("salespersonName"));

saleSpersonDate.setSalespersonPhone(rs.getInt("salespersonPhone"));

saleSpersonList.add(saleSpersonDate);

}

returnsaleSpersonList;

}

//对销售员库的添加

publicvoidaddSaleperson(intSID,StringSNAME,intSPHONE)throwsSQLException{//对数据库的添加操作

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="insertintosalespersondatevalues(?

?

?

)";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,SID);

pst.setString(2,SNAME);

pst.setInt(3,SPHONE);

pst.executeUpdate();

}

//输入你要更新销售员的ID,进行修改你的产品信息

publicvoidupdateSalesperson(intSID,StringSNAME,intSPHONE)throwsSQLException{//更新

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="updatesalespersondatesetsalespersonName=?

salespersonPhone=?

wheresalespersonID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setString(1,SNAME);

pst.setInt(2,SPHONE);

pst.setInt(3,SID);

pst.executeUpdate();

}

//输入你要删除的销售员的ID进行删除操作

publicvoiddelProduct(intSID)throwsSQLException{//删除

Connectionconn=DBUtil.getConnection();//链接数据库

Stringsql="deletefromsalespersondatewheresalespersonID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,SID);

pst.executeUpdate();

}

}

4.3销售记录信息管理

功能实现:

通过使用SQL语句对数据库的操作进行对销售记录信息的管理

代码实现:

packageProductSystemOne;

importjava.sql.*;

importjava.util.*;

publicclassSoldNoteDateDao{

publicListquery()throwsSQLException{

Connectionconn=DBUtil.getConnection();//链接数据库

Statementstmt=conn.createStatement();

Stringsql="select*fromsoldnotedate";

ResultSetrs=stmt.executeQuery(sql);

ListsoldNoteList=newArrayList();

SoldNoteDatesoldNoteDate=null;

while(rs.next()){

soldNoteDate=newSoldNoteDate();

soldNoteDate.setSalesDate(rs.getString("salesDate"));

soldNoteDate.setSalesID(rs.getInt("salesID"));

soldNoteDate.setSalesPrice(rs.getString("salesPrice"));

soldNoteDate.setSalesVolumes(rs.getString("salesVolumes"));

soldNoteDate.setProductID(rs.getInt("productID"));

soldNoteList.add(soldNoteDate);

}

returnsoldNoteList;

}

publicListqueryEvery(intSID)throwsSQLException{

Connectionconn=DBUtil.getConnection();

Stringsql="select*fromsoldnotedatewheresalesID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,SID);

ResultSetrs=pst.executeQuery();

ListsoldNoteList=newArrayList();

SoldNoteDatesoldNoteDate=null;

while(rs.next()){

soldNoteDate=newSoldNoteDate();

soldNoteDate.setSalesDate(rs.getString("salesDate"));

soldNoteDate.setProductID(rs.getInt("productID"));

soldNoteDate.setSalesID(rs.getInt("salesID"));

soldNoteDate.setSalesPrice(rs.getString("salesPrice"));

soldNoteDate.setSalesVolumes(rs.getString("salesVolumes"));

soldNoteList.add(soldNoteDate);

}

returnsoldNoteList;

}

//售出产品

publicvoidsell(intSALESID,StringsalesPrice,StringsalesVolumes,intsalesDate,intPID)throwsSQLException{

Connectionconn=DBUtil.getConnection();

Stringsql="insertintosoldnotedatevalues(?

?

?

?

?

)";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,SALESID);

pst.setString(2,salesVolumes);

pst.setString(3,salesPrice);

pst.setInt(4,salesDate);

pst.setInt(5,PID);

pst.executeUpdate();

}

//更新销售数据的销售员信息

publicvoidupdateSalesperson(intPID,intSALESID)throwsSQLException{

Connectionconn=DBUtil.getConnection();

Stringsql="updatesoldnotedatesetsalesID=?

whereproductID=?

";

PreparedStatementpst=conn.prepareStatement(sql);

pst.setInt(1,SALESID);

pst.setInt(2,PID);

pst.executeUpdate();

}

//删除销售数据的信息

publicvoiddeleSalesDate(intPID)throwsSQLException{

Connectionconn=DBUtil.getConnection();

Stringsql="deletefromsoldnotedatewhereproductID=?

";

PreparedStatementpst=co

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1