




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、軟件工程課程設(shè)計(jì)報(bào)告軟件工程課程設(shè)計(jì)報(bào)告班級(jí):班級(jí):軟件軟件 xxx 姓名:姓名:xxx 學(xué)號(hào):學(xué)號(hào):xx4 指導(dǎo)教師:指導(dǎo)教師: 郭鵬飛郭鵬飛 遼寧工程技術(shù)大學(xué)軟件學(xué)院目目錄錄1 1 設(shè)計(jì)內(nèi)容設(shè)計(jì)內(nèi)容 .1 12 2 概要設(shè)計(jì)概要設(shè)計(jì) .1 12.1 數(shù)據(jù)庫(kù)設(shè)計(jì) .12.1.1 數(shù)據(jù)庫(kù) e-r 圖.12.1.2 .12.1.3 數(shù)據(jù)庫(kù)表設(shè)計(jì).22.2 邏輯結(jié)構(gòu)設(shè)計(jì) .22.2.1 酒店管理系統(tǒng)數(shù)據(jù)流圖.22.2.2 數(shù)據(jù)字典.33 3 詳細(xì)設(shè)計(jì)詳細(xì)設(shè)計(jì) .4 44 4 程序源碼程序源碼 .5 54.1 客房申請(qǐng) .54.2 退房申請(qǐng) .64.3 查看 .95 5 程序運(yùn)行與調(diào)試程序運(yùn)行與調(diào)試
2、 .9 95.1 酒店入住頁(yè)面 .95.2 退房 .105.3 查詢 .106 6 總結(jié)總結(jié) .1111參考文獻(xiàn)參考文獻(xiàn).1212成績(jī)?cè)u(píng)定成績(jī)?cè)u(píng)定.1212 1 設(shè)計(jì)內(nèi)容酒店管理系統(tǒng):實(shí)現(xiàn)住房,退房,住房人數(shù)統(tǒng)計(jì)等功能2 概要設(shè)計(jì)2.1 數(shù)據(jù)庫(kù)設(shè)計(jì)2.1.1 數(shù)據(jù)庫(kù) e-r 圖圖 2-1 e-r2.1.2住戶(序號(hào),姓名,性別,身份證號(hào))房間(房號(hào),類型,人數(shù))所?。ㄐ蛱?hào),房號(hào))所住房間房號(hào)類型房號(hào)序號(hào)序號(hào)身份證號(hào)姓名住戶性別n1人數(shù)2.1.3 數(shù)據(jù)庫(kù)表設(shè)計(jì)表 2-1 住戶-person列名列名(table)類型長(zhǎng)度非空序號(hào)numberint4是姓名namevarchar20是性別sexcha
3、r4否身份證號(hào)idint18是表 2-2 房間-room列名列名(table)類型長(zhǎng)度非空房號(hào)roomidint4是類型typevarchar4否人數(shù)numint4否表 2-3 所住-relax列名列名(table)類型長(zhǎng)度非空序號(hào)numberint4是房號(hào)idint4是2.2 邏輯結(jié)構(gòu)設(shè)計(jì)2.2.1 酒店管理系統(tǒng)數(shù)據(jù)流圖酒店管理系統(tǒng)數(shù)據(jù)流圖圖 2-2 數(shù)據(jù)流圖房間檢查住房信息住房信息管理員統(tǒng)計(jì)信息住房標(biāo)識(shí)人數(shù)統(tǒng)計(jì)退房標(biāo)識(shí)結(jié)賬處理退房房間房間信息結(jié)賬款項(xiàng)退房申請(qǐng)住房信息住房申請(qǐng)入住系統(tǒng)住戶2.2.2 數(shù)據(jù)字典圖 2-3圖 2-4圖 2-5圖 2-6名字:住房信息別名:描述:房間擁有的信息定義:
4、住房信息=房間號(hào)+房間人數(shù)+住房類型位置:交給住戶房間申請(qǐng)退房申請(qǐng)名字:樓層號(hào)別名:定義:樓層號(hào)=1數(shù)字1位置:名字:房間號(hào)別名:定義:房間號(hào)=2數(shù)字2位置:名字:房間號(hào)別名:描述:房間的編號(hào)定義:房間號(hào)=樓層號(hào)+房間號(hào)位置:3 3 詳細(xì)設(shè)計(jì)詳細(xì)設(shè)計(jì)3.1 酒店管理系統(tǒng)程序流程圖圖 3-1 酒店管理系統(tǒng)程序流程圖房間檢查申請(qǐng)成功登記結(jié)賬房間檢查顯示結(jié)束房間申請(qǐng)房間申請(qǐng)房間申請(qǐng)用戶申請(qǐng)統(tǒng)計(jì)申請(qǐng)退房申請(qǐng)選擇功能開始4 4 程序源碼程序源碼4.1 客房申請(qǐng)主要思想:輸入身份證號(hào),查看房間的剩余,進(jìn)行入住 request.setcharacterencoding(utf-8);servletconte
5、xt application = getservletcontext();string leixing= (string) application.getattribute(leixing);string roomno = (string) application.getattribute(roomno); datasource ds = null;context context;try context = new initialcontext();ds = (datasource) context.lookup(java:/comp/env/jdbc/mysqlds); catch (nam
6、ingexception e) e.printstacktrace();system.out.println(獲取數(shù)據(jù)源錯(cuò)誤!);try string sql = select * from room where statue=? and roomno=?;queryrunner run = new queryrunner(ds);string str=leixing,roomno;list list=(list) run.query(sql,str,new beanlisthandler(room.class);if(list.isempty()request.getrequestdispa
7、tcher(/servlet/insertroom).forward(request,response);elseservletcontext application1= getservletcontext(); application1.setattribute(roomno,roomno);application1.setattribute(leixing,leixing);requestdispatcher rs=request.getrequestdispatcher(/servlet/insertroom);tryrs.forward(request,response);return
8、;catch (exception e) catch (sqlexception e) e.printstacktrace();try string sql=select clientname,sex,shenfenzheng,roomnumber from client where yuding=1;queryrunner run = new queryrunner(ds);list list = (list) run.query(sql, new beanlisthandler(dbcommen.class);request.setattribute(list,list);request.
9、getrequestdispatcher(/main/yudingruzhu.jsp).forward(request,response);catch(sqlexception e) e.printstacktrace();4.2 退房申請(qǐng)客戶退房模塊設(shè)計(jì)是:輸入房間號(hào)后查詢客戶信息及消費(fèi)情況;在輸出之前首先要預(yù)先查詢房間號(hào)是否有人入住,再修改數(shù)據(jù)庫(kù)信息,最后顯示客戶的信息及消費(fèi)情況。退房設(shè)計(jì)思想為:當(dāng)輸入房間號(hào)后到 trueroom2 控制塊中查詢?cè)摲块g是否已經(jīng)入住,到滿足條件時(shí),到 insertroom 對(duì)數(shù)據(jù)庫(kù)插入退房時(shí)間,然后再到getall 控制塊查詢:客戶信息,房間入住,退房時(shí)間以
10、及客戶消費(fèi)信息。最后到 all.jsp 頁(yè)面顯示所有信息。然后結(jié)賬,退房。request.setcharacterencoding(utf-8);string roomno = request.getparameter(roomno);string leixing= request.getparameter(leixing);try string sql = select * from room where statue=? and roomno=?;queryrunner run = new queryrunner(ds);string str = leixing, roomno ;list
11、 list = (list)run.query(sql, str, new beanlisthandler(room.class);servletcontext application1 = getservletcontext();application1.setattribute(roomno, roomno);application1.setattribute(leixing, leixing);requestdispatcher rs = request.getrequestdispatcher(/servlet/insertroom);try rs.forward(request, r
12、esponse);return; catch (exception e) catch (sqlexception e) e.printstacktrace();insertroom 的實(shí)現(xiàn)如下:request.setcharacterencoding(utf-8);servletcontext application = getservletcontext();string leixing = (string) application.getattribute(leixing);string roomno= (string) application.getattribute(roomno);s
13、ystem.out.println(roomno);system.out.println(leixing); int i=integer.parseint(leixing);int result = 0;string message = null;string sql=null;try switch(i)case 0:sql=update room set statue=1 where roomno=?;break;case 1:sql=update room set statue=2,startdate=now() where roomno=?;break;case 2:sql=update
14、 room set enddate=now() where roomno=?;break; string sr = roomno;queryrunner run = new queryrunner(ds);result = run.update(sql, sr);if(i=1) sql=update client set yuding=2 where roomnumber=?; queryrunner run1 = new queryrunner(ds); run1.update(sql, sr);if(i=2)servletcontext application1 = getservletc
15、ontext();application1.setattribute(roomno, roomno);requestdispatcher rs = request.getrequestdispatcher(/servlet/seachall);try rs.forward(request, response);return; catch (exception e) elseif (result = 1) message = 操作成功!; else message = 操作失敗!;request.setattribute(message, message);request.getrequestd
16、ispatcher(/addresult.jsp).forward(request,response); catch (sqlexception e) e.printstacktrace();seachall的實(shí)現(xiàn)如下:request.setcharacterencoding(utf-8);servletcontext application = getservletcontext();string roomno = (string) application.getattribute(roomno);string consumerno = 123456;datasource ds = null
17、;string sql = null;try sql = select clientname,sex,shenfenzheng from client where yuding=2 and roomnumber=?;queryrunner run = new queryrunner(ds);string str = roomno ;list list = (list) run.query(sql, str, new beanlisthandler(dbcommen.class);dbcommen bl = (dbcommen) list.get(0);request.setattribute(
18、bl, bl);sql = select roomno,startdate,enddate,timestampdiff(day,startdate,enddate) as day from room where statue=2 and roomno=?;list list1 = (list) run.query(sql, str, new beanlisthandler(room.class);room room1 = (room) list1.get(0);request.setattribute(room1, room1);sql = select * from consumer whe
19、re consumerno=?;string str1 = consumerno ; list list2 = (list) run.query(sql, str1, new beanlisthandler(consumer.class);consumer cm = (consumer) list2.get(0);request.setattribute(cm, cm);if(list.isempty()|list1.isempty()|list2.isempty()system.out.println(讀取失?。?;elserequest.getrequestdispatcher(/seac
20、hall.jsp).forward(request,response); catch (sqlexception e) e.printstacktrace();4.3 查看房間查詢的思想為:先到 getallroom 控制塊對(duì)條件進(jìn)行處理,將滿足條件的房間號(hào)的數(shù)組放到 room.class 中,再到 roomseach.jsp 頁(yè)面將數(shù)組顯示出來。try sql = select roomno,statue,startdate,enddate from room; queryrunner run = new queryrunner(ds);list list = (list) run.quer
21、y(sql, new beanlisthandler(room.class); request.setattribute(list,list); request.getrequestdispatcher(/main/roomseach.jsp).forward(request,response); catch (sqlexception e) e.printstacktrace();5 5 程序運(yùn)行與調(diào)試程序運(yùn)行與調(diào)試5.1 酒店入住頁(yè)面圖 5-1 入住5.2 退房5-2 酒店退房管理5.3 查詢5-3 住戶查詢頁(yè)面6 6 總結(jié)總結(jié)通過一段時(shí)間的設(shè)計(jì)與編寫,該酒店管理系統(tǒng)終于有了一個(gè)比較完整的框架?,F(xiàn)將心得體會(huì)總結(jié)如下:由于時(shí)間倉(cāng)促,這暫時(shí)只是一個(gè)簡(jiǎn)單的管理系統(tǒng),但從設(shè)計(jì)這個(gè)系統(tǒng)的過程中,我感受到了關(guān)于軟件工程,數(shù)據(jù)庫(kù)設(shè)計(jì)、商業(yè)管理等各方面知識(shí)在實(shí)際工作中的應(yīng)用。在開發(fā)該系統(tǒng)過程中,我始終堅(jiān)持以下四項(xiàng)原則,并朝相應(yīng)目標(biāo)靠攏: (1)實(shí)用為主任何系統(tǒng)都應(yīng)該以用戶需求為最終目標(biāo),以方便用戶為最高原
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 內(nèi)蒙古2025年普通高中學(xué)業(yè)水平選擇性考試適應(yīng)性演練地理試題(八省聯(lián)考)
- 第18課 科技文化成就(教學(xué)設(shè)計(jì))-2023-2024學(xué)年八年級(jí)歷史下冊(cè)新課標(biāo)同步教學(xué)教學(xué)設(shè)計(jì)與教學(xué)設(shè)計(jì)(人教部編版)
- 吉林省部分名校2023-2024學(xué)年高二上學(xué)期期末聯(lián)合考試地理試題(解析版)
- 黑龍江省哈爾濱市重點(diǎn)三校2023-2024學(xué)年高三上學(xué)期期末聯(lián)考地理試題(解析版)
- 2025至2030年中國(guó)無心外圓研磨機(jī)床數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 商業(yè)計(jì)劃書格式要求
- 2025年廣西工業(yè)職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)傾向性測(cè)試題庫(kù)完整版
- 陜西省考試錄用公務(wù)員職位專業(yè)參考目錄(修訂)
- 二零二五年度職業(yè)院校教師專業(yè)發(fā)展師徒協(xié)議書
- 2025年度飛防作業(yè)項(xiàng)目融資合同
- 中英文對(duì)照版 ASTM B594 2019 鋁合金形變產(chǎn)品超聲波檢測(cè)標(biāo)準(zhǔn)慣例
- 五年級(jí)下冊(cè)道德與法治教學(xué)計(jì)劃
- 2025屆高考數(shù)學(xué)專項(xiàng)復(fù)習(xí):阿基米德三角形【六大題型】含答案
- 高中語文2021學(xué)年專題復(fù)習(xí)-外國(guó)文學(xué)訓(xùn)練題【含詳解】
- 中華民族共同體概論教案第十六講-文明新路與人類命運(yùn)共同體
- 鄉(xiāng)鎮(zhèn)教育管理中心2025年教育教學(xué)工作計(jì)劃
- 哈爾濱鐵道職業(yè)技術(shù)學(xué)院?jiǎn)握小墩Z文》考試復(fù)習(xí)題庫(kù)(含答案)
- 2024年中考模擬試卷語文(考試版A4)
- 1醫(yī)學(xué)圖像處理緒論課件
- 校園門禁系統(tǒng)升級(jí)方案
- 神經(jīng)內(nèi)科一病區(qū)不良事件PDCA-
評(píng)論
0/150
提交評(píng)論