畢業(yè)設(shè)計(論文)基于j2ee結(jié)構(gòu)的網(wǎng)上商城的設(shè)計與實現(xiàn)_第1頁
畢業(yè)設(shè)計(論文)基于j2ee結(jié)構(gòu)的網(wǎng)上商城的設(shè)計與實現(xiàn)_第2頁
畢業(yè)設(shè)計(論文)基于j2ee結(jié)構(gòu)的網(wǎng)上商城的設(shè)計與實現(xiàn)_第3頁
畢業(yè)設(shè)計(論文)基于j2ee結(jié)構(gòu)的網(wǎng)上商城的設(shè)計與實現(xiàn)_第4頁
畢業(yè)設(shè)計(論文)基于j2ee結(jié)構(gòu)的網(wǎng)上商城的設(shè)計與實現(xiàn)_第5頁
已閱讀5頁,還剩32頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、商丘職業(yè)技術(shù)學(xué)院畢業(yè)設(shè)計(論文)題目:基于J2EE吉構(gòu)的網(wǎng)上商城的設(shè)計與實現(xiàn)系部:軟件學(xué)院專業(yè):軟件技術(shù)班級:軟件(2)班學(xué)號:0909340214姓名: 吳XX指導(dǎo)教師:張XX 完成日期: 2011年5月_6_日商丘職業(yè)技術(shù)學(xué)院軟件技術(shù)畢業(yè)論文 摘要隨著社會的發(fā)展,科技的進步,作為信息載體的計算機日益顯露出其舉足輕 重的地位。當(dāng)今社會已步入了信息社會,知識經(jīng)濟將成為新世紀(jì)的主導(dǎo)產(chǎn)業(yè)。 伴 隨計算機的逐步推廣和使用,計算機已在科研、生產(chǎn)、商業(yè)、服務(wù)等許多方面創(chuàng) 造了提高效率的途徑。特別是人類進入新千年以來,信息產(chǎn)業(yè)得到飛速發(fā)展。經(jīng)濟的全球化,人們 生活在動態(tài)流通的環(huán)境中,也越來越需求及時,互動

2、,反饋的為標(biāo)準(zhǔn)的服務(wù)產(chǎn)品。 In ternet 飛速發(fā)展使互聯(lián)網(wǎng)成為人們快速獲取發(fā)布和傳遞信息的重要渠道,也 使電子商務(wù)平臺得到廣泛的應(yīng)用,特別是阿里巴巴(支付寶)、中銀控(Chinapay) 等大型公司的第三方支付平臺的相繼推出,使網(wǎng)絡(luò)購物功能日趨完善和成熟??梢哉f電子商務(wù)正改變著人們已有的生活方式。其在改善生活質(zhì)量的同時,在用戶體驗方面也得到很大提升。因此,本文著眼于電子商務(wù)平臺,從基于網(wǎng)上商城系統(tǒng)入手,模擬淘寶網(wǎng)、 京東商城、當(dāng)當(dāng)網(wǎng)等三大網(wǎng)購門戶網(wǎng)站,以服務(wù)器瀏覽器(B/ S)架構(gòu),整合 最新web2.0開發(fā)的Hibernate3.x+Struts2.x+Jquery開源框架,嘗試對網(wǎng)上

3、購物系統(tǒng)的各功能模塊及業(yè)務(wù)邏輯作出簡要淺析,并對部分用例給出具體實現(xiàn)。關(guān)鍵字:網(wǎng)上購物;購物車;權(quán)限管理;訂單AbstractWith the social developme nt, tech no logical adva nces, in creas ing the computer as an information carrier revealing his important position. Todays society has entered the information society, knowledge-based economy will be the leadin

4、g industry in the new century. With the gradual promotion and use of the computer, the computer in scie ntific research, product ion, commerce, services, and many other aspects to create a more efficie nt way.In particular the new millennium, mankind has been the rapid development of information ind

5、ustry. Economic globalization, the flow of people live in a dynamic en vir onment, more and more dema nd for timely, in teractive feedback as the sta ndard of service products. The rapid development of Internet makes quick access to the Internet become an importa nt issue and tran sfer of in formati

6、o n cha nn els, e-commerce platform also widely used, especially Ali Baba (Alipay), Bank of Con trol (Ch in apay) and other large third-party payment platform company launched to make online shopp ing fun cti ons are beco ming more perfect and mature. Can be said that electro nic commerce is cha ngi

7、ng peoples way of life has bee n. I mprove the quality of life in the same time, the user experience has also been greatly improved.Therefore, this paper focuses on e-commerce platform, starti ng from the On li ne Shopping Mall-based, simulation Taobao, Jingdong Mall, Dangdang three major online sho

8、pping portal to the server - the browser (B / S) architecture, integrating the latest web2. 0 developed Hiber nate3.x + Struts2.x + Jquery ope n source framework, try on li ne shopp ing system and the fun cti onal modules of bus in ess logic to make a brief, and gives some con crete realizati on of

9、use casesKeywords: on li ne shopp ing; shopp ing cart; rights man ageme nt; orders目錄 TOC o 1-5 h z 前言1. HYPERLINK l bookmark8 o Current Document 項目需求及設(shè)計說明2 HYPERLINK l bookmark10 o Current Document 1.1項目開發(fā)環(huán)境2. HYPERLINK l bookmark12 o Current Document 1.2技術(shù)實現(xiàn)2. HYPERLINK l bookmark14 o Current Docum

10、ent 1.3名稱解釋:2. HYPERLINK l bookmark16 o Current Document 1.4項目背景.3. HYPERLINK l bookmark18 o Current Document 1.5用例模塊描述用戶權(quán)限 4 HYPERLINK l bookmark22 o Current Document 1.5.2我的訂單4 HYPERLINK l bookmark24 o Current Document 商品展示 51.5.4購物車5 HYPERLINK l bookmark26 o Current Document 項目設(shè)計說明5. HYPER

11、LINK l bookmark28 o Current Document 2.1系統(tǒng)基本架構(gòu) 5. HYPERLINK l bookmark42 o Current Document 2.2數(shù)據(jù)庫設(shè)計6.類另表(Category) 6商品表(Product) 6用戶表(Users) 7收件人地址表(receive_address) 72.2.5選購條目表(item) 7訂單表(Order) 8訂單項表(OrderLine) 8 HYPERLINK l bookmark44 o Current Document 2.3領(lǐng)域模型&com.wuyf.actions.authorize 8com.wu

12、yf.atcions.order 8com.wuyf.actions.cart 8com.wuyf.actions.main 9 HYPERLINK l bookmark52 o Current Document 2.4業(yè)務(wù)模型.wuyf.service.CartService 9com.wuyf.service.OrderService 10com.wuyf.service.UserService 10com.wuyf.service.CategoryService 11 HYPERLINK l bookmark54 o Current Document 用例實現(xiàn)12 HYPERLINK l

13、 bookmark56 o Current Document 3.1功能概述前臺運營12 HYPERLINK l bookmark58 o Current Document 3.1.2后臺管理12 HYPERLINK l bookmark74 o Current Document 3.1.3后臺服務(wù) 13 HYPERLINK l bookmark96 o Current Document 3.2代碼實現(xiàn)13 HYPERLINK l bookmark98 o Current Document 3.2.1用戶權(quán)限管理 13 HYPERLINK l bookmark108 o Cur

14、rent Document 3.2.2用戶注冊 19 HYPERLINK l bookmark118 o Current Document 3.2.3用戶激活 20 HYPERLINK l bookmark140 o Current Document 3.3商品信息分類瀏覽23 HYPERLINK l bookmark146 o Current Document 3.4訂單生成24 HYPERLINK l bookmark148 o Current Document 3.5代碼結(jié)構(gòu)分類明細26 HYPERLINK l bookmark150 o Current Document 結(jié)論27. H

15、YPERLINK l bookmark152 o Current Document 參考文獻28 HYPERLINK l bookmark176 o Current Document 致謝29商丘職業(yè)技術(shù)學(xué)院軟件技術(shù)畢業(yè)論文 計算機信息管理中的廣泛使用,也使得網(wǎng)絡(luò)購物越來越普遍,給顧客帶來很大便利。建立一個網(wǎng)絡(luò)商城系統(tǒng)能更加有效率的進行商品的買賣活動,使顧客可以在商城中輕松購物,并完成商品和貨幣的交易。極大的方便了人們的生活,使 合法的直銷模式成為可能。并將為促進商品經(jīng)濟的流通呈現(xiàn)新局面創(chuàng)造條件。 WEB2.0理念的融入,進一步提升了用戶的個人體驗,使使用者從單一的信息瀏 覽者到信息的發(fā)布者、

16、決策者之間轉(zhuǎn)變。本文用例的設(shè)計,參照真實企業(yè)項目IDG投資兄弟公司“當(dāng)當(dāng)網(wǎng)”門戶系 統(tǒng)中的“在線購書系統(tǒng)”。嘗試基于J2EE的企業(yè)級應(yīng)用中的核心技術(shù)和開發(fā)流程, 簡要給出設(shè)計文檔,并對部分功能模塊給出必要分析。該項目包含基本模塊有: 用戶權(quán)限管理、商品分類瀏覽、后臺服務(wù)、訂單生成及與之相對應(yīng)的數(shù)據(jù)庫表的 設(shè)計。后臺服務(wù)主要包括:日志服務(wù)、訂表單的維護和對用戶數(shù)據(jù)進行及時收集、 加工、整理、貯存、檢索、傳遞、反饋等。從本文著手?jǐn)M題到最終的成稿,筆者參考了大量JavaWeb方面的資料,其間也多次幾易其稿,目的也是為了論文的日臻完善。 計算機技術(shù)飛速發(fā)展,用戶 需求的提高使得網(wǎng)上購物系統(tǒng)的開發(fā)和測試

17、變得異常復(fù)雜,而本人也只能算是 J2EE平臺項目開發(fā)的入門者,加之模塊完成布署后進行單元測試方面的限制 (比 如可供實際操作的數(shù)據(jù)庫、WEB服務(wù)器),本文只對用戶權(quán)限管理、分類瀏覽、 購物車、訂單生成等模塊給出具體實現(xiàn),其余部分給出的是需求分析。與本文檔相應(yīng)的同源代碼將一并發(fā)布項目需求及設(shè)計說明1.1項目開發(fā)環(huán)境開發(fā)平臺:WINDOWS XP開發(fā)工具:MyEclipse 6.0 + JDK1.6服務(wù)支持:tomcat服務(wù)器+ Mysql數(shù)據(jù)庫1.2技術(shù)實現(xiàn)本系統(tǒng)基于J2EE企業(yè)級應(yīng)用核心所采用的技術(shù)主要為 CoreJava、Servlet、 JSP、XMLMV(設(shè)計模式下所采用的開源框架主要有

18、: 數(shù)據(jù)持久層Hibernate3.1 ; 流程控制Struts2.1.6 。WEB網(wǎng)頁方面的HTML/CSS JavaScript 、Jquery、異步刷新頁面 Ajax及 動態(tài)網(wǎng)頁邏輯控制的JSTL標(biāo)記和OGNL寸象導(dǎo)航圖語言1.3名詞解釋:注冊用戶(Register User本系統(tǒng)的使用權(quán)面向所有公眾,以游客 身份進入系統(tǒng)時可以瀏覽部分商品, 并可將所選擇的商品加入購物車。但無法為 所購商品支付并生成有效訂單。注冊用戶在數(shù)據(jù)庫中有對應(yīng)記錄,用戶在使用注 冊用戶登錄時可以選購并為商品支付、生成訂單注冊用戶包含的信息:用戶名,E-Mail地址,昵稱,登錄密碼,激活碼,用 戶積分,登錄IP等。

19、激活碼(Activation Code普通用戶在完成注冊時系統(tǒng)會自動生成一個激活碼并按用戶所提供的郵件地址發(fā)到用戶郵箱,用戶只有登錄到有效郵箱進行激活后才能進行下一步操作,用戶也可以選擇注冊時暫不激活等下次使用時 才激活。用戶積分(User Integral)用戶在每完成一筆交易后都可或取一定 的積分,用戶可以使用該積分充抵相應(yīng)面值的貨幣, 或者在商家指定的商品范圍 內(nèi)享受優(yōu)惠。1.3.4.商品目錄:(Product Category:為了使系統(tǒng)可維護,具有更大 的開放性。商城中所列的所有商品不是通過靜態(tài)頁面返給用戶的,而是根據(jù)數(shù)據(jù)庫里數(shù)據(jù)動態(tài)生成的。商品的目錄關(guān)系在數(shù)據(jù)庫中由主外鍵關(guān)系關(guān)聯(lián)著

20、135.購物車:(Shop Cart)對于每一合法登錄的使用者系統(tǒng)都會自動 分配一個購物車供用戶使用,使用者可將所需要的商品添加到購物車中,該購物車可在多個頁面間共享。1.3.6.訂單(Order Item):用戶在確認(rèn)交易后,根據(jù)登錄信息、收件人地 址和購物車?yán)锏膬?nèi)容生成一個訂單。以備商家根據(jù)訂單的詳細內(nèi)容對用戶進行發(fā)1.4項目背景近年來隨著計算機的日益普及和網(wǎng)絡(luò)(特別是因特網(wǎng))的迅速發(fā)展,在 全球范圍內(nèi)形成了一種新的企業(yè)經(jīng)營方式,他們把所有的商業(yè)活動和貿(mào)易往來電 子化,利用發(fā)達的網(wǎng)絡(luò)環(huán)境 進行快速有效的商業(yè)活動。這就是最近成為世界上最 熱門的話題:電子商務(wù)。其實,電子商務(wù)這個概念起源于七十

21、年代,在那時,一些大公司通過建立自己的計算機網(wǎng)絡(luò)實現(xiàn)各個機構(gòu)之間、商業(yè)伙伴之間的信息共享、交換,這就是廣 為流行的電子數(shù)據(jù)交換(EDI)。電子數(shù)據(jù)交換是一種為滿足企業(yè)需要而發(fā)展起來 的先進技術(shù)手段,必須遵照統(tǒng)一的國際標(biāo)準(zhǔn)。EDI通過傳遞標(biāo)準(zhǔn)的數(shù)據(jù)流可以避免人為的失誤,大大地降低成本、提高效率?,F(xiàn)在,因特網(wǎng)為電子商務(wù)帶來了飛 速的增長,電子商務(wù)會越來越成為主流的商務(wù)活動方式,但EDI是電子商務(wù)的基 礎(chǔ),并且EDI技術(shù)已經(jīng)擺脫了以前舊式的昂貴的公司獨立網(wǎng)絡(luò),而融入到因特網(wǎng) 中。當(dāng)今世界網(wǎng)絡(luò)、通信和信息技術(shù)的發(fā)展,In ternet在全球迅速普及,使得商 業(yè)空間發(fā)展到全球的規(guī)模,同時也使得現(xiàn)代商業(yè)企

22、業(yè)需要具有不間斷地供貨能 力、不斷增長的客戶需求和不斷增長的全球競爭三大特征,這使得任何一個商業(yè) 組織都必須調(diào)整自己的經(jīng)營方式和產(chǎn)業(yè)結(jié)構(gòu), 以適應(yīng)新的市場發(fā)展的需要。因此, 任何一個企業(yè)要在21世紀(jì)生存,就必須迅速地改變傳統(tǒng)的經(jīng)營觀念, 跟上當(dāng)今世 界發(fā)展的最新潮流,加入到電子商務(wù)大潮中。那么,什么是電子商務(wù)?簡單地講,電子商務(wù)利用現(xiàn)有的計算機硬件設(shè)備、 軟件和網(wǎng)絡(luò)基礎(chǔ)設(shè)施,通過一定的協(xié)議連接起來的電子網(wǎng)絡(luò)環(huán)境進行各種各樣商 務(wù)活動的方式。更廣泛地說,凡是利用國際互聯(lián)網(wǎng)進行商務(wù)活動的一種方式就是 電子商務(wù)。電子商務(wù)以其高效率、低廉、高收益、全球化等傳統(tǒng)經(jīng)營方式所無 法比擬的優(yōu)點受到全球的關(guān)注。

23、美國、歐盟等發(fā)達的國家或組織已經(jīng)采取措施大 力發(fā)展電子商務(wù)。我國政府也大力倡導(dǎo)電子商務(wù)。專家預(yù)測,公司和公司之間的 電子商務(wù)貿(mào)易額將從1997年的56億美元發(fā)展到2002年的2680億;個人網(wǎng)上購物將 從1997年的18億發(fā)展到2002年的260億。因此,電子商務(wù)中蘊涵著無窮的商業(yè)機 遇。NWAP NetShopping WEB 即plication platform簡稱 NWA)是應(yīng)虛擬商家所求推出的一款通用的 WEB應(yīng)用平臺產(chǎn)品,可以幫助您提供構(gòu)筑專業(yè)的電子商務(wù) 平臺的基礎(chǔ)。1.5用例模塊描述商品展示:實現(xiàn)商品預(yù)覽、商品明細、分類檢索功能。購物車:實現(xiàn)添加商品、刪除列表、恢復(fù)列表、數(shù)量修改

24、、清空購物車、結(jié)算功能。我的訂單:實現(xiàn)訂單確認(rèn)、訂單列表、刪除訂單、查詢明細功能。用戶管理:實現(xiàn)登入/登出、用戶注冊、信息修改功能。151.用戶權(quán)限:用戶在瀏覽器地址欄輸入本系統(tǒng)的 URL后進入主頁面,若當(dāng)前用戶為第一次 登錄即為游客身份,游客所擁有的權(quán)限僅為瀏覽商品、登錄,注冊等。游客在沒 有注冊時不具有登錄用戶所享有一些功能,這其中包括生成訂單、修改訂單、查 看個人信息、修改密碼、查看積分,安全退出登錄狀態(tài)等。1.5.2.我的訂單實現(xiàn)訂單確認(rèn)、訂單列表、刪除訂單、查詢明細功能。在用戶確認(rèn)所選購商品后,若前提用戶已經(jīng)登錄可以進一步讓用戶輸入收件人地址并生成訂單, 若用 戶尚未登錄在生成訂單時

25、將會將用戶引導(dǎo)到登錄頁面。廠商可以根據(jù)訂單時的商 品信息和收件人地址對消費者進行發(fā)貨1.5.3.商品展示實現(xiàn)商品預(yù)覽、商品明細、分類檢索功能。在進入查詢頁面后,使用者點擊查詢,頁面會根據(jù)用戶輸入的篩選條件進行與后臺數(shù)據(jù)庫動態(tài)交互,將返回符合條件全部商品信息,并按系統(tǒng)預(yù)設(shè)分頁呈現(xiàn)給用戶,用戶就可以跟據(jù)表單列出的 詳細信息選擇適合自己所需要的商品,并在本條目后面的鏈結(jié)處點擊購買。154購物車實現(xiàn)添加商品、刪除列表、恢復(fù)列表、數(shù)量修改、清空購物車、結(jié)算功能。根據(jù)用戶點擊商品的購買鏈接將商品添加到購物車中。進入到購物車瀏覽頁面時 表單中文本框使用者可以跟自己意愿設(shè)置購買的數(shù)量。 或者刪除商品,注意此處

26、 的商品并不是真在刪除,而是被緩存了,在需要的時候仍可能恢復(fù)。該系列操作 完成之后可以返回到上一級進行其它操作或者查看購買信息。2、項目設(shè)計說明2.1系統(tǒng)基本架構(gòu):本系統(tǒng)是NWAP-V1.0的升級版本,在之前版本設(shè)計是基于GUI(圖形用戶界面),即BS架構(gòu)的,而V1.1融入了 WEB 2.0技 術(shù),使用的是客戶機瀏覽器的模式即:CS架構(gòu)Tr&Sriirv I圖2-1-1系統(tǒng)基本架構(gòu)圖2-1-2各系統(tǒng)模塊的關(guān)系及基本流程2.2數(shù)據(jù)庫設(shè)計2.2.1 類別表(category)字段名稱類型約束描述category idin tegerpk類別idPare nt idin tegernot n ull

27、父類別idNamevarchar(128)not n ull類別名Descripti onvarchar(512)/類別說明TrunIn t(10)Not null目錄的排序2.2.2 商品表(product)字段名稱類型約束描述product _idin tegerauto in creme nt/商品idpkNamevarchar(40)not n ull商品名fixed priceDoublenot n ull商品訂價單價dan g_priceDoubleNot nul商城買價Authorvarchar(128)not nul作者Publishvarchar(256)not nul出版社

28、Pagesint/頁數(shù)product picvarchar(128)/圖片Descripti onvarchar(512)/描述2.2.3 用戶表(users)字段名稱類型約束描述Idin t(12)not n ull用戶主鍵Nick namevarchar(20)not null用戶昵稱Passwordvarchar(12)not n ull密碼Emailvarchar(32)not n ullEmailuser in tegralin t(12)default 0用戶積分is email verifychar(3)/郵箱是否激活email verify codevarchar(32)def

29、ault NULL郵箱激活碼last login timein t(20)default NULL最后登錄時間last login ipvarchar(15)default NULL最后登錄IP2.2.4 收件人地址表(receive_addresS字段名稱類型約束描述Idin t(12)pk地址idreceiveamevarchar(20)not n ull收件人姓名full addressvarchar(64)not n ull地址全稱user idin t(11)not n ull用戶IDpostal codevarchar(8)not n ull郵編Mobilevarchar(15)d

30、efault null手機Pho nevarchar(20)default null固定電話2.2.5 選購條目表(item)字段名稱類型約束描述Idin t(10)pk條目idproduct idin t(10)not n ull商品IDorder idin t(10)not n ull訂單idproduct namevarchar(100)not n ull商品名稱dan g pricedoublenot n ull商品價格product numin t(10)not n ull購買數(shù)量226 訂單表(order)字段名稱類型約束描述Idintauto_ in creme nt/ pk訂單

31、iduser idin t(10)not n ull用戶IDStatusIntnot n ull訂單狀態(tài)order_timeIn t(20)not n ull訂單時間order descvarchar(200)default null訂單描述total pricedoublenot n ull訂單總金額227 訂單項表(orderline)字段名稱類型約束描述orderli nedin tegerauto_ in creme nt/ pk訂單項idorders idin tegernot n ull訂單idproduct idin tegernot n ull商品idAmountnumeric

32、(20,2)not n ull商品數(shù)量2.3領(lǐng)域模型com.wuyf.actions.authorize類名屬性封裝AuthorizeActio n user validateCodeAuthorizeVerifyActi on emailVerifyCodeLogi nActionuserRedriectActi onurl功能說明封裝從頁面提交過來用戶信息封裝系統(tǒng)生成郵箱激活碼封裝頁面提交過來的用戶登錄信息根據(jù)業(yè)務(wù)邏輯處理結(jié)果跳轉(zhuǎn)到相關(guān)頁面com.wuyf.actions.order類名屬性封裝功能說明OrderActio nOrderActio nOrderActio nordermap

33、Addressaddress根據(jù)購物車信息生成用戶訂單從數(shù)據(jù)庫中取該用戶上次提交的地址信息封裝用戶輸入的一個全新地址com.wuyf.actions.cart類名屬性封裝CartAct ion cartItems功能說明所選購商品信息條目CartActionsavePrice通過本商城購買商品共結(jié)省的費用CartActiontotalPrice此次交易商品的總費用com.wuyf.actions.main類名屬性封裝功能說明CategoryActi onlistCatesBookListActi onbooksHotActi onhotBooksNewActio nn ewBooks當(dāng)前目錄下

34、所包含的子目錄在所選目錄下所包含的商品列表信息最近熱賣的商品最新上架的商品Recomme ndAct ionrecomme ndBooks商家推薦的商品2.4業(yè)務(wù)模型2.4.1 com .wuyf.service .CartService方法功能說明參數(shù)說明返回值說明publicvoid增加條目將用戶所選購的/addCartltem(CartltemcartItem);商品圭寸裝成一個條目增加到購物/publicvoiddeleteCartItem(CartIt刪除條目車em cartItem);要刪除的條目/publicvoidrecoveyCartItem(CartI恢復(fù)上次刪除的要恢復(fù)的

35、條目/tem cartItem);條目publicvoid更新商品數(shù)量要更新的條目/updateCartltem(Cartltem cartItem);publicdoubletotalPrice();總價格遍歷每一商品算出總價格publicdoublesavePrice();省下的費用通過本商城購買publicvoid所省下的總費用clearCart();清空購物車將購物車清空2.4.2 com .wuyf.service .OrderService方法定義功能說明參數(shù)說明返回值類型public List createOrderltems(CartServ ice cartService);

36、創(chuàng)建訂單列表購物車業(yè)務(wù)對象訂單列表public OrdercreateOrder(List根據(jù)Session中購物車業(yè)務(wù)對象訂單對象items,CartService存儲的信息生成訂單列表cartService);orderpublicMapvl nteger,ReceiveAddress根據(jù)userId查出用戶ID用戶一地址getReceiveAddressList(I nt eger userId);用戶之前用過的映射列表地址publicvoid用戶、用戶地址、無submitOrder(User user, ReceiveAddress address, Order order);提交訂單

37、訂單對在象243 com .wuyf.service .UserService方法定義功能說明參數(shù)說明返回值類型public User addUser(User增加新用戶表單提交過來新用戶對user, HttpServletRequest的用戶信息象request);public User更新用戶信息用戶對象用戶對象updateUser(User user);public User用戶對象fin dByEmail(Stri ng email);根據(jù)郵箱找到用郵箱地址public User戶findById(Integer id);根據(jù)用戶ID查用戶ID用戶對象public User找用戶val

38、idateUser(User user,HttpServletRequest request);publicvoid logout(MapStri ng. Object注銷用戶Session中的用無sessi on);publicboolea n戶activeUser(Stri ng根據(jù)郵箱驗證碼Session激活碼激活成功emailVerifyCode,Map sessi on);激活用戶與否244 com .wuyf.service .CategoryService方法定義功能說明參數(shù)說明返回值類型public List createCategory(I ntege r pare ntld

39、);根據(jù)父類目錄ID加載所有子目錄父類目錄ID目錄列表public Category fin dCatByld(l nteger id);根據(jù)ID找到某一目 錄所需要查找的ID目錄對象public Curre ntBooks getCurrre ntBooks(Cate gory category, In teger sc, In teger ssc, In teger page,intpageSize);獲取當(dāng)前目錄下的商品信息當(dāng)前目錄、分頁查詢條件商品信息3 用例實現(xiàn)3.1功能概述系統(tǒng)功能模塊分為以下幾部分:前臺營業(yè),后臺管理,后臺服務(wù)3.1.1前臺運營用戶注冊、登錄/登出1.1登錄1.2

40、退出登錄狀態(tài)1.3重新登錄分類瀏覽2.1分類瀏覽商品列表2.2最新上架商品、商家推薦、商品熱賣榜購物車3.1將所需商品添加到購物車3.2修改所購買商品數(shù)目3.3刪除不滿意的商品3.4恢復(fù)上次誤刪的商品3.5結(jié)算3.6清空購物車訂單生成4.1查找該用戶以前所填寫的收件地址4.2全新輸入一個收貨地址4.3確認(rèn)所購商品信息無誤4.4訂單最終生成,訂單信息錄入數(shù)據(jù)庫3.1.2后臺管理:1商品管理1.1查詢已有商品信息1.2查詢最近熱賣商品1.3增加新到貨商品1.4將新到貨商品上架用戶帳戶管理2.1查詢用戶2.2添加用戶2.3刪除用戶2.4更改用戶營業(yè)記錄管理3.1查詢營業(yè)記錄3.2導(dǎo)出到excel表3

41、.3確認(rèn)二級結(jié)算4管理員管理4.1添加角色4.2刪除角色4.3更改角色權(quán)3.1.3后臺服務(wù):1日志服務(wù)1.1記錄營業(yè)日志一記錄營業(yè)記錄信息1.2記錄賬戶日志-記錄帳戶登錄,登出等信息1.3記錄錯誤日志一記錄運行時發(fā)生的錯誤消息1.4記錄管理日志一記錄管理員對系統(tǒng)做出的管理修改用戶表和商品記錄表的維護2.1處理過期商品信息數(shù)據(jù)2.2處理新上架的商品信息數(shù)據(jù)訂單表的維護3.1處理已執(zhí)行訂單數(shù)據(jù)3.2代碼實現(xiàn)3.2.1用戶權(quán)限管理實體類設(shè)計:com.wuyf.domain 對使用者的基本信息進行封裝 package com.wuyf.domain;/*DUsere ntity.* author My

42、EclipsePersistenceTools */publicclassDUserimpleme ntsjava.io.Serializable / FieldsprivateIn tegerid ;privateStri ngemail ;privateStri ngnickname ;privateStri ngpassword ;privateIn tegeruserI ntegral;private Stri ng isEmailVerify ;private Stri ng emailVerifyCode ;/ Con structors/*defaultcon structor*

43、/public DUser() /*mi ni male on structor*/in tegerStringStringpublic DUser(Stri ng email, Stri ng password, userl ntegral) this . email = email;this . password = password;this . userlntegral= userlntegral;/*fullco nstructor*/publicDUser(Stri ngemail,Stri ngnickn ame,password,In tegeruserl ntegral,St

44、ri ng isEmailVerify,emailVerifyCode,Long lastLog in Time, String lastLogi nip) this .email = email;this .nickn ame=nickn ame;this .password=password;this .useri ntegral=useri ntegral;this .isEmailVerify=isEmailVerify;this .emailVerifyCode= emailVerifyCode/ Property accessors public in teger getid()

45、returnthis . id ;publicvoid setid(i nteger id) this . id = id;public Stri ng getEmail() returnthis . email ;publicvoidsetEmail(Stri ng email) this . email = email;public String getNick name() returnthis. nickname ;publicvoidsetNick name(Stri ng nickn ame) this . nickname = nickname;public Stri ng ge

46、tPassword() returnthis. password ; publicvoidsetPassword(Stri ng password) this . password = password;publicIn teger getUserI ntegral() returnthis. userIntegral ;publicvoidsetUserI ntegral( In teger userI ntegral) this . userIntegral = userIntegral;public Stri ng getlsEmailVerify() returnthis . isEm

47、ailVerify ;publicvoid setlsEmailVerify(Stri ng isEmailVerify) this . isEmailVerify = isEmailVerify;public Stri ng getEmailVerifyCode() returnthis . emailVerifyCode ;publicvoid setEmailVerifyCode(Stri ng emailVerifyCode) this . emailVerifyCode = emailVerifyCode;使用Hibernate框架實現(xiàn)數(shù)據(jù)庫表到實體類之間關(guān)聯(lián)關(guān)系映射,對 JDBC進

48、行輕 量級的封裝,用面向?qū)ο蟮膶ο蟮乃枷雭聿僮麝P(guān)系型數(shù)據(jù)庫,以下的XML配置文件用來表述:存入數(shù)據(jù)庫字段與實體類中用戶信息的對映關(guān)系。vid n ame=id colu mn n ame=id ge nerator class propertyn ame=colu mn n ame= propertyn ame=nickn amecolu mn n ame=nickn ame propertyn ame=passwordcolu mn n ame=password propertyname= userIntegralcolumn name= userIntegral propertyname=

49、 isEmailVerifycolumn name= isEmailVerify propertyname= emailVerifyCodecolumn name= emailVerifyCode /=n ative/email type =stri ng email length =200/IIII對商品的信息進行封裝package com.wuyf.domain; import java.math.BigDecimal; import java.util.Date;type len gthtype not-n ullIIII*DBooke ntity.* author MyEclipseP

50、ersistenceTools*/publicclassDBook impleme ntsprivateIn tegerid ;privateStri ngn ame;privateStri ngbookNumberprivateStri ngcompany ;privateStri ngairli neCode=stri ng=200II=stri ng =trueIInot-n ull=true/type =stri ng length =15IIII/type =string len gth =15/type =string length =15IIjava.io.Serializabl

51、e /privateDate startTime ;privateDate arriveTime ;privateBigDecimalprice ;privateBigDecimaldisco untpublicDBook() super ();/ TODOAuto-ge nerated con structor stubDatepublic DBook(l nteger id, String n ame, String bookNumber, Stri ngcompa ny,Stri ng airli neCode, Date startTime,arriveTime, BigDecimal

52、 price, BigDecimal disco unt) super ();this . id = id;this . name = name;this . bookNumber = bookNumber;this . company = company;this . airlineCode = airlineCode;this . startTime = startTime;this . arriveTime = arriveTime;this . price = price;this . discount = discount;publicString getAirli neCode()

53、 retur n airli neCode;publicvoidsetAirli neCode(Stri ng airli neCode) this . airlineCode = airlineCode;public Date getArriveTime() return arriveTime ;publicvoid setArriveTime(Date arriveTime) this . arriveTime = arriveTime;public Stri ng getBookNumber() return bookNumber ;publicvoidsetBookNumber(Str

54、i ng bookNumber) this . bookNumber = bookNumber;publicString getCompa ny() return company ;publicvoidsetCompa ny (Stri ng compa ny) this . company = company;publicBigDecimal getDisco un t() retur n disco unt ;publicvoidsetDisco un t(BigDecimal disco unt) this . discount= discount;public In teger get

55、ld() return id ;publicvoidsetId(I nteger id) this . id = id;public Stri ng getName() return n ame;publicvoidsetName(Stri ng n ame) this . name = name;public BigDecimal getPrice() return price ;publicvoid setPrice(BigDecimal price) this . price = price;public Date getStartTime() return startTime ;pub

56、licvoid setStartTime(Date startTime) this . startTime = startTime;以下的XML配置文件用來表述:存入數(shù)據(jù)庫字段與實體類中航班信息的對映關(guān) 系。vclassn ame=com.wuyf.domai n.DUsercatalog =da ngda ngtable =d userprivateIn tegerid ;privateStri ngn ame;privateStri ngbookNumber ;privateStri ngcompany ;privateStri ngairli neCode;privateDatestar

57、tTime ;privateDatearriveTime ;privateBigDecimalprice ;privateBigDecimaldisco unt ;propertyn ame=n ame type =stri ngcolu mnn ame=n ame len gth =50type len gth not-null=true /propertyn ame=bookNumbercolu mn n ame=bookNumber property n ame=compa ny type colu mn n ame=compa ny len gth propertyname= airl

58、ineCodecolumn name= airlineCode propertyn ame=startTimecolu mn n ame=startTimepropertyn ame=arriveTimecolu mn n ame=arriveTimepropertyn ame=price propertyn ame=disco un tcolu mn n ame=disco un t=stri ng=50n ot- nulltype =i nteger not-n ull =trueIItype =stri ng length =3/type =stri nglen gth =50/type

59、 =nu mber type =nu mber length =15/=true /322用戶注冊用戶在首次使用時,需使用郵箱注冊一個賬號,在用戶使用當(dāng)前輸入失去焦點時,Ajax會與后臺交互,告訴瀏覽器端該用戶名是否被占用如圖3-2-1碼實現(xiàn):public class RegistActio n exte nds Dan gAction lAuthorizeService信息錄入頁面orizeServiceServiceFactory.getAuthorizeService(); private DUser user; public DUser getUser() retur n user;p

60、ublic void setUser(DUser user) this.user = user;public Stri ng execute()/設(shè)置IP地址user.setLastLogi nlp(request.getRemoteAddr(); authorizeService.add(user);sessio n.put(C on sta nt.SESSION_USER, user); retur n success;323用戶激活package com. wuyf.acti on. authorize;import com.googlecode.js on plugi n.ann ot

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論