基于JAVA超市賬單管理系統(tǒng)畢業(yè)設(shè)計_第1頁
基于JAVA超市賬單管理系統(tǒng)畢業(yè)設(shè)計_第2頁
基于JAVA超市賬單管理系統(tǒng)畢業(yè)設(shè)計_第3頁
基于JAVA超市賬單管理系統(tǒng)畢業(yè)設(shè)計_第4頁
基于JAVA超市賬單管理系統(tǒng)畢業(yè)設(shè)計_第5頁
已閱讀5頁,還剩58頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

目錄摘要 IAbstract II1正文 11.1研究背景分析 11.2超市賬單管理系統(tǒng)的概述 21.3所需軟、硬件技術(shù)準備 21.4可行性分析 31.4.1技術(shù)可行性 31.4.2經(jīng)濟可行性 31.4.3社會可行性 32需求分析 42.1需求分析的任務(wù)及主要內(nèi)容 42.2.1具體業(yè)務(wù)的需求 42.2層次圖 42.3數(shù)據(jù)流圖 53概要設(shè)計 53.1系統(tǒng)分析 53.1.1系統(tǒng)的總體分析 63.2數(shù)據(jù)庫的設(shè)計與實現(xiàn) 63.2.1數(shù)據(jù)庫系統(tǒng)分析 73.2.2數(shù)據(jù)庫物理實現(xiàn) 74詳細設(shè)計 94.1Servlet的詳細應(yīng)用 94.2特定模塊的詳細介紹 94.2.1登陸模塊 94.2.2賬單管理模塊 154.2.2供應(yīng)商管理模塊 214.2.3用戶管理模塊 265系統(tǒng)測試 32結(jié)語 33注釋 34參考文獻 35致謝 37附錄1 381正文1.1研究背景分析超級市場是以顧客自選方式經(jīng)營的大型綜合性零售商場,又稱自選商場。是許多國家特別是經(jīng)濟發(fā)達國家的主要商品零售組織形式。超級市場于20世紀30年代初最先出現(xiàn)在美國東部地區(qū)。我國超市市場形成于20世紀90年代初期,現(xiàn)在已經(jīng)成為我國零售業(yè)的一種重要形態(tài),為國民經(jīng)濟的發(fā)展發(fā)揮了重要的作用。隨著超市行業(yè)的高速發(fā)展,最初的售貨員站柜臺的銷售方式已不能滿足現(xiàn)有的銷售業(yè)的發(fā)展,因此迫切的需要引入新的管理技術(shù)。隨著科學(xué)技術(shù)的高速發(fā)展,信息技術(shù)已經(jīng)深深的影響著我國各行各業(yè)的發(fā)展。步入數(shù)字化時代,有巨大的數(shù)據(jù)信息等待著加工處理和傳輸,超市系統(tǒng)本就需要有一個強大的數(shù)據(jù)庫支持,這就需要對數(shù)據(jù)庫進一步的開發(fā)和利用,而對超市的銷售管理,信息的存儲和處理也顯的尤其重要。要適應(yīng)如今激烈的市場競爭,就需要有高效的處理方式和管理方法,因此加快超市的信息化進程是必不可少的。超市雖然具有各種優(yōu)點,但當下,它仍存在零售企業(yè)所共有的落后的一面,例如:不能有效的管理每種商品、收款結(jié)算速度慢,容易出現(xiàn)營業(yè)差錯,不易進行商品調(diào)價,盤庫效率低,而且商品的進、銷、存不能保證同步更新,缺乏實時分析功能,管理人員對及時傳遞資料的要求始終得不到滿足。隨著超市形態(tài)的高速發(fā)展,其經(jīng)營管理也變的越為復(fù)雜,數(shù)據(jù)庫的龐大支撐導(dǎo)致中間流通的數(shù)據(jù)量大增,中間的商業(yè)運轉(zhuǎn)環(huán)節(jié)也越來越多,傳統(tǒng)的管理模式已不能滿足,而依靠現(xiàn)信息技術(shù)的超市管理系統(tǒng)管理超市,可以節(jié)省大量的人力物力,更重要的是能更快更穩(wěn)的推動超市銷售發(fā)展,協(xié)助管理者做出與時俱進適應(yīng)市場變化的正確決策,加快超市經(jīng)營管理效率。超市管理系統(tǒng)是超市對商品的信息化管理系統(tǒng),本系統(tǒng)可以提高管理水平和工作效率,可以最大限度的減少人工操作帶來的錯誤,使用此系統(tǒng)主要為了實現(xiàn)商品管理的穩(wěn)定性、可維護性等,從而達到提高商品管理效率并指導(dǎo)經(jīng)營方向的目的。1.2超市賬單管理系統(tǒng)的概述本系統(tǒng)的主要功能就是完成對供應(yīng)商往來賬添加的功能,每一批到貨情況,是否付款等情況在這個管理模塊中進行記錄,并且標有記賬時間,似的數(shù)據(jù)有依可循,供隨時查詢。此外可以根據(jù)商品的名稱查出是否記錄過,是否已經(jīng)付款的功能。實現(xiàn)供應(yīng)商信息的添加查詢功能。本項目設(shè)計主要包括需求分析、數(shù)據(jù)庫設(shè)計、項目設(shè)計、界面設(shè)計、調(diào)試及運行等幾個大的部分。工作在迭代中展開,通過不斷的完善每個環(huán)節(jié),最終完成超市管理的需求,實現(xiàn)自動化辦公。經(jīng)過調(diào)研的初步需求分析,得出要設(shè)計的主要模塊包括:(1)賬單管理模塊,主要是管理超市賬單,賬單的編號、商品名稱、商品數(shù)量、交易金額、是否付款、供應(yīng)商名稱、商品描述、賬單時間。然后計算出顧客購買商品的總價,計算顧客實付金額和應(yīng)付金額的差價。減少人工計算產(chǎn)生的錯誤。(2)供應(yīng)商管理模塊,主要管理與超市合作的供應(yīng)商,有編號、供應(yīng)商名稱、供應(yīng)商描述、聯(lián)系人、電話、地址。(3)用戶管理模塊,主要管理管理超市的用戶,有編號、用戶名稱、性別、年齡、電話、地址、權(quán)限。用戶管理信息化,減少了人力資源的浪費。1.3所需軟、硬件技術(shù)準備本系統(tǒng)的開發(fā)是面向數(shù)據(jù)庫應(yīng)用程序的開發(fā)。目前數(shù)據(jù)庫技術(shù)發(fā)展日趨完善,可用于數(shù)據(jù)庫開發(fā)的工具各種各樣。本系統(tǒng)是采用mysql作為后臺數(shù)據(jù)庫,本系統(tǒng)是運行在WindowXP平臺上的,因此考慮到兼容性、開發(fā)成本以及開發(fā)的方便和簡單,本系統(tǒng)使用免費的Eclipse開發(fā)平臺。為了高效、快捷的采購出庫入庫管理系統(tǒng)的開發(fā)。采取如下開發(fā)環(huán)境:網(wǎng)絡(luò)環(huán)境:局域網(wǎng)。硬件環(huán)境:內(nèi)存1G,硬盤80G。軟件環(huán)境:(1)操作系統(tǒng):WindowsXP版本。(2)數(shù)據(jù)庫開發(fā)工具:mysql。(3)應(yīng)用程序開發(fā)工具:Eclipse。技術(shù)準備:(1)java基礎(chǔ)(2)jsp技術(shù)(3)Servlet技術(shù)(4)html,css(5)jquery的相關(guān)知識1.4可行性分析1.4.1技術(shù)可行性本系統(tǒng)戲是用java語言所編寫的,java語言作為前導(dǎo)課程已經(jīng)學(xué)過。重點學(xué)習(xí)了jsp,最后又系統(tǒng)的學(xué)習(xí)了Servlet,Servlet這同時又是本系統(tǒng)應(yīng)用的重點。從設(shè)計,開發(fā),測試到最后的維護,都綜合了所學(xué)的java知識。本系統(tǒng)所實現(xiàn)的是超市賬單管理,因此在給定的時間內(nèi)完成是絕對可行。制作本系統(tǒng)的軟件均可以在網(wǎng)上免費獲得,同時也可以獲得開源的代碼和圖片。本組的技術(shù)人員有開發(fā)此類項目的經(jīng)驗。綜上所述,此系統(tǒng)開發(fā)有可靠的技術(shù)支持,技術(shù)上是完全可行的。1.4.2經(jīng)濟可行性對本組的經(jīng)濟現(xiàn)狀和投資能力進行分析,對系統(tǒng)建設(shè)運行和維護費用進行估算,對系統(tǒng)建成后可能取得的社會和經(jīng)濟效益進行估計。由于本系統(tǒng)是作為畢業(yè)設(shè)計由我們學(xué)生自己開發(fā)的,在經(jīng)濟上的投入甚微,系統(tǒng)建成之后將為超市行業(yè)提供很大的方便,因此在經(jīng)濟上是可行的。1.4.3社會可行性本系統(tǒng)編程所使用的是網(wǎng)上的開源代碼和圖片,又不以獲利為目的。因此不必承擔任何法律責(zé)任2需求分析2.1需求分析的任務(wù)及主要內(nèi)容2.2.1具體業(yè)務(wù)的需求主要模塊包括:(1)賬單管理模塊,主要是管理超市賬單,賬單的編號、商品名稱、商品數(shù)量、交易金額、是否付款、供應(yīng)商名稱、商品描述、賬單時間。然后計算出顧客購買商品的總價,計算顧客實付金額和應(yīng)付金額的差價。減少人工計算產(chǎn)生的錯誤。(2)供應(yīng)商管理模塊,主要管理與超市合作的供應(yīng)商,有編號、供應(yīng)商名稱、供應(yīng)商描述、聯(lián)系人、電話、地址。(3)用戶管理模塊,主要管理管理超市的用戶,有編號、用戶名稱、性別、年齡、電話、地址、權(quán)限。用戶管理信息化,減少了人力資源的浪費。。2.2層次圖軟件賬單管理模塊軟件賬單管理模塊用戶管理模塊供應(yīng)商管理模塊 圖2-1層次圖2.3數(shù)據(jù)流圖經(jīng)理登陸經(jīng)理登陸賬單管理供應(yīng)商管理用戶管理數(shù)據(jù)維護存入數(shù)據(jù)庫圖2-2普通用戶理登陸賬單管理普通用戶理登陸賬單管理供應(yīng)商管理數(shù)據(jù)維護存入數(shù)據(jù)庫圖2-33概要設(shè)計3.1系統(tǒng)分析在本系統(tǒng)中,分為基本信息的賬單管理模塊,供應(yīng)商管理模塊,用戶管理模塊。有2個角色:經(jīng)理、普通用戶名。1.用戶所具有功能經(jīng)理擁有所有的模塊的操作權(quán)限,普通用戶除了對用戶管理模塊的操作權(quán)限意外所有模塊的操作權(quán)限:對賬單表,供應(yīng)商表增刪改查。3.1.1系統(tǒng)的總體分析在前面的系統(tǒng)功能分析中,將系統(tǒng)劃分成4個模塊,如圖3-1:用戶登錄驗證用戶登錄驗證經(jīng)理普通用戶賬單管理用戶管理供應(yīng)商管理圖3-1系統(tǒng)功能模塊圖3.2數(shù)據(jù)庫的設(shè)計與實現(xiàn)數(shù)據(jù)庫是此類系統(tǒng)的核心,系統(tǒng)中所有的信息都存儲在數(shù)據(jù)庫中,在所有jsp頁面中通過JDBC與數(shù)據(jù)庫連接,操作數(shù)據(jù)庫中的數(shù)據(jù),從而實現(xiàn)所有需要的功能。數(shù)據(jù)庫軟件有很多。本系統(tǒng)中數(shù)據(jù)庫采用MySQL作為數(shù)據(jù)庫工具。數(shù)據(jù)庫是網(wǎng)站的核心,數(shù)據(jù)庫設(shè)計的合理與否對網(wǎng)站的建設(shè)有著至關(guān)重要的影響。一個良好的數(shù)據(jù)庫開發(fā)過程一般是先系統(tǒng)分析,再邏輯設(shè)計,然后物理實現(xiàn)。系統(tǒng)分析中分析數(shù)據(jù)庫用戶需求,并畫出E-R圖直觀地表示出數(shù)據(jù)庫系統(tǒng)的需求。邏輯設(shè)計中根據(jù)系統(tǒng)分析設(shè)計的一個關(guān)系模型。物理設(shè)計為邏輯設(shè)計中的數(shù)據(jù)模型選取一個最合理的應(yīng)用環(huán)境的物理結(jié)構(gòu),通常選取一個常用數(shù)據(jù)庫軟件,用數(shù)據(jù)庫軟件創(chuàng)建與邏輯設(shè)計中數(shù)據(jù)模型對應(yīng)的數(shù)據(jù)庫。3.2.1數(shù)據(jù)庫系統(tǒng)分析本系統(tǒng)的數(shù)據(jù)庫實體主要有“賬單”、“供應(yīng)商”、“用戶”。其中“賬單”中的物品與“供應(yīng)商”存在著聯(lián)系,一個賬單必須對應(yīng)一個供應(yīng)商,但供應(yīng)商不一定只有一份賬單,即供應(yīng)商和賬單之間一多對多的關(guān)系。如圖:3-1賬單擁有賬單擁有M1供應(yīng)商圖3-1賬單—供應(yīng)商E-R圖3.2.2數(shù)據(jù)庫物理實現(xiàn)經(jīng)過數(shù)據(jù)庫系統(tǒng)分析后,數(shù)據(jù)庫的結(jié)構(gòu)已經(jīng)非常清晰,剩下的就是用一種數(shù)據(jù)庫軟件實現(xiàn)這樣的結(jié)構(gòu)。本系統(tǒng)中數(shù)據(jù)庫采用MySQL作為數(shù)據(jù)庫。首先我們在MySQL中建一個數(shù)據(jù)庫,命名為“supermarket”。選中supermarket數(shù)據(jù)庫,向數(shù)據(jù)庫中添加3個表:gongyingshang,yonghu,zhangdan。下面是每個數(shù)據(jù)表中的屬性。gongyingshang表。gongyingshang表用來存儲供應(yīng)商信息。gongyingshang表字段名稱數(shù)據(jù)類型gys_id數(shù)字gys_name文本gys_miaoshu文本gys_lianxiren文本gys_phone文本gys_chuanzhen數(shù)字gys_address數(shù)字表3-1yonghu表。yonghu表用來存儲領(lǐng)登陸用戶明細。yonghu表字段名稱數(shù)據(jù)類型yh_id數(shù)字yh_username文本yh_password文本yh_sex文本yh_age數(shù)字yh_phone數(shù)字yh_address文本yh_quanxian文本表3-2zhangdan表。zhangdan表用來存儲賬單的信息。zhangdan表字段名稱數(shù)據(jù)類型zd_id數(shù)字zd_spmingcheng文本zd_spshuliang數(shù)字zd_jymoney數(shù)字zd_sfzhifu文本zd_gysname文本zd_spmiaoshu文本zd_data文本zd_danwei文本表3-34詳細設(shè)計4.1Servlet的詳細應(yīng)用在Servlet工作流程中,根據(jù)web.xml中的配置將攔截所有通過servlet的請求,并根據(jù)URI決定分發(fā)給doGet還是doPost處理請求,然后調(diào)用相應(yīng)的業(yè)務(wù)邏輯方法,調(diào)用相應(yīng)的頁面去執(zhí)行響應(yīng)。利用JDBC(JavaDataBaseConnectivity)技術(shù)處理與數(shù)據(jù)庫連接,利用其ServletAPI所定義的接口和類來封裝與數(shù)據(jù)庫交互的相關(guān)操作,使對數(shù)據(jù)庫的操作變得相當容易,減少開發(fā)時間,而且能對系統(tǒng)進行靈活的設(shè)計和實現(xiàn),使系統(tǒng)的各模塊容易維護和重用。4.2特定模塊的詳細介紹每個包都有其各自的作用,是雜亂的java文件分層,具有層次感,也可以很好地進行維護。4.2.1登陸模塊輸入不同的角色名就會進入不同的模塊,并完成相應(yīng)的功能;登陸模塊如圖4-1所示如圖4-1代碼:publicclassHandelLoginextendsHttpServlet{ UserOperoper=newUserOper(); publicvoidinit(ServletConfigconfig)throwsServletException{ super.init(config); } publicvoiddestroy(){ super.destroy(); } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ this.doPost(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); HttpSessionsession=request.getSession(true); Stringop=request.getParameter("op"); Stringopg=request.getParameter("opg"); Stringopyh=request.getParameter("opyh"); Stringzdgroup=request.getParameter("zdgroup"); System.out.println(zdgroup); Stringgysgroup=request.getParameter("gysgroup"); LoginjudgeLogin=(Login)(session.getAttribute("login")); if("doLogin".equals(op)){ doLogin(request,response); return; } if(judgeLogin!=null&&!"".equals(judgeLogin)){ if("經(jīng)理".equals(judgeLogin.getYh_quanxian())){ if("ZD".equals(op)){ doLnquiresZD(request,response); }elseif("ZDAdd".equals(op)){ doZDAdd(request,response); }elseif("ZDXinXi".equals(op)){ doZDXinXi(request,response); }elseif("修改".equals(op)){ doZDXiuGai(request,response); }elseif("刪除".equals(op)){ doZDDel(request,response); }elseif("組合查詢".equals(zdgroup)){ doZDChaXun(request,response); }elseif("GYS".equals(op)){ doLnquiresGYS(request,response); }elseif("GYSAdd".equals(op)){ doGYSAdd(request,response); }elseif("GYSXinXi".equals(op)){ doGYSXinXi(request,response); }elseif("修改".equals(opg)){ doGYSXiuGai(request,response); }elseif("刪除".equals(opg)){ doGYSDel(request,response); }elseif("組合查詢".equals(gysgroup)){ doGYSChaXun(request,response); }elseif("YH".equals(op)){ doLnquiresYH(request,response); }elseif("YHAdd".equals(op)){ doYHAdd(request,response); }elseif("YHXinXi".equals(op)){ doYHXinXi(request,response); }elseif("修改".equals(opyh)){ doYHXiuGai(request,response); }elseif("刪除".equals(opyh)){ doYHDel(request,response); }elseif("查詢".equals(opyh)){ doYhChaXun(request,response); }elseif("修改密碼".equals(opyh)){ doYHMiMa(request,response); }elseif("修改密碼".equals(op)){ doAdminMiMaXiuGai(request,response); } } if("普通用戶".equals(judgeLogin.getYh_quanxian())){ if("ZD".equals(op)){ doLnquiresZD(request,response); }elseif("ZDAdd".equals(op)){ doZDAdd(request,response); }elseif("ZDXinXi".equals(op)){ doZDXinXi(request,response); }elseif("修改".equals(op)){ doZDXiuGai(request,response); }elseif("刪除".equals(op)){ doZDDel(request,response); }elseif("組合查詢".equals(zdgroup)){ doZDChaXun(request,response); }elseif("GYS".equals(op)){ doLnquiresGYS(request,response); }elseif("GYSAdd".equals(op)){ doGYSAdd(request,response); }elseif("GYSXinXi".equals(op)){ doGYSXinXi(request,response); }elseif("修改".equals(opg)){ doGYSXiuGai(request,response); }elseif("刪除".equals(opg)){ doGYSDel(request,response); }elseif("組合查詢".equals(gysgroup)){ doGYSChaXun(request,response); }elseif("YH".equals(op)||"修改密碼".equals(op)||"修改密碼".equals(opyh)|| "查詢".equals(opyh)||"刪除".equals(opyh)||"修改".equals(opyh)|| "YHXinXi".equals(op)||"YHAdd".equals(op)){ Informationinfo=newInformation(); Stringmsg="對不起您沒有那么高的權(quán)限"; info.setMsg(msg); request.setAttribute("info",info); request.getRequestDispatcher("mainWindow.jsp").forward(request,response); } } }else{ response.sendRedirect("login.jsp"); } } 管理員(用戶)登陸以后就會進入總頁面如圖:4-2所示:在左側(cè)可以看到管理員進來后(普通用戶)各自的權(quán)限。管理員登陸:如圖4-2普通用戶登陸:如圖4-34.2.2賬單管理模塊管理員權(quán)限下的功能操作及代碼如圖4-4代碼:privatevoiddoLnquiresZD(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ HttpSessionsession=request.getSession(); List<ZDBean>list=oper.ZDLnquires(); List<String>gysName=oper.ZDGongYiShang(); if(list!=null){ request.setAttribute("list",list); session.setAttribute("gysName",gysName); request.getRequestDispatcher("admin_bill_list.jsp").forward(request,response); return; }else{ response.sendRedirect("admin_bill_list.jsp"); } }privatevoiddoZDChaXun(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringzd_spmingcheng=request.getParameter("commodityname"); Stringzd_sfzhifu=request.getParameter("payment"); System.out.println(zd_spmingcheng); System.out.println(zd_sfzhifu); List<ZDBean>list=oper.ZDChaXun(zd_spmingcheng,zd_sfzhifu); if(list!=null){ request.setAttribute("list",list); request.getRequestDispatcher("admin_bill_list.jsp").forward(request,response); return; }else{ response.sendRedirect("admin_bill_list.jsp"); } }代碼:privatevoiddoZDAdd(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringzd_id=request.getParameter("zdid").trim(); Stringzd_spmingcheng=request.getParameter("zdproductname").trim(); Stringzd_spshuliang=request.getParameter("zdtransnunber").trim(); Stringzd_jymoney=request.getParameter("zdtransmoney").trim(); Stringzd_sfzhifu=request.getParameter("payment").trim(); Stringzd_gysname=request.getParameter("zdproducmanufacture").trim(); Stringzd_spmiaoshu=request.getParameter("zdproducdesc").trim(); Stringzd_danwei=request.getParameter("zdtransunits").trim(); Stringzd_data=newSimpleDateFormat("yyyy-MM-dd").format(newDate().getTime()); Listparams=newArrayList(); params.add(zd_id); params.add(zd_spmingcheng); params.add(zd_spshuliang); params.add(zd_jymoney); params.add(zd_sfzhifu); params.add(zd_gysname); params.add(zd_spmiaoshu); params.add(zd_data); params.add(zd_danwei); Informationinfo=oper.ZDAdd(params); request.setAttribute("info",info); request.getRequestDispatcher("admin_bill_add.jsp").forward(request,response); }代碼:privatevoiddoZDXinXi(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringzd_id=request.getParameter("id"); ZDBeanzdbean=newZDBean(); zdbean=oper.ZDXinXi(zd_id); if(zdbean!=null){ request.setAttribute("zdbean",zdbean); request.getRequestDispatcher("admin_bill_update.jsp").forward(request,response); } }如圖4-5代碼:privatevoiddoZDXiuGai(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringzd_id=request.getParameter("zdid").trim(); Stringzd_spmingcheng=request.getParameter("zdproductname").trim(); Stringzd_spshuliang=request.getParameter("zdtransnunber").trim(); Stringzd_jymoney=request.getParameter("zdtransmoney").trim(); Stringzd_sfzhifu=request.getParameter("payment").trim(); Stringzd_gysname=request.getParameter("zdproducmanufacture").trim(); Stringzd_spmiaoshu=request.getParameter("zdproducdesc").trim(); Stringzd_danwei=request.getParameter("zdtransunits").trim(); Listparams=newArrayList(); params.add(zd_id); params.add(zd_spshuliang); params.add(zd_jymoney); params.add(zd_sfzhifu); params.add(zd_gysname); params.add(zd_spmiaoshu); params.add(zd_danwei); params.add(zd_spmingcheng); Informationinfo=oper.ZDXiuGai(params); request.setAttribute("info",info); request.getRequestDispatcher("admin_bill_update.jsp").forward(request,response); }privatevoiddoZDDel(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringzd_id=request.getParameter("zdid").trim(); Informationinfo=oper.ZDDel(zd_id); request.setAttribute("info",info); request.getRequestDispatcher("admin_bill_update.jsp").forward(request,response); }普通用戶權(quán)限下功能操作及代碼:圖及代碼同經(jīng)理權(quán)限下圖及代碼4.2.2供應(yīng)商管理模塊管理員權(quán)限下的功能操作及代碼如圖:4-6所示如圖4-6代碼:privatevoiddoGYSChaXun(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringgys_name=request.getParameter("commodityname").trim(); Stringgys_miaoshu=request.getParameter("commoditymiaoshu").trim(); List<GYSBean>list=oper.GYSChaXun(gys_name,gys_miaoshu); if(list!=null){ request.setAttribute("list",list); request.getRequestDispatcher("admin_supplier_list.jsp").forward(request,response); }else{ response.sendRedirect("admin_supplier_list.jsp"); } }privatevoiddoLnquiresGYS(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ List<GYSBean>list=oper.GYSLnquires(); if(list!=null){ request.setAttribute("list",list); request.getRequestDispatcher("admin_supplier_list.jsp").forward(request,response); }else{ response.sendRedirect("admin_supplier_list.jsp"); } }如圖4-7代碼:privatevoiddoGYSAdd(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringgys_id=request.getParameter("gysid").trim(); Stringgys_name=request.getParameter("gysname").trim(); Stringgys_miaoshu=request.getParameter("gysmiaoshu").trim(); Stringgys_lianxiren=request.getParameter("gyslianxi").trim(); Stringgys_phone=request.getParameter("gysphone").trim(); Stringgys_chuanzhen=request.getParameter("gyschuanzhen").trim(); Stringgys_address=request.getParameter("gysaddress").trim(); Listparams=newArrayList(); params.add(gys_id); params.add(gys_name); params.add(gys_miaoshu); params.add(gys_lianxiren); params.add(gys_phone); params.add(gys_chuanzhen); params.add(gys_address); Informationinfo=oper.GYSAdd(params); request.setAttribute("info",info); request.getRequestDispatcher("admin_supplier_add.jsp").forward(request,response); }如圖4-8代碼:privatevoiddoGYSXinXi(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringgys_id=request.getParameter("id"); GYSBeangysbean=newGYSBean(); gysbean=oper.GYSXinXi(gys_id); request.setAttribute("gysbean",gysbean); request.getRequestDispatcher("admin_supplier_update.jsp").forward(request,response); }如圖4-9代碼:privatevoiddoGYSXiuGai(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringgys_id=request.getParameter("gysid").trim(); Stringgys_miaoshu=request.getParameter("gysmiaoshu").trim(); Stringgys_lianxiren=request.getParameter("gyslianxi").trim(); Stringgys_phone=request.getParameter("gysphone").trim(); Stringgys_chuanzhen=request.getParameter("gyschuanzhen").trim(); Stringgys_address=request.getParameter("gysaddress").trim(); Stringgys_name=request.getParameter("gysname").trim(); Listparams=newArrayList(); params.add(gys_id); params.add(gys_miaoshu); params.add(gys_lianxiren); params.add(gys_phone); params.add(gys_chuanzhen); params.add(gys_address); params.add(gys_name); Informationinfo=oper.GYSXiuGai(params); request.setAttribute("info",info); request.getRequestDispatcher("admin_supplier_update.jsp").forward(request,response); }privatevoiddoGYSDel(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringgys_id=request.getParameter("gysid").trim(); Informationinfo=oper.GYSDel(gys_id); request.setAttribute("info",info); request.getRequestDispatcher("admin_supplier_update.jsp").forward(request,response);}普通用戶權(quán)限下功能操作及代碼:圖及代碼同經(jīng)理權(quán)限下的圖及代碼4.2.3用戶管理模塊管理員權(quán)限下的功能操作及代碼如圖4-10代碼:privatevoiddoGYSChaXun(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringgys_name=request.getParameter("commodityname").trim(); Stringgys_miaoshu=request.getParameter("commoditymiaoshu").trim(); List<GYSBean>list=oper.GYSChaXun(gys_name,gys_miaoshu); if(list!=null){ request.setAttribute("list",list); request.getRequestDispatcher("admin_supplier_list.jsp").forward(request,response); }else{ response.sendRedirect("admin_supplier_list.jsp"); } }privatevoiddoLnquiresYH(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ List<YHBean>list=oper.YHLnquires(); if(list!=null){ request.setAttribute("list",list); request.getRequestDispatcher("admin_user_list.jsp").forward(request,response); }else{ response.sendRedirect("admin_user_list.jsp"); } }如圖4-11代碼:privatevoiddoYHAdd(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringyh_id=request.getParameter("yhid").trim(); Stringyh_username=request.getParameter("yhname").trim(); Stringyh_password=request.getParameter("yhpassword").trim(); Stringyh_sex=request.getParameter("yhsex").trim(); Stringyh_age=request.getParameter("yhage").trim(); Stringyh_phone=request.getParameter("yhphone").trim(); Stringyh_address=request.getParameter("yhaddress").trim(); Stringyh_quanxian=request.getParameter("yhquanxian").trim(); Listparams=newArrayList(); params.add(yh_id); params.add(yh_username); params.add(yh_password); params.add(yh_sex); params.add(yh_age); params.add(yh_phone); params.add(yh_address); params.add(yh_quanxian); Informationinfo=oper.YHADD(params); request.setAttribute("info",info); request.getRequestDispatcher("admin_user_add.jsp").forward(request,response); }如圖4-12代碼:privatevoiddoYHXinXi(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringyh_id=request.getParameter("id"); YHBeanyhbean=oper.YHXinXi(yh_id); if(yhbean!=null){ request.setAttribute("yhbean",yhbean); request.getRequestDispatcher("admin_user_update.jsp").forward(request,response); }else{ response.sendRedirect("admin_user_update.jsp"); } }如圖4-13代碼:privatevoiddoYHXiuGai(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringyh_id=request.getParameter("yhid").trim(); Stringyh_sex=request.getParameter("yhsex").trim(); Stringyh_age=request.getParameter("yhage").trim(); Stringyh_phone=request.getParameter("yhphone").trim(); Stringyh_address=request.getParameter("yhaddress").trim(); Stringyh_username=request.getParameter("yhname").trim(); Listparams=newArrayList(); params.add(yh_id); params.add(yh_sex); params.add(yh_age); params.add(yh_phone); params.add(yh_address); params.add(yh_username); Informationinfo=oper.YHXiuGai(params); request.setAttribute("info",info); request.getRequestDispatcher("admin_user_update.jsp").forward(request,response); }privatevoiddoYHDel(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringyh_id=request.getParameter("yhid").trim(); Informationinfo=oper.YHDel(yh_id); request.setAttribute("info",info); request.getRequestDispatcher("admin_user_update.jsp").forward(request,response); }privatevoiddoYHMiMa(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringyh_id=request.getParameter("yhid").trim(); request.setAttribute("yh_id",yh_id); request.getRequestDispatcher("admin_user_update_password.jsp").forward(request,response); }privatevoiddoAdminMiMaXiuGai(HttpServletRequestrequest, HttpServletResponseresponse)throwsServletException,IOException{ Stringyh_id=request.getParameter("yhid").trim(); Stringoldpassword=request.getParameter("yholdpassword").trim(); Stringnewpassword=request.getParameter("yhnewpassword").trim(); Listparams=newArrayList(); params.add(yh_id); params.add(oldpassword); params.add(newpassword); Informationinfo=oper.AdminMiMaXiuGai(params); request.setAttribute("info",info); request.getRequestDispatcher("admin_user_update_password.jsp").forward(request,response); }普通用戶權(quán)限下功能操作及代碼:圖及代碼同經(jīng)理權(quán)限下圖及代碼5系統(tǒng)測試軟件測試是整個軟件開發(fā)過程中一段非常重要的階段,在測試過程中如能按照測試的基本過程來進行測試,這樣在測試完一個軟件后,軟件的質(zhì)量能有所保障。軟件測試不僅有測試目的、測試過程,在測試過程中還應(yīng)按照一定的測試方法,針對不同的過程應(yīng)用不同的方法。軟件測試的內(nèi)容是深不可測的,在測試的過程中應(yīng)結(jié)合具體的實際情況采用不同的方法進行測試,以保證軟件質(zhì)量過關(guān)。軟件測試是一個重要的階段,也是非常復(fù)雜的一個過程,測試過程及方法靈活多變,并不是固定不變的。一個好的測試人員不僅能發(fā)現(xiàn)問題、從發(fā)現(xiàn)的錯誤中分析錯誤出現(xiàn)的原因,更應(yīng)能擬定軟件測試計劃、編制軟件測試大綱、編寫測試用例,從而提高的工作效力,降低了開發(fā)產(chǎn)品的成本,更好的保證軟件的質(zhì)量。白盒測試也稱結(jié)構(gòu)測試或邏輯驅(qū)動測試,它是按照程序內(nèi)部的結(jié)構(gòu)測試程序。通過測試來檢測產(chǎn)品內(nèi)部動作是否按照設(shè)計規(guī)格說明書的規(guī)定正常進行,檢驗程序中的每條通路都能按預(yù)定的要求正確的工作。這一方法是把測試對象看作一個打開的盒子測試人員依據(jù)程序內(nèi)部邏輯結(jié)構(gòu)相關(guān)信息,設(shè)計或選擇測試用例,對程序所有的邏輯路徑進行測試,通過在不同檢查程序的狀態(tài),確定實際的狀態(tài)是否與預(yù)期的狀態(tài)一致。本系統(tǒng)用的是白盒測試:輸入管理員的賬戶和密碼admin,admin看看能否進入管理員的模塊,進過測試確實進入了管理員的模塊。結(jié)語經(jīng)過幾個月的努力我終于完成畢業(yè)設(shè)計,我感到非常高興,但同時我又感覺到自己的不足。我編的這個采購及倉庫管理系統(tǒng)和正規(guī)的相比真是不可同日而語。雖然由于自己知識上的不足,有些地方有少許錯誤和容錯性能比較低,但是還是可以基本完成采購及倉庫管理系統(tǒng)應(yīng)有的功能。通過畢業(yè)設(shè)計過程我學(xué)會了許多知識,這也是在培訓(xùn)的時候第一次比較完整的完成一個多人合作的項目,雖然我每編一個頁面就會遇到許多問題,但是通過上網(wǎng),同學(xué)和教師的幫助,我克服了。在不斷的發(fā)現(xiàn)問題,總結(jié)問題和解決問題的過程中,使我在此次畢業(yè)設(shè)計中不斷地提升自己,與此同時又得到了寶貴的經(jīng)驗和團隊的重要性。注釋1.導(dǎo)入項目:把項目導(dǎo)入到Eclipse中,打開Eclipse,點擊fileimportGeneralExistingProjectsintoworksapce再選中next然后再找項目的路徑就可以了。導(dǎo)入數(shù)據(jù)庫打開SQLyog,建一個新連接,輸入密碼root,點擊databaseimportexecuteSQLscript找到相應(yīng)的文件執(zhí)行。3.運行項目選中l(wèi)ogin.jsp右擊找到runas,點擊runonserver就可以了管理員賬號:admin管理員密碼:admin附錄1Webt.xml<?xmlversion="1.0"encoding="UTF-8"?><web-appxmlns:xsi="/2001/XMLSchema-instance"xmlns="/xml/ns/javaee"xmlns:web="/xml/ns/javaee/web-app_2_5.xsd"xsi:schemaLocation="/xml/ns/javaee/xml/ns/javaee/web-app_2_5.xsd"id="WebApp_ID"version="2.5"> <servlet> <servlet-name>handelLogin</servlet-name> <servlet-class>com.cszdglxt.servlets.HandelLogin</servlet-class> </servlet> <servlet-mapping> <servlet-name>handelLogin</servlet-name> <url-pattern>/helplogin</url-pattern> </servlet-mapping> <servlet> <servlet-name>handelExit</servlet-name> <servlet-class>com.cszdglxt.servlets.HandleExit</servlet-class> </servlet> <servlet-mapping> <servlet-name>handelExit</servlet-name> <url-pattern>/helpexit</url-pattern> </servlet-mapping><welcome-file-list><welcome-file>login.jsp</welcome-file></welcome-file-list></web-app>admin_bill_add.jsp<%@pageimport="java.util.ArrayList"%><%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><%@tagliburi="/jsp/jstl/core"prefix="c"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"><linktype="text/css"rel="stylesheet"href="css/style.css"/><scriptsrc="js/zhangDanTianJia.js"></script></head><body><%%><divclass="main"> <divclass="optitleclearfix"> <divclass="title">賬單管理>></div> </div> <formmethod="post"action="helplogin"> <inputtype="hidden"name="op"value="ZDAdd"/> <divclass="content"> <tableclass="box"> <tr> <tdclass="field">賬單編號:</td><td><inputtype="text"name="zdid"id="zdid"onBlur="checkZdid();"/><fontcolor="#FF0000">*<spanid="zdidMsg"></span></font></td></tr><tr> <tdclass="field">交易金額:</td><td><inputtype="text"name="zdtransmoney"id="zdtransmoney"onBlur="checkZdtransmoney();"/><fontcolor="#FF0000">*<spanid="zdtransmoneyMsg"></span></font></td></tr><tr> <tdclass="field">交易單位:</td><td><inputtype="text"name="zdtransunits"id="zdtransunits"onBlur="checkZdtransunits();"/><fontcolor="#FF0000">*<spanid="zdtransunitsMsg"></span></font></td></tr><tr> <tdclass="field">交易數(shù)量:</td><td><inputtype="text"name="zdtransnunber"id="zdtransnunber"onBlur="checkZdtransnunber();"/><fontcolor="#FF0000">*<spanid="zdtransnunberMsg"></span></font></td></tr><tr> <tdclass="field">商品名稱:</td><td><inputtype="text"name="zdproductname"/></td></tr> <tr> <tdclass="field">商品描述:</td><td><textareaname="zdproducdesc"cols="40"rows="6"></textarea></td></tr><tr> <tdclass="field">所屬供應(yīng)商:</td><td><selectname="zdproducmanufacture"> <c:forEachitems="${gysName}"var="gysNames"> <optionvalue="${gysNames}"selected>${gysNames}</option> </c:forEach></select></td></tr><tr> <tdclass="field">是否付款:</td><td><selectname="payment"> <optionvalue="是">是</option> <optionvalue="否"selected>否</option></select></td><td><fontcolor="#FF0000"size="+2">${info.msg}</font></td></tr> </table> </div> <divclass="buttons"> <inputtype="submit"name="submit"value="提交"class="input-button"/><!-- <inputtype="button"name="button"value="返回"class="input-button"onclick="history.back()"/>--><inputtype="button"name="button"value="返回"class="input-button"onclick="location.href='admin_bill_list.jsp'"/> </div> </form></div></body></html>admin_bill_list.jsp<%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><%@tagliburi="/jsp/jstl/core"prefix="c"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"><linktype="text/css"rel="stylesheet"href="css/style.css"/></head><body><%%><divclass="menu"> <formmethod="post"action="helplogin"> 商品名稱:<inputtype="text"name="commodityname"class="input-text"/>     是否付款:<selectname="payment"> <optionvalue="是">是</option> <optionvalue="否"selected>否</option> </select>     <inputtype="submit"name="zdgroup"value="組合查詢"class="button"/> </form></div><divclass="main"> <divclass="optitleclearfix"> <em><inputtype="button"name="addnumber"value="添加數(shù)據(jù)"class="input-button"onclick="locati

溫馨提示

  • 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)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論