基于JavaWeb的汽车销售管理系统
目录摘要1Abstract2一、 系统开发平台4二、数据库规划52.1 任务陈述52.2 任务目标6三、系统定义73.1 系统边界73.2 用户视图7四、需求分析94.1 用户需求说明94.1.1 数据需求94.1.2 事务需求94.2 系统需求说明10五、数据库逻辑设计125.1 ER图125.2 数据字典125.3 关系表13六、 数据库物理设计166.1索引166.2视图166.3安全机制1
目 录
摘 要 1
Abstract 2
一、 系统开发平台 4
二、数据库规划 5
2.1 任务陈述 5
2.2 任务目标 6
三、系统定义 7
3.1 系统边界 7
3.2 用户视图 7
四、需求分析 9
4.1 用户需求说明 9
4.1.1 数据需求 9
4.1.2 事务需求 9
4.2 系统需求说明 10
五、数据库逻辑设计 12
5.1 ER图 12
5.2 数据字典 12
5.3 关系表 13
六、 数据库物理设计 16
6.1索引 16
6.2视图 16
6.3安全机制 16
6.4其他 17
七、 应用程序设计 18
7.1功能模块 18
7.2界面设计 18
7.3事务设计: 24
八、测试和运行 44
8.1基础信息的查询/修改/删除: 44
8.2车辆或配件采购的提交和相关查询: 48
8.3车辆预订/销售的添加和相关查询: 54
九、总结 67
9.1系统优点: 67
9.2系统不足: 67
9.3个人感想: 67
参考文献 69
四、需求分析
4.1 用户需求说明
4.1.1 数据需求
实体集:
车辆信息(合格证号,车牌号,品牌,车型,含税成本,颜色,
状态)
用户信息(身份证号码,姓名,性别,电话,住址)
汽车配件(配件编号,配件名,生产成本,售价)
员工信息(身份证号码,姓名,性别,电话,地址,类别)
仓库信息(仓库编号,仓库名,仓库容量,管理员身份证号)
供应商信息(供应商编号,供应商名称,供应商电话,供应商地址)
联系集:
车辆销售/预订(合格证号,用户ID,员工ID,方式‘销售’or‘预订’,付款金额,时间)
车辆/配件采购(合格证号/配件编号,员工ID,供应商编号,采购时间,采购金额)
车辆附加配件(合格证号,配件编号,员工ID,费用,时间,服务类型)
车辆/配件存储(合格证号/配件编号,仓库编号)
4.1.2 事务需求
数据录入:
车辆销售/预订信息录入、用户信息录入、员工信息录入、仓库信息录入、员工采购(车辆/配件)信息录入、供应商信息录入
数据更新/修改;
客户、员工、仓库、供应商信息的修改和更新、客户预订车辆信息的结算、删除,客户预订失效信息的更新、库存车辆的转移。
数据查询:
客户、员工、仓库、供应商信息的查询、客户购车信息以及预订信息的查询、客户维修保养加装信息的查询、财务收入/支出查询、库存车辆/配件信息的查询,车辆/配件采购单的查询。
4.2 系统需求说明
性能要求:
软件应能保证系统运行稳定,避免系统崩溃;
软件必须保证有足够的数据精度,不影响正常业务;
查询某条记录的时间小于3秒。
更新/修改某条记录的时间少于4秒。
对数据进行有效性验证的时间少于1秒。(对任何输入都要进行有效性检查,对部分错误产生报错信息)
生成报表的时间少于5秒。
操作要求:
拥有良好的交互界面,操作简单的同时保证一定的安全性;
对某些特定需求产生相应的输出供用户打印(发票开具);
不同种类的用户拥有不同的权限,绝对禁止越权级操作;(权限越高的用户,操作流程越严密)
数据容量要求:
运行在本软件系统上的各类数据的最大规模约为40GB(服务器硬盘大小),由于只是一个轻量级的服务器,未来的数据规模的增加会产生不良后果;
事务故障处理说明:
用户个人设备的硬件故障可能造成本软件不能运行或不能正常进行输入/输出等后果,系统的资源不足及网络的运输通道阻塞可能造成本软件运行效果不佳,上述故障的处理由用户自行解决。
软件在运行过程中产生的数据库错误,将由系统自动记入错误日志,非网络传输引起的错误将由系统管理员或软件开发者解决。
软件在运行过程中产生的其他错误,将根据情况由软件开发者或系统管理员协助解决。
数据库的备份与恢复:
数据库每周进行一次的完整备份,每天一次差异备份,每半小时一次事务日志备份。数据库的恢复应该由开发人员或管理人员进行。
主页代码如下:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>汽车4S销售后台系统</title>
<link href="style/authority/main_css.css" rel="stylesheet" type="text/css" />
<link href="style/authority/zTreeStyle.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="scripts/jquery/jquery-1.7.1.js"></script>
<script type="text/javascript" src="scripts/zTree/jquery.ztree.core-3.2.js"></script>
<script type="text/javascript" src="scripts/authority/commonAll.js"></script>
<script type="text/javascript">
/**退出系统**/
function logout(){
if(confirm("您确定要退出本系统吗?")){
window.location.href = "signin.jsp";
}
}
/**获得当前日期**/
function getDate01(){
var time = new Date();
var myYear = time.getFullYear();
var myMonth = time.getMonth()+1;
var myDay = time.getDate();
if(myMonth < 10){
myMonth = "0" + myMonth;
}
document.getElementById("day_day").innerHTML = myYear + "." + myMonth + "." + myDay;
}
</script>
<script type="text/javascript">
/* zTree插件加载目录的处理 */
var zTree;
var setting = {
view: {
dblClickExpand: false,
showLine: false,
expandSpeed: ($.browser.msie && parseInt($.browser.version)<=6)?"":"fast"
},
data: {
key: {
name: "resourceName"
},
simpleData: {
enable:true,
idKey: "resourceID",
pIdKey: "parentID",
rootPId: ""
}
},
callback: {
onClick: zTreeOnClick
}
};
var curExpandNode = null;
function beforeExpand(treeId, treeNode) {
var pNode = curExpandNode ? curExpandNode.getParentNode():null;
var treeNodeP = treeNode.parentTId ? treeNode.getParentNode():null;
for(var i=0, l=!treeNodeP ? 0:treeNodeP.children.length; i<l; i++ ) {
if (treeNode !== treeNodeP.children[i]) {
zTree.expandNode(treeNodeP.children[i], false);
}
}
while (pNode) {
if (pNode === treeNode) {
break;
}
pNode = pNode.getParentNode();
}
if (!pNode) {
singlePath(treeNode);
}
}
function singlePath(newNode) {
if (newNode === curExpandNode) return;
if (curExpandNode && curExpandNode.open==true) {
if (newNode.parentTId === curExpandNode.parentTId) {
zTree.expandNode(curExpandNode, false);
} else {
var newParents = [];
while (newNode) {
newNode = newNode.getParentNode();
if (newNode === curExpandNode) {
newParents = null;
break;
} else if (newNode) {
newParents.push(newNode);
}
}
if (newParents!=null) {
var oldNode = curExpandNode;
var oldParents = [];
while (oldNode) {
oldNode = oldNode.getParentNode();
if (oldNode) {
oldParents.push(oldNode);
}
}
if (newParents.length>0) {
for (var i = Math.min(newParents.length, oldParents.length)-1; i>=0; i--) {
if (newParents[i] !== oldParents[i]) {
zTree.expandNode(oldParents[i], false);
break;
}
}
}else {
zTree.expandNode(oldParents[oldParents.length-1], false);
}
}
}
}
curExpandNode = newNode;
}
function onExpand(event, treeId, treeNode) {
curExpandNode = treeNode;
}
/** 用于捕获节点被点击的事件回调函数 **/
function zTreeOnClick(event, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("dleft_tab1");
zTree.expandNode(treeNode, null, null, null, true);
if(treeNode.isParent){
return false;
}
// 如果节点路径为空或者为"#",不允许单击操作
if(treeNode.accessPath=="" || treeNode.accessPath=="#"){
alert("节点路径为空或者为'#'哦...");
return false;
}
// 跳到该节点下对应的路径, 把当前资源ID(resourceID)传到后台,写进Session
rightMain(treeNode.accessPath);
if( treeNode.isParent ){
$('#here_area').html('当前位置:'+treeNode.getParentNode().resourceName+' > <span style="color:#1A5CC6">'+treeNode.resourceName+'</span>');
}else{
$('#here_area').html('当前位置:系统 > <span style="color:#1A5CC6">'+treeNode.resourceName+'</span>');
}
};
/* 上方菜单 */
function switchTab(tabpage,tabid){
var oItem = document.getElementById(tabpage).getElementsByTagName("li");
for(var i=0; i<oItem.length; i++){
var x = oItem[i];
x.className = "";
}
if('left_tab1' == tabid){
$(document).ajaxStart(onStart).ajaxSuccess(onStop);
// 异步加载"业务模块"下的菜单
loadMenu('YEWUMOKUAI', 'dleft_tab1');
}else if('left_tab2' == tabid){
$(document).ajaxStart(onStart).ajaxSuccess(onStop);
// 异步加载"系统管理"下的菜单
loadMenu('XITONGMOKUAI', 'dleft_tab1');
}else if('left_tab3' == tabid){
$(document).ajaxStart(onStart).ajaxSuccess(onStop);
// 异步加载"其他"下的菜单
loadMenu('QITAMOKUAI', 'dleft_tab1');
}
}
$(document).ready(function(){
$(document).ajaxStart(onStart).ajaxSuccess(onStop);
/** 默认异步加载"业务模块"目录 **/
loadMenu('YEWUMOKUAI', "dleft_tab1");
// 默认展开所有节点
if( zTree ){
// 默认展开所有节点
zTree.expandAll(false);
}
});
function loadMenu(resourceType, treeObj){
data =
[{"accessPath":"","checked":false,"delFlag":0,"parentID":1,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":2,"resourceName":"系统管理","resourceOrder":0,"resourceType":""},
{"accessPath":"staff_list.jsp","checked":false,"delFlag":0,"parentID":2,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":21,"resourceName":"查看员工信息","resourceOrder":0,"resourceType":""},
{"accessPath":"staff_edit.jsp","checked":false,"delFlag":0,"parentID":2,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":22,"resourceName":"添加员工信息","resourceOrder":0,"resourceType":""},
{"accessPath":"pswd_edit.jsp","checked":false,"delFlag":0,"parentID":2,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":23,"resourceName":"修改密码","resourceOrder":0,"resourceType":""},
{"accessPath":"","checked":false,"delFlag":0,"parentID":1,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":3,"resourceName":"销售管理","resourceOrder":0,"resourceType":""},
{"accessPath":"car_subscribe_list.jsp","checked":false,"delFlag":0,"parentID":3,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":31,"resourceName":"查看车辆预订单","resourceOrder":0,"resourceType":""},
{"accessPath":"car_subscribe_edit.jsp","checked":false,"delFlag":0,"parentID":3,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":32,"resourceName":"添加车辆预订单","resourceOrder":0,"resourceType":""},
{"accessPath":"car_sales_list.jsp","checked":false,"delFlag":0,"parentID":3,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":33,"resourceName":"查看车辆销售单","resourceOrder":0,"resourceType":""},
{"accessPath":"car_sales_edit.jsp","checked":false,"delFlag":0,"parentID":3,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":34,"resourceName":"添加车辆销售单","resourceOrder":0,"resourceType":""},
{"accessPath":"car_parts_edit.jsp","checked":false,"delFlag":0,"parentID":3,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":35,"resourceName":"加装维修保养","resourceOrder":0,"resourceType":""},
{"accessPath":"car_parts_list.jsp","checked":false,"delFlag":0,"parentID":3,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":36,"resourceName":"查看加装维修保养","resourceOrder":0,"resourceType":""},
{"accessPath":"","checked":false,"delFlag":0,"parentID":1,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":4,"resourceName":"库存管理","resourceOrder":0,"resourceType":""},
{"accessPath":"car_storage_list.jsp","checked":false,"delFlag":0,"parentID":4,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":41,"resourceName":"库存车辆信息","resourceOrder":0,"resourceType":""},
{"accessPath":"parts_storage_list.jsp","checked":false,"delFlag":0,"parentID":4,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":42,"resourceName":"库存配件信息","resourceOrder":0,"resourceType":""},
{"accessPath":"storage_list.jsp","checked":false,"delFlag":0,"parentID":4,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":43,"resourceName":"查询仓库信息","resourceOrder":0,"resourceType":""},
{"accessPath":"storage_edit.jsp","checked":false,"delFlag":0,"parentID":4,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":44,"resourceName":"添加仓库信息","resourceOrder":0,"resourceType":""},
{"accessPath":"","checked":false,"delFlag":0,"parentID":1,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":5,"resourceName":"进货管理","resourceOrder":0,"resourceType":""},
{"accessPath":"car_purchase_list.jsp","checked":false,"delFlag":0,"parentID":5,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":51,"resourceName":"查看汽车采购订单","resourceOrder":0,"resourceType":""},
{"accessPath":"parts_purchase_list.jsp","checked":false,"delFlag":0,"parentID":5,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":52,"resourceName":"查看配件采购订单","resourceOrder":0,"resourceType":""},
{"accessPath":"car_purchase_edit.jsp","checked":false,"delFlag":0,"parentID":5,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":53,"resourceName":"添加汽车采购订单","resourceOrder":0,"resourceType":""},
{"accessPath":"parts_purchase_edit.jsp","checked":false,"delFlag":0,"parentID":5,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":54,"resourceName":"添加采购配件订单","resourceOrder":0,"resourceType":""},
{"accessPath":"supplier_list.jsp","checked":false,"delFlag":0,"parentID":5,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":55,"resourceName":"查看供货商信息","resourceOrder":0,"resourceType":""},
{"accessPath":"supplier_edit.jsp","checked":false,"delFlag":0,"parentID":5,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":56,"resourceName":"添加供货商信息","resourceOrder":0,"resourceType":""},
{"accessPath":"","checked":false,"delFlag":0,"parentID":1,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":6,"resourceName":"财务管理","resourceOrder":0,"resourceType":""},
{"accessPath":"ListCharge","checked":false,"delFlag":0,"parentID":6,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":61,"resourceName":"财务支出表","resourceOrder":0,"resourceType":""},
{"accessPath":"ListIncome","checked":false,"delFlag":0,"parentID":6,"resourceCode":"","resourceDesc":"","resourceGrade":3,"resourceID":62,"resourceName":"财务收入表","resourceOrder":0,"resourceType":""},
{"accessPath":"","checked":false,"delFlag":0,"parentID":1,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":7,"resourceName":"客户管理","resourceOrder":0,"resourceType":""},
{"accessPath":"customer_list.jsp","checked":false,"delFlag":0,"parentID":7,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":71,"resourceName":"查看客户信息","resourceOrder":0,"resourceType":""},
{"accessPath":"customer_edit.jsp","checked":false,"delFlag":0,"parentID":7,"resourceCode":"","resourceDesc":"","resourceGrade":2,"resourceID":72,"resourceName":"添加客户信息","resourceOrder":0,"resourceType":""}
];
// 如果返回数据不为空,加载"业务模块"目录
if(data != null){
// 将返回的数据赋给zTree
$.fn.zTree.init($("#"+treeObj), setting, data);
zTree = $.fn.zTree.getZTreeObj(treeObj);
if( zTree ){
// 默认收缩所有节点
zTree.expandAll(false);
}
}
}
//ajax start function
function onStart(){
$("#ajaxDialog").show();
}
//ajax stop function
function onStop(){
$("#ajaxDialog").hide();
}
</script>
</head>
<body onload="getDate01()">
<div id="top">
<div id="top_logo">
<b style="color:white;font-size:30px;">汽车销售管理系统</b>
</div>
<div id="top_links">
<div id="top_op">
<ul>
<li>
<img alt="当前用户" src="images/common/user.jpg">:
<li><p><%=session.getAttribute("username") %></p></li>
</li>
<li>
<img alt="今天是" src="images/common/date.jpg">:
<span id="day_day"></span>
</li>
</ul>
</div>
<div id="top_close">
<a href="javascript:void(0);" onclick="logout();" target="_parent">
<img alt="退出系统" title="退出系统" src="images/common/close.jpg" style="position: relative; top: 10px; left: 25px;">
</a>
</div>
</div>
</div>
<!-- side menu start -->
<div id="side">
<div id="left_menu">
<ul id="TabPage2" style="height:200px; margin-top:50px;">
<li id="left_tab1" class="selected" onClick="javascript:switchTab('TabPage2','left_tab1');" title="业务模块">
<img alt="业务模块" title="业务模块" src="images/common/1_hover.jpg" width="33" height="31">
</li>
</ul>
<div id="nav_show" style="position:absolute; bottom:0px; padding:10px;">
<a href="javascript:;" id="show_hide_btn">
<img alt="显示/隐藏" title="显示/隐藏" src="images/common/nav_hide.png" width="35" height="35">
</a>
</div>
</div>
<div id="left_menu_cnt">
<div id="nav_module">
<img src="images/common/module_1.png" width="210" height="58"/>
</div>
<div id="nav_resource">
<ul id="dleft_tab1" class="ztree"></ul>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
$('#TabPage2 li').click(function(){
var index = $(this).index();
$(this).find('img').attr('src', 'images/common/'+ (index+1) +'_hover.jpg');
$(this).css({background:'#fff'});
$('#nav_module').find('img').attr('src', 'images/common/module_'+ (index+1) +'.png');
$('#TabPage2 li').each(function(i, ele){
if( i!=index ){
$(ele).find('img').attr('src', 'images/common/'+ (i+1) +'.jpg');
$(ele).css({background:'#044599'});
}
});
// 显示侧边栏
switchSysBar(true);
});
// 显示隐藏侧边栏
$("#show_hide_btn").click(function() {
switchSysBar();
});
});
/**隐藏或者显示侧边栏**/
function switchSysBar(flag){
var side = $('#side');
var left_menu_cnt = $('#left_menu_cnt');
if( flag==true ){ // flag==true
left_menu_cnt.show(500, 'linear');
side.css({width:'280px'});
$('#top_nav').css({width:'77%', left:'304px'});
$('#main').css({left:'280px'});
}else{
if ( left_menu_cnt.is(":visible") ) {
left_menu_cnt.hide(10, 'linear');
side.css({width:'60px'});
$('#top_nav').css({width:'100%', left:'60px', 'padding-left':'28px'});
$('#main').css({left:'60px'});
$("#show_hide_btn").find('img').attr('src', 'images/common/nav_show.png');
} else {
left_menu_cnt.show(500, 'linear');
side.css({width:'280px'});
$('#top_nav').css({width:'77%', left:'304px', 'padding-left':'0px'});
$('#main').css({left:'280px'});
$("#show_hide_btn").find('img').attr('src', 'images/common/nav_hide.png');
}
}
}
</script>
<!-- side menu start -->
<div id="top_nav">
<span id="here_area">当前位置:系统 > 系统介绍</span>
</div>
<div id="main">
<iframe name="right" id="rightMain" src="introduce.html" frameborder="no" scrolling="auto" width="100%" height="100%" allowtransparency="true"/>
</div>
<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='utf-8'></script></div>
</body>
</html>
更多推荐
所有评论(0)