J2EE 漫画杂志 详细设计说明书.docx
- 文档编号:5390324
- 上传时间:2023-05-08
- 格式:DOCX
- 页数:19
- 大小:146.22KB
J2EE 漫画杂志 详细设计说明书.docx
《J2EE 漫画杂志 详细设计说明书.docx》由会员分享,可在线阅读,更多相关《J2EE 漫画杂志 详细设计说明书.docx(19页珍藏版)》请在冰点文库上搜索。
J2EE漫画杂志详细设计说明书
在线动漫杂志
详细设计说明书
课程名称:
JAVAEE课程设计
院系:
项目成员:
编写人:
任课教师:
指导教师:
二零一一年六月
目录
1引言3
1.1项目的研究背景和目的3
1.2背景4
2、程序系统的结构5
3、程序设计说明5
3.1、程序描述5
3.2、功能5
3.4输入项7
3.5输出项7
3.6、算法8
3.7流程逻辑16
3.8接口21
3.9注释设计21
3.10限制条件21
3.11测试计划22
3.12尚未解决的问题23
1引言
1.1项目的研究背景和目的
中国已经提出经过5年至10年时间,动漫产业至少要占GDP1%的发展目标。
这意味着,我国动漫产业未来至少具有1000亿元产值的巨大发展空间。
风靡一时的期刊杂志「画书大王」应时而生,从开始疯狂盗版日本漫画到后来因为政府行为而不得不改变策略支持原创,再到后来的停刊,虽然只有仅仅不到两年的时间,但它无疑是中国漫画史上革命性的刊物,为培养中国漫画创作人走出了重要的一步。
而后,中国漫画进入了漫长的冰河时期,体制的落后、市场的混乱、认知的偏差以及国外盗版漫画的盛行,均使得本土漫画发展举步维艰,倍受冷落,只有极少数漫画爱好者在黑暗中艰难创业。
随着网络的发展以及在各个方面对于人们日常生活的渗透,漫画的迎来了又一个迅猛发展的时期。
与此同时,政府加大了对动漫的关注与投入以后,许多出版机构和民间资本开始不断进入动漫行业,使本土漫画燃起了星星之火。
近年来,通过网络游戏、COSPLAY秀和国外动漫多渠道进入的影响,并在一批本土漫画创业者的积极推动下,中国漫画市场延续了进入新千年以后迅猛的发展势头,并且步伐变得更加大步流星。
1.2背景
考虑到当前漫画产业的发展现状和网络技术的发展,在这个领域充满了机会,经过小组成员共同讨论,我们决定要开发的系统的是《在线动漫杂志》,该系统将由小组6人共同完成,通过这个平台的实现提高我们JAVAEE的应用水平,同时也能更好地了解我们共同的爱好——漫画,为漫画产业的发展添砖加瓦,也让自己未来的发展方向多了一种可能。
2、程序系统的结构
3、程序设计说明
3.1、程序描述
该系统主要是实现网上在线浏览漫画及其周边小说COS等,满足漫画爱好者之间的心得交流,开辟相应的论坛。
会员对于网站管理也能提出一些建议。
系统开发的特点是:
采用B/S结构,数据主要保存在服务器中,并且满足并发处理,多个类可重用。
3.2、功能
该系统的功能有:
1、用户权限的管理。
2、数据库的设计与实现,由于网站预期访问量非常大,且集中程度很高,因此数据库的设计工作量非常大。
3、漫画及周边搜索(主要按名称搜索,也可按连载日期或作者搜索)。
4、COS经典搜索。
5、上传功能。
6、漫画、图片页面展示。
6、更新提示。
7、漫画、小说、图片等内容管理。
8、论坛搭建。
9、过刊管理。
10、人气排行显示。
11、论坛精华显示。
12、广告服务。
3.4输入项
名称
标识符
数据类型
有效范围
输入方式
数据来源
用户名
userID
String
字符数大于6
手动输入
用户
密码
password
String
字符数大于6
手动输入
用户
昵称
username
String
字符数大于0
手动输入
用户
QQ号
QQnumber
int
字符数为8或11
手动输入
用户
电子邮件
string
包含@和.
手动输入
用户
最爱风格
Lovestyle
String
大于5位
手动输入
用户
最爱作者
Lovewriter
String
字符数大于0
手动输入
用户
搜索内容
searchContent
String
不能为空
手动输入
用户
评价
evaluation
String【】
不能为空
手动输入
用户
3.5输出项
名称
标识符
数据类型
有效范围
输出方式
数据来源
用户名
username
String
不能为空
页面显示
数据库
漫画
Tel
Int
字符数为8或11
页面显示
数据库
电子邮件
string
包含@和.
页面显示
数据库
家庭地址
address
String
大于5位
页面显示
数据库
商品类型
goodsType
String
字符数大于0
页面显示
数据库
商品数量
goodsAmount
String
数值大于0
页面显示
数据库
商店地址
goodsAddress
String
字符数大于6
页面显示
数据库
价格
Price
Int
大于0
页面显示
数据库
搜索结果
searchContent
String和image
不能为空
页面显示
数据库
订单结果
Record
String[]
不能为空
页面显示
数据库
营业统计
Settlement
String[]
不能为空
页面显示
数据库以及计算
交易记录
transactionRecord
String[]
不能为空
页面显示
数据库
评价
Evaluation
String[]
不能为空
页面显示
数据库
3.6、算法
Model类的实现:
数据的插入:
clientLogin:
(以clientLogin类为例)
publicvoidinsertData()//往表中插入记录
{
SqlConnectioncon=newSqlConnection("DataSource=.\\SQLEXPRESS;InitialCatalog=nationTrade;IntegratedSecurity=True");
con.Open();
SqlCommandInsertCommand=newSqlCommand("INSERTINTOclientLoginVALUES(@userID,@password,@authority)",con);
"@password",SqlDbType.VarChar,12);
InsertCommand.Parameters["@password"].Value=password;
"@userID",SqlDbType.VarChar,16);
InsertCommand.Parameters["@userID"].Value=userID;
"@authority",SqlDbType.VarChar,12).Value=authority;
InsertCommand.ExecuteNonQuery();
con.Close();
}
数据更新:
SqlConnectioncon=newSqlConnection("DataSource=.\\SQLEXPRESS;InitialCatalog=nationTrade;IntegratedSecurity=True");
con.Open();
SqlCommandcommand=newSqlCommand("updateclientLoginsetpassword=@password,authority=@authoritywhereuserID=@userID",con);
"@password",SqlDbType.VarChar,12);
command.Parameters["@password"].Value=password;
"@userID",SqlDbType.VarChar,16);
command.Parameters["@userID"].Value=userID;
"@authority",SqlDbType.VarChar,12).Value=authority;
command.ExecuteNonQuery();
con.Close();
数据查询:
获取单一字段:
publicStringgetImageUrl(StringuserID)//查询头像路径
{
SqlConnectioncon=newSqlConnection("DataSource=.\\SQLEXPRESS;InitialCatalog=nationTrade;IntegratedSecurity=True");
con.Open();
SqlCommandselectCommand=newSqlCommand("selectuserPhotofromSellerInfowhereuserID=@userID",con);
"@userID",SqlDbType.VarChar,1000).Value=userID;
SqlDataReaderdataReader=selectCommand.ExecuteReader();
if(dataReader.Read())
{
Stringscore=dataReader.GetString(0);
con.Close();
returnscore;
}
else
{
con.Close();
returnnull;
}
}
获取多个字段值:
publicString[]getSellerRegisterInfo(StringuserID)
{
SqlConnectioncon=newSqlConnection("DataSource=.\\SQLEXPRESS;InitialCatalog=nationTrade;IntegratedSecurity=True");
con.Open();
SqlCommandselectCommand=newSqlCommand("selectuserName,sex,IDCard,accountfromSellerInfowhereuserID=@userID",con);
"@userID",SqlDbType.VarChar,1000).Value=userID;
String[]infor=newString[4];
SqlDataReaderdataReader=selectCommand.ExecuteReader();
if(dataReader.Read())
{
infor[0]=dataReader.GetString(0);
infor[1]=dataReader.GetString
(1);
infor[2]=dataReader.GetString
(2);
infor[3]=dataReader.GetString(3);
con.Close();
returninfor;
}
else
{
con.Close();
returnnull;
}
}
判断记录是否存在:
(以判断商店是否存在为例):
publicintisHasShop(StringuserID)//判断是否已经存在商店
{
SqlConnectioncon=newSqlConnection("DataSource=.\\SQLEXPRESS;InitialCatalog=nationTrade;IntegratedSecurity=True");
con.Open();
SqlCommandselectCommand=newSqlCommand("selectisLookOverfromseller_ShopRelationswheresellerID=@userID",con);
"@userID",SqlDbType.VarChar,16).Value=userID;
SqlDataReaderdataReader=selectCommand.ExecuteReader();
intscore=-1;
if(dataReader.Read())
{
score=dataReader.GetInt32(0);
}
else
{
score=-1;
}
returnscore;
}
购物车的实现:
加入购物车的商品的购买信息的数据结构
publicclassgoodsInTrolley
{
publicintgoodsID;//商品ID
publicintshopID;//商店ID
publicStringgoodsName;//商品名
publicStringshopName;//商店名
publicintamount;//数量
publicfloatprice;//单价
publicfloatsumMoney;//总价
publicStringtype;//商品类型
publicgoodsInTrolley()
{
//
//TODO:
在此处添加构造函数逻辑
//
}
publicgoodsInTrolley(intgoodsID,intamount)
{
this.goodsID=goodsID;
this.amount=amount;
GoodsInforExtendgoodsInfor=newGoodsInforExtend();
String[]infor=goodsInfor.getGoodsMainInfor(goodsID);
this.goodsName=infor[0];
this.price=float.Parse(infor[1]);
this.type=infor[2];
this.shopID=int.Parse(infor[3]);
this.shopName=infor[4];
sumMoney=price*amount;
}
}
购物车类:
publicclassTrolley
{
publicArrayListgoodsList=newArrayList();//购物车商品列表
publicStringbuyerID;//买家ID
publicTrolley(StringbuyerID)
{
//
//TODO:
在此处添加构造函数逻辑
//
this.buyerID=buyerID;
}
publicvoidaddGoods(goodsInTrolleygoods)
{
inttag=0;//判断购物车是否已经加入此商品
foreach(goodsInTrolleyoneGoodingoodsList)
{
if(oneGood.goodsID==goods.goodsID)
{
tag=1;
oneGood.amount=oneGood.amount+goods.amount;
}
}
if(tag!
=1)
{
goodsList.Add(goods);
}
}
publicvoiddeleteGoods(goodsInTrolleygoods)
{
foreach(goodsInTrolleyoneGoodingoodsList)
{
if(oneGood.goodsID==goods.goodsID)
{
goodsList.Remove(oneGood);
}
}
}
publicboolsettlement()
{
GoodsInforExtendgoodsInfor=newGoodsInforExtend();
SqlConnectioncon=newSqlConnection("DataSource=.\\SQLEXPRESS;InitialCatalog=nationTrade;IntegratedSecurity=True");
con.Open();
SqlCommandcommand=con.CreateCommand();
foreach(goodsInTrolleygoodingoodsList)
{
intshopID=good.shopID;
intamount=good.amount;
floatsumMoney=good.sumMoney;
if(amount =-1)//库存量充足 { //事务处理 SqlTransactionmyTrans=con.BeginTransaction("tran"); command.Connection=con; con.Open(); try { command.CommandText="selectamountfromGoodsholdlockwheregoodsID=@goodsIDwaitfordelay'00: 00: 20'"; "@goodsID",good.goodsID); SqlDataReaderdataReader=command.ExecuteReader(); intsurplus=0; if(dataReader.Read()) { surplus=dataReader.GetInt32(0);//读取库存 } if(amount>surplus)//库存不够 myTrans.Rollback();//回滚 command.CommandText="updateGoodssetamount=amount-@buyAmountwheregoodsID=@goodsID"; "@buyAmount",amount); "@goodsID",good.goodsID); command.ExecuteNonQuery();//修改库存 //插入交易记录 command.CommandText="INSERTINTOGoodsTransactionRecord(buyerID,shopID,goodsID,amount,money,date,isSuccess)VALUES(@buyerID,@shopID,@goodsID,@amount,@money,@date,@isSuccess)"; "@goodsID",SqlDbType.Int,16); command.Parameters["@goodsID"].Value=good.goodsID; "@shopID",SqlDbType.Int,16); command.Parameters["@shopID"].Value=shopID; "@buyerID",SqlDbType.VarChar,16); command.Parameters["@buyerID"].Value=buyerID; "@amount",SqlDbType.Int,12); command.Parameters["@amount"].Value=amount; "@money",SqlDbType.Float,16); command.Parameters["@money"].Value=sumMoney; "@date",SqlDbType.DateTime,16); command.Parameters["@date"].Value=DateTime.Now; "@isSuccess",SqlDbType.Int,16).Value=0; command.ExecuteNonQuery(); //事务提交 myTrans.Commit(); returntrue; } catch(Exceptionex) { Console.WriteLine("RollbackExceptionType: {0}",ex.GetType()); returnfalse; } } 其中包含的函数的功能有: 往购物车中添加商品信息,将购物车中的购买信息写入数据库并用到数据库的锁机制和事务处理在ASP.NET的应用 Controller类的实现: 以卖家信息注册为例: publicvoidsellerRegister(StringuserID,intshopID,StringuserName,Stringsex,StringIDCard,StringuserPhoto,Stringaccount) { SellerInfosellerInfor=newSellerInfo(userID,shopID,userName,sex,IDCard,userPhoto,account);//调用MODEL类 SellerInfoExtendsellerExtend=newSellerInfoExtend(); if(! sellerExtend.isHasSeller(userID)) { sellerInfor.insertData();//调用Moodel类 } else { sellerInfor.updateSubmit();//调用Model类 } } 3.7流程逻辑 用户注册流程: 商品购买流程 买家收货流程: 评价流程: 3.8接口 3.9注释设计 (1)加在模块首部的注释: 用于说明模块的整体功能 (2)加在各分支点处的注释: 用于说明验证的条件 (3)加在各变量上的注释: 用于说明变量存储的数据的意义 (4)加在使用的逻辑的注释: 用于说明 3.10限制条件 (1)最好在IE7以上浏览器运行 (2)一个用户对应一个论坛昵称 3.11测试计划 对用户基本信息注册(买家注册)功能的测试: 用户名字段 输入数据 预期结果 空 提示出错 位数小于6位的字符窜 提示出错 位数大于等于6位的字符窜 正常 密码字段 输入数据 预期结果 空 报错 位数
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- J2EE 漫画杂志 详细设计说明书 漫画 杂志 详细 设计 说明书