財(cái)務(wù)報(bào)銷管理_第1頁
財(cái)務(wù)報(bào)銷管理_第2頁
財(cái)務(wù)報(bào)銷管理_第3頁
財(cái)務(wù)報(bào)銷管理_第4頁
財(cái)務(wù)報(bào)銷管理_第5頁
已閱讀5頁,還剩76頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、Web 應(yīng)用開發(fā)工程師 案例資源庫清華大學(xué)計(jì)算機(jī)與信息管理中心 第 頁Web 應(yīng)用開開發(fā)工程師案例手冊(cè) 財(cái)務(wù)務(wù)報(bào)銷管理系系統(tǒng)一、項(xiàng)目需求分分析 1、項(xiàng)項(xiàng)目背景描述述某學(xué)院的財(cái)務(wù)部部門,現(xiàn)在感感覺到本院的的財(cái)務(wù)支出管管理有點(diǎn)混亂亂,對(duì)于個(gè)別別業(yè)務(wù)部門存存在任意開支支的現(xiàn)象,所所以希望通過過網(wǎng)上統(tǒng)一登登記報(bào)銷細(xì)目目的形式,財(cái)財(cái)務(wù)主管和院院領(lǐng)導(dǎo)可以隨隨時(shí)掌握學(xué)院院的經(jīng)費(fèi)支出出情況。學(xué)院的財(cái)務(wù)形式式描述如下:每年學(xué)院的的國家撥款及及各類收入都都按照各個(gè)業(yè)務(wù)部門的預(yù)預(yù)算,劃成分分類的賬號(hào),所所有的支出都都按照其所發(fā)生的業(yè)業(yè)務(wù)性質(zhì)所屬賬號(hào)號(hào)進(jìn)行報(bào)銷。各各個(gè)賬號(hào)有相相應(yīng)的負(fù)責(zé)人人和出納,有有的負(fù)責(zé)人會(huì)會(huì)有多

2、個(gè)賬號(hào)號(hào)的支配權(quán)限限,有的出納納可以操作多多個(gè)賬號(hào),只只要業(yè)務(wù)相關(guān)關(guān)即可,這些些都是由財(cái)務(wù)務(wù)主管來分配配。用戶已經(jīng)提供原原始表格,一一期任務(wù)把該該表格實(shí)現(xiàn)網(wǎng)網(wǎng)上填報(bào)即可可。財(cái)務(wù)主管管可以看到全全院所有的報(bào)報(bào)銷信息,財(cái)財(cái)務(wù)助理只能能看到自己錄錄入的信息。 所有的記記錄應(yīng)可以導(dǎo)導(dǎo)出Exceel表格。2、需求概要分分析(1)、用戶和和角色權(quán)限部部分:財(cái)務(wù)主主管維護(hù)系統(tǒng)統(tǒng)用戶,并為為用戶指定角角色,用戶的的初始化密碼碼和證件號(hào)相相同,各用戶戶自己登陸后后可修改密碼碼。角色分為三類:、出納:可以對(duì)對(duì)自己被授權(quán)權(quán)的賬號(hào)進(jìn)行行報(bào)銷記錄的的維護(hù);、賬號(hào)負(fù)責(zé)人:可以對(duì)自己己被授權(quán)的賬賬號(hào)進(jìn)行查詢?cè)儯荒茏鲂略鲈?/p>

3、、修改、刪除等操作作;、財(cái)務(wù)主管:可可以查詢、維維護(hù)全院所有有賬號(hào)的報(bào)銷銷記錄;(2)、報(bào)銷記記錄維護(hù):填寫報(bào)銷記錄時(shí)時(shí),需要記錄錄摘要、費(fèi)用類類型、經(jīng)辦人人、所屬賬號(hào)號(hào)、記錄人、記記錄時(shí)間、處處理方式等信信息。參考用用戶提供的原原始表格。為規(guī)范填寫,費(fèi)費(fèi)用記錄、處處理方式都做做標(biāo)準(zhǔn)化處理理,財(cái)務(wù)主管管維護(hù)代碼表表后,出納錄錄入時(shí)選擇錄錄入。為避免賬號(hào)填寫寫錯(cuò)誤,出納納錄入時(shí),賬賬號(hào)信息也是是選擇方式錄錄入,每個(gè)出出納只能列出出自己被授權(quán)權(quán)的賬號(hào)。(3)、報(bào)銷記記錄查詢根據(jù)賬號(hào)、費(fèi)用用類型、金額額范圍 等字字段進(jìn)行查詢?cè)?。出納和賬賬號(hào)負(fù)責(zé)人只只能查詢到自自己被授權(quán)的的賬號(hào)的報(bào)銷銷記錄。財(cái)務(wù)務(wù)主

4、管可以看看到所有賬號(hào)號(hào)的報(bào)銷記錄錄。查詢結(jié)果最下方方,需要對(duì)金金額字段做匯匯總。查詢結(jié)果應(yīng)該能能導(dǎo)出Exccel3、開發(fā)技術(shù)參參數(shù)數(shù)據(jù)庫采用Orracle;系統(tǒng)架構(gòu)采用SStrutss + Sppring + HHibernnate ;涉及開發(fā)環(huán)境和和工具:JDDK1.5、EEclipsse(MyEEclipsse)、Reesin3.0.19(TTomcatt5.5以上上亦可)、DDreamwweaverr、Oraccle數(shù)據(jù)庫庫及客戶端;二、系統(tǒng)功能設(shè)設(shè)計(jì)1、用戶維護(hù) 只有財(cái)務(wù)務(wù)主管才有用用戶維護(hù)的功功能。新加用戶按鈕 修改用戶 刪除用戶 選擇 序號(hào) 用戶名 角色 C新加用戶按鈕 修改用戶

5、刪除用戶 選擇 序號(hào) 用戶名 角色 Checkbox 1 2001230001 出納Checkbox 2 2001580610 賬號(hào)負(fù)責(zé)人Checkbox 3 說明:1、選中某條記錄,可以進(jìn)行修改,每次只能修改一條記錄; 2、刪除可以批量進(jìn)行,可以選中多條記錄進(jìn)行刪除;3、點(diǎn)新加用戶按鈕后,跳轉(zhuǎn)到下頁的新加用戶界面;報(bào)銷維護(hù) 賬號(hào)授權(quán) 賬號(hào)維護(hù) 處理方式維護(hù) 費(fèi)用類型維護(hù) 用戶維護(hù) 退出Banner(財(cái)務(wù)主管) 用戶維護(hù)新加用戶頁面新加用戶頁面用戶登陸名:_ 用戶姓名:_角色: _(select) 保存按鈕說明:1、角色的下拉選項(xiàng)有 出納、賬號(hào)負(fù)責(zé)人 兩類;2、保存用戶時(shí),應(yīng)檢測(cè)該用戶名是否已

6、經(jīng)存在,如果存在,則返回本頁面并給出相應(yīng)提示;3、用戶名應(yīng)當(dāng)是用戶證件號(hào);2、賬號(hào)維護(hù)新加賬號(hào)頁面新加賬號(hào)頁面賬號(hào):_ 賬號(hào)名稱:_賬號(hào)負(fù)責(zé)人:_ 賬號(hào)狀態(tài):_(select)備注:_保存按鈕說明:賬號(hào)狀態(tài)是指:正常 、關(guān)閉兩種狀態(tài)Banner(財(cái)務(wù)主管)賬號(hào)維護(hù)Banner(財(cái)務(wù)主管)賬號(hào)維護(hù)報(bào)銷維護(hù) 賬號(hào)授權(quán) 賬號(hào)維護(hù) 處理方式維護(hù) 費(fèi)用類型維護(hù) 用戶維護(hù) 退出新加賬號(hào)按鈕 修改賬號(hào) 刪除賬號(hào) 選擇 序號(hào) 賬號(hào) 賬號(hào)名稱 賬號(hào)負(fù)責(zé)人 賬號(hào)狀態(tài) 備注 Checkbox 1 1000010001 日常辦公賬號(hào) 張華 正常 Checkbox 2 3000020005 學(xué)生活動(dòng)經(jīng)費(fèi) 李軍 正常Ch

7、eckbox 3 說明:1、選中某條記錄,可以進(jìn)行修改,每次只能修改一條記錄; 2、刪除可以批量進(jìn)行,可以選中多條記錄進(jìn)行刪除;3、點(diǎn)新加用戶按鈕后,跳轉(zhuǎn)到上頁的新加賬號(hào)界面;3、報(bào)銷處理方方式維護(hù)Banner(財(cái)務(wù)主管)Banner(財(cái)務(wù)主管)報(bào)銷處理方式維護(hù)報(bào)銷維護(hù) 賬號(hào)授權(quán) 賬號(hào)維護(hù) 處理方式維護(hù) 費(fèi)用類型維護(hù) 用戶維護(hù) 退出新加處理方式按鈕 修改 刪除 選擇 序號(hào) 處理方式 Checkbox 1 已領(lǐng)現(xiàn)金Checkbox 2 已領(lǐng)支票Checkbox 3 說明:1、選中某條記錄,可以進(jìn)行修改,每次只能修改一條記錄; 2、刪除可以批量進(jìn)行,可以選中多條記錄進(jìn)行刪除;3、點(diǎn)新加處理方式按鈕

8、后,跳轉(zhuǎn)到下頁的新加處理方式界面;新加處理方式新加處理方式頁面處理方式:_保存按鈕說明:保存的時(shí)候,要檢測(cè)該處理方式是否已經(jīng)存在,如果已經(jīng)存在,需要返回本頁并給出提示; 4、費(fèi)用類型維維護(hù)Banner(財(cái)務(wù)主管)費(fèi)用類型維護(hù)Banner(財(cái)務(wù)主管)費(fèi)用類型維護(hù)報(bào)銷維護(hù) 賬號(hào)授權(quán) 賬號(hào)維護(hù) 處理方式維護(hù) 費(fèi)用類型維護(hù) 用戶維護(hù) 退出新加費(fèi)用類型按鈕 修改 刪除 選擇 序號(hào) 費(fèi)用代碼 費(fèi)用類型 費(fèi)用說明Checkbox 1 01 辦公費(fèi) Checkbox 2 02 郵電費(fèi) Checkbox 3 說明:1、選中某條記錄,可以進(jìn)行修改,每次只能修改一條記錄; 2、刪除可以批量進(jìn)行,可以選中多條記錄進(jìn)行

9、刪除;3、點(diǎn)新加處理方式按鈕后,跳轉(zhuǎn)到下頁的新加處理方式界面;新加費(fèi)用類型新加費(fèi)用類型費(fèi)用代碼:_ 費(fèi)用類型:_費(fèi)用說明:_(textarea)保存按鈕說明:1、保存的時(shí)候,要檢測(cè)該費(fèi)用類型是否已經(jīng)存在,如果已經(jīng)存在,需要返回本頁并給出提示; 2、費(fèi)用代碼、費(fèi)用類型、費(fèi)用說明 均為必填項(xiàng); 5、賬號(hào)授權(quán)報(bào)銷維護(hù) 賬號(hào)授權(quán)報(bào)銷維護(hù) 賬號(hào)授權(quán) 賬號(hào)維護(hù) 處理方式維護(hù) 費(fèi)用類型維護(hù) 用戶維護(hù) 退出Banner(財(cái)務(wù)主管) 賬號(hào)授權(quán)新加賬號(hào)授權(quán)新加賬號(hào)授權(quán)按鈕 修改 刪除 賬號(hào)_ 授權(quán)人_查詢按鈕選擇 序號(hào) 賬號(hào) 授權(quán)人Checkbox 1 1000010001 張華Checkbox 2 100001

10、0002 李磊說明:1、選中某條記錄,可以進(jìn)行修改,每次只能修改一條記錄; 2、刪除可以批量進(jìn)行,可以選中多條記錄進(jìn)行刪除;3、點(diǎn)新加按鈕后,跳轉(zhuǎn)到下頁的新賬號(hào)授權(quán)界面;4、點(diǎn)下查詢按鈕后,本頁顯示查詢結(jié)果;新建賬號(hào)授權(quán)頁新建賬號(hào)授權(quán)頁賬號(hào):_(select) 授權(quán)人:_(select) 保存說明:1、賬號(hào)的下拉框是從賬號(hào)表中讀出; 2、授權(quán)人的下拉框是從用戶表中讀出,顯示用戶的真實(shí)姓名,存盤時(shí)存用戶的zjh;Banner報(bào)銷維護(hù)首頁6、報(bào)銷維護(hù)Banner報(bào)銷維護(hù)首頁報(bào)銷維護(hù)報(bào)銷維護(hù) 賬號(hào)授權(quán) 賬號(hào)維護(hù) 處理方式維護(hù) 費(fèi)用類型維護(hù) 用戶維護(hù) 退出新加 修改 刪除新加 修改 刪除賬號(hào):_(se

11、lect) 金額范圍_至_ 報(bào)銷時(shí)間_至_ 費(fèi)用類型:_ (select) 處理方式:_(select) 查詢按鈕選擇 序號(hào) 摘要 費(fèi)用類型 處理方式 金額 經(jīng)辦人 記錄人 報(bào)銷時(shí)間 備注 合計(jì): *說明:1、賬號(hào)是當(dāng)前用戶被授權(quán)的所有賬號(hào)下拉選擇;2、費(fèi)用類型、處理方式 都是下拉列表;3、頁面底部是當(dāng)頁的金額合計(jì)新加報(bào)銷記錄頁新加報(bào)銷記錄頁賬號(hào):_(select) 金額:_摘要:_費(fèi)用類型:_(select) 處理方式:_(select)報(bào)銷時(shí)間:_ 經(jīng)辦人:_保存按鈕說明:1、存盤的時(shí)候,自動(dòng)保存當(dāng)前用戶為錄入人;2、金額框,只能輸入數(shù)值型;三、數(shù)據(jù)庫設(shè)計(jì)計(jì)1、報(bào)銷明細(xì)表表2、用戶表3、費(fèi)

12、用類型4、賬號(hào)5、賬號(hào)授權(quán)四、運(yùn)行結(jié)果實(shí)實(shí)例用戶登錄報(bào)銷記錄列表賬號(hào)授權(quán)結(jié)果導(dǎo)出Exccel刪除之前必須進(jìn)進(jìn)行詢問與確確認(rèn)賬號(hào)維護(hù)用戶管理報(bào)銷處理方式的的維護(hù)費(fèi)用類型維護(hù)五、重點(diǎn)代碼剖剖析Struts-confiig.xmll Web.xmllEnncodeFFilterru.thciic.demmo.utiil.ReqqEncoddeFiltterReequesttEncoddeGGBKEnncodeFFilterr*.do actiion orgg.apacche.sttruts.actioon.ActtionSeervlett conffig /WEEB-INFF/struuts-coo

13、nfig.xml debuug 3 detaail 3 00 actiion *.do indeex.jspp /報(bào)銷明細(xì)的的Actioonpackagee cn.eedu.thhcic.ddemo.aactionn;import javaxx.servvlet.hhttp.HHttpSeervlettRequeest;import javaxx.servvlet.hhttp.HHttpSeervlettRespoonse;import org.aapachee.struuts.acction.ActioonFormm;import org.aapachee.struuts.acction.A

14、ctioonForwward;import org.aapachee.struuts.acction.ActioonMappping;import org.aapachee.struuts.acctionss.DisppatchAActionn;import cn.eddu.thccic.deemo.boo.BxmxxServiice;import cn.eddu.thccic.deemo.boo.ClfssServiice;import cn.eddu.thccic.deemo.boo.FylxxServiice;import cn.eddu.thccic.deemo.boo.ZhsqqSe

15、rviice;import cn.eddu.thccic.deemo.foorm.BxxmxForrm;import cn.eddu.thccic.deemo.voo.Bxmxx;import cn.eddu.thccic.deemo.voo.CwUsser;public classs BxmxxActioon exttends DispaatchAcction /報(bào)銷明細(xì)細(xì)的列表publicc ActiionForrward list(ActioonMappping mmappinng, AcctionFForm fform,HttppServlletReqquest requeest, H

16、HttpSeervlettRespoonse rresponnse)getLiistDatta(reqquest);returrn maappingg.finddForwaard(ssuccesss); /獲獲得列表需要要顯示的數(shù)據(jù)據(jù)privatte voiid gettListDData(HHttpSeervlettRequeest reequestt) BxmxSServicce bxmmxServvice = new BxmxSServicce();ZhsqSServicce zhssqServvice = new ZhsqSServicce();FylxSServicce fyllxS

17、ervvice = new FylxSServicce();ClfsSServicce clffsServvice = new ClfsSServicce();CwUseer useer = (CwUseer)reqquest.getSeessionn().geetAttrributee(useer);/找到當(dāng)當(dāng)前用戶有權(quán)權(quán)限看到的所所有報(bào)銷記錄錄requeest.seetAttrributee(bxmmxListt, bxxmxSerrvice.getUsserBxmmx(useer);/找到當(dāng)當(dāng)前用戶被授授權(quán)的全部賬賬號(hào)requeest.seetAttrributee(zhLList, z

18、hsqqServiice.geetUserrZhLisst(useer);/費(fèi)用類類型列表requeest.seetAttrributee(fyllxListt, fyylxSerrvice.getAlllFylxxList();/處理方方式列表requeest.seetAttrributee(clffsListt, cllfsSerrvice.getAlllClfssList() );/新加報(bào)銷銷明細(xì)publicc ActiionForrward saveOOrUpdaate(AcctionMMappinng mappping, ActiionForrm forrm,HttppServlle

19、tReqquest requeest, HHttpSeervlettRespoonse rresponnse)BxmxFForm bbxmxFoorm = (BxmxxForm)form;/把foorm里的屬屬性賦值給mmx實(shí)體Bxmx mx = new BBxmx();if(bxxmxForrm.gettId() != nuull & bxmxxForm.getIdd().trrim() != & bbxmxFoorm.geetId().lenggth()0) mx.seetId(LLong.pparseLLong(bbxmxFoorm.geetId();mx.seetFylxx(bxmxx

20、Form.getFyylx();mx.seetJe(DDoublee.parsseDoubble(bxxmxForrm.gettJe();mx.seetBxsjj(bxmxxForm.getBxxsj();mx.seetClfss(bxmxxForm.getCllfs();mx.seetBz(bbxmxFoorm.geetBz();mx.seetJbr(bxmxFForm.ggetJbrr();mx.seetJlr(CwUUser)rrequesst.gettSessiion().getAtttribuute(uuser).gettUsernname();mx.seetZh(bbxmxFoor

21、m.geetZh();mx.seetZy(bbxmxFoorm.geetZy();new BBxmxSeervicee().saaveOrUUpdateeClfs(mx);/做好返返回?cái)?shù)據(jù)準(zhǔn)備備this.getLiistDatta(reqquest);bxmxFForm.rreset(mappiing, rrequesst);returrn mappping.findFForwarrd(suuccesss);/刪除報(bào)銷銷明細(xì)publicc ActiionForrward delette(ActtionMaappingg mappping, ActioonFormm formm,HttppSer

22、vlletReqquest requeest, HHttpSeervlettRespoonse rresponnse)BxmxSServicce bxmmxServvice = new BxmxSServicce();Strinng id = reqquest.getPaarametter(iid);Bxmx mx = bxmxSServicce.gettBxmxBById(iid);bxmxSServicce.dellBxmx(mx);this.getLiistDatta(reqquest);returrn mappping.findFForwarrd(suuccesss);/* * 編輯某

23、某條記錄 * */publicc ActiionForrward toEdiit(ActtionMaappingg mappping, ActioonFormm formm,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) BxmxFForm bbxmxFoorm = (BxmxxForm)form;BxmxSServicce bxmmxServvice = new BxmxSServicce();Strinng id = reqquest.getPaarametter(iid);Bxmx mx = bxmx

24、SServicce.gettBxmxBById(iid);bxmxFForm.ssetBxssj(mx.getBxxsj();bxmxFForm.ssetBz(mx.geetBz();bxmxFForm.ssetClffs(mx.getCllfs();bxmxFForm.ssetFyllx(mx.getFyylx();bxmxFForm.ssetId(Strinng.vallueOf(mx.geetId();bxmxFForm.ssetJbrr(mx.ggetJbrr();bxmxFForm.ssetJe(Strinng.vallueOf(mx.geetJe();bxmxFForm.ssetJ

25、lrr(mx.ggetJlrr();bxmxFForm.ssetZy(mx.geetZy();bxmxFForm.ssetZh(mx.geetZh();this.getLiistDatta(reqquest);returrn mappping.findFForwarrd(suuccesss);packagee cn.eedu.thhcic.ddemo.aactionn;import javaxx.servvlet.hhttp.HHttpSeervlettRequeest;import javaxx.servvlet.hhttp.HHttpSeervlettRespoonse;import or

26、g.aapachee.struuts.acction.ActioonFormm;import org.aapachee.struuts.acction.ActioonForwward;import org.aapachee.struuts.acction.ActioonMappping;import org.aapachee.struuts.acctionss.DisppatchAActionn;import cn.eddu.thccic.deemo.boo.ClfssServiice;import cn.eddu.thccic.deemo.foorm.CllfsForrm;import cn

27、.eddu.thccic.deemo.voo.Clfss;public classs ClfssActioon exttends DispaatchAcction publicc ActiionForrward list(ActioonMappping mmappinng, AcctionFForm fform,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) ClfsFForm cclfsFoorm = (ClfssForm) formm;ClfsSServicce clffsServvice = new

28、ClfsSServicce();requeest.seetAttrributee(clffsListt, cllfsSerrvice.getAlllClfssList();returrn mappping.findFForwarrd(suuccesss);publicc ActiionForrward saveOOrUpdaate(AcctionMMappinng mappping, ActiionForrm forrm,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) ClfsFForm cclfsFoor

29、m = (ClfssForm) formm;ClfsSServicce clffsServvice = new ClfsSServicce();Clfs clfs = neww Clfss();clfs.setCllfs(cllfsForrm.gettClfs();if(cllfsForrm.gettId() != nuull & clfssForm.getIdd().trrim() != & cclfsFoorm.geetId().lenggth()0) clfs.setIdd(Longg.parsseLongg(clfssForm.getIdd();clfsSServicce.savveO

30、rUppdateCClfs(cclfs);requeest.seetAttrributee(clffsListt, cllfsSerrvice.getAlllClfssList();clfsFForm.rreset(mappiing, rrequesst);returrn mappping.findFForwarrd(suuccesss);/* * 編輯某某條記錄 * */publicc ActiionForrward toEdiit(ActtionMaappingg mappping, ActioonFormm formm,HttppServlletReqquest requeest, HH

31、ttpSeervlettRespoonse rresponnse) ClfsFForm cclfsFoorm = (ClfssForm) formm;ClfsSServicce clffsServvice = new ClfsSServicce();Strinng id = reqquest.getPaarametter(iid);Clfs clfs = clffsServvice.ggetClffsByIDD(id);clfsFForm.ssetClffs(clffs.gettClfs();clfsFForm.ssetId(Strinng.vallueOf(clfs.getIdd();req

32、ueest.seetAttrributee(clffsListt, cllfsSerrvice.getAlllClfssList();returrn mappping.findFForwarrd(suuccesss);publicc ActiionForrward delette(ActtionMaappingg mappping, ActioonFormm formm,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) ClfsFForm cclfsFoorm = (ClfssForm) formm;Clfs

33、SServicce clffsServvice = new ClfsSServicce();Strinng id = reqquest.getPaarametter(iid);Clfs clfs = clffsServvice.ggetClffsByIDD(id);clfsSServicce.dellClfs(clfs);requeest.seetAttrributee(clffsListt, cllfsSerrvice.getAlllClfssList();clfsFForm.rreset(mappiing, rrequesst);returrn mappping.findFForwarrd

34、(suuccesss);packagee cn.eedu.thhcic.ddemo.aactionn;import javaxx.servvlet.hhttp.HHttpSeervlettRequeest;import javaxx.servvlet.hhttp.HHttpSeervlettRespoonse;import org.aapachee.struuts.acction.ActioonFormm;import org.aapachee.struuts.acction.ActioonForwward;import org.aapachee.struuts.acction.Actioon

35、Mappping;import org.aapachee.struuts.acctionss.DisppatchAActionn;import cn.eddu.thccic.deemo.boo.UserrServiice;import cn.eddu.thccic.deemo.foorm.CwwUserFForm;import cn.eddu.thccic.deemo.voo.CwUsser;public classs CwUsserActtion eextendds DisspatchhActioon /用戶列表表publicc ActiionForrward list(ActioonMap

36、pping mmappinng, AcctionFForm fform,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) CwUseerFormm cwUsserForrm = (CwUseerFormm) forrm;UserSServicce useerServvice = new UserSServicce();requeest.seetAttrributee(useerListt, usserSerrvice.getUsserLisst();returrn mappping.findFForwarrd

37、(suuccesss);/新加用戶戶publicc ActiionForrward saveOOrUpdaate(AcctionMMappinng mappping, ActiionForrm forrm,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) CwUseerFormm cwUsserForrm = (CwUseerFormm) forrm;UserSServicce useerServvice = new UserSServicce();CwUseer useer = nnew CwwUser()

38、;if(cwwUserFForm.ggetId() != null & cwwUserFForm.ggetId().triim() != & cwwUserFForm.ggetId().lenngth()0)userr.setIId(Lonng.parrseLonng(cwUUserFoorm.geetId();user.setUssernamme(cwUUserFoorm.geetUserrname();user.setReealnamme(cwUUserFoorm.geetReallname();user.setRoole(cwwUserFForm.ggetRolle();userSSer

39、vicce.savveOrUppdate(user);requeest.seetAttrributee(useerListt, usserSerrvice.getUsserLisst();cwUseerFormm.reseet(mappping, requuest);returrn mappping.findFForwarrd(suuccesss);/* * 編輯某某條記錄 * */publicc ActiionForrward toEdiit(ActtionMaappingg mappping, ActioonFormm formm,HttppServlletReqquest requees

40、t, HHttpSeervlettRespoonse rresponnse) CwUseerFormm cwUsserForrm = (CwUseerFormm) forrm;UserSServicce useerServvice = new UserSServicce();Strinng id = reqquest.getPaarametter(iid);CwUseer useer = uuserSeervicee.getUUserByyId(idd);cwUseerFormm.setUUsernaame(usser.geetUserrname();cwUseerFormm.setRReal

41、naame(usser.geetReallname();cwUseerFormm.setRRole(uuser.ggetRolle();requeest.seetAttrributee(useerListt, usserSerrvice.getUsserLisst();returrn mappping.findFForwarrd(suuccesss);/刪除用戶戶publicc ActiionForrward delette(ActtionMaappingg mappping, ActioonFormm formm,HttppServlletReqquest requeest, HHttpSe

42、ervlettRespoonse rresponnse) CwUseerFormm cwUsserForrm = (CwUseerFormm) forrm;UserSServicce useerServvice = new UserSServicce();Strinng id = reqquest.getPaarametter(iid);CwUseer useer = uuserSeervicee.getUUserByyId(idd);userSServicce.dellUser(user);requeest.seetAttrributee(useerListt, usserSerrvice.

43、getUsserLisst();cwUseerFormm.reseet(mappping, requuest);returrn mappping.findFForwarrd(suuccesss);packagee cn.eedu.thhcic.ddemo.aactionn;import javaxx.servvlet.hhttp.HHttpSeervlettRequeest;import javaxx.servvlet.hhttp.HHttpSeervlettRespoonse;import org.aapachee.struuts.acction.ActioonFormm;import or

44、g.aapachee.struuts.acction.ActioonForwward;import org.aapachee.struuts.acction.ActioonMappping;import org.aapachee.struuts.acctionss.DisppatchAActionn;import cn.eddu.thccic.deemo.boo.FylxxServiice;import cn.eddu.thccic.deemo.foorm.FyylxForrm;import cn.eddu.thccic.deemo.voo.Fylxx;public classs FylxxA

45、ctioon exttends DispaatchAcction publicc ActiionForrward list(ActioonMappping mmappinng, AcctionFForm fform,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) FylxFForm ffylxFoorm = (FylxxForm) formm;getFyylxLisst(reqquest);returrn mappping.findFForwarrd(suuccesss);privatte voiid ge

46、ttFylxLList(HHttpSeervlettRequeest reequestt) /獲得所所有費(fèi)用類型型的列表FylxSServicce fyllxServvice = new FylxSServicce();requeest.seetAttrributee(fyllxListt, fyylxSerrvice.getAlllFylxxList();publicc ActiionForrward saveOOrUpdaate(AcctionMMappinng mappping, ActiionForrm forrm,HttppServlletReqquest requeest, HHt

47、tpSeervlettRespoonse rresponnse) FylxFForm ffylxFoorm = (FylxxForm) formm;Fylx fylx = neww Fylxx();if(fyylxForrm.gettId() != nuull & fylxxForm.getIdd().trrim() != & ffylxFoorm.geetId().lenggth()0)fylxx.setIId(Lonng.parrseLonng(fyllxFormm.getIId();fylx.setFyylx(fyylxForrm.gettFylx();fylx.setFyylxsm(f

48、ylxFForm.ggetFyllxsm();FylxSServicce fyllxServvice = new FylxSServicce();fylxSServicce.savveOrUppdate(fylx);getFyylxLisst(reqquest);returrn mappping.findFForwarrd(suuccesss);publicc ActiionForrward delette(ActtionMaappingg mappping, ActioonFormm formm,HttppServlletReqquest requeest, HHttpSeervlettRe

49、spoonse rresponnse) FylxFForm ffylxFoorm = (FylxxForm) formm;FylxSServicce fyllxServvice = new FylxSServicce();Strinng id = reqquest.getPaarametter(iid); Fylxx fylxx = fyylxSerrvice.getFyylxByIId(id);fylxSServicce.dellFylx(fylx);getFyylxLisst(reqquest);returrn mappping.findFForwarrd(suuccesss);/* *

50、編輯某某條記錄 * */publicc ActiionForrward toEdiit(ActtionMaappingg mappping, ActioonFormm formm,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse) FylxFForm ffylxFoorm = (FylxxForm) formm;FylxSServicce fyllxServvice = new FylxSServicce();Strinng id = reqquest.getPaarametter(iid); Fylxx fy

51、lxx = fyylxSerrvice.getFyylxByIId(id); fylxxForm.setFyylx(fyylx.geetFylxx(); fylxxForm.setFyylxsm(fylx.getFyylxsm(); fylxxForm.setIdd(Striing.vaalueOff(fylxx.getIId(); getFFylxLiist(reequestt);returrn mappping.findFForwarrd(suuccesss);packagee cn.eedu.thhcic.ddemo.aactionn;import javaxx.servvlet.hht

52、tp.HHttpSeervlettRequeest;import javaxx.servvlet.hhttp.HHttpSeervlettRespoonse;import org.aapachee.struuts.acction.Actioon;import org.aapachee.struuts.acction.ActioonFormm;import org.aapachee.struuts.acction.ActioonForwward;import org.aapachee.struuts.acction.ActioonMappping;import cn.eddu.thccic.de

53、emo.boo.UserrServiice;import cn.eddu.thccic.deemo.foorm.LooginFoorm;import cn.eddu.thccic.deemo.voo.CwUsser;public classs LogiinActiion exxtendss Actiion publicc ActiionForrward execuute(AcctionMMappinng mappping, ActiionForrm forrm,HttppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse)

54、 LoginnForm loginnForm = (LooginFoorm) fform;UserSServicce useerServvice = new UserSServicce(); /構(gòu)造造VO實(shí)體CwUseer useer = nnew CwwUser();user.setUssernamme(logginForrm.gettUsernname();user.setPaassworrd(logginForrm.gettPasswword();if(usserSerrvice.isCwUUser(uuser)/如果果是財(cái)務(wù)報(bào)銷銷系統(tǒng)的用戶戶,得到完整整的用戶對(duì)象象,裝入seessio

55、nnrequuest.ggetSesssion().settAttriibute(userr, usserSerrvice.getCwwUser(user);retuurn maappingg.finddForwaard(lloginSSuccesss);elseerequuest.ggetSesssion().settAttriibute(erroorMesssage, 登陸用用戶名或密碼碼錯(cuò)誤!);retuurn maappingg.finddForwaard(lloginEError);packagee cn.eedu.thhcic.ddemo.aactionn;import javax

56、x.servvlet.hhttp.HHttpSeervlettRequeest;import javaxx.servvlet.hhttp.HHttpSeervlettRespoonse;import org.aapachee.struuts.acction.ActioonFormm;import org.aapachee.struuts.acction.ActioonForwward;import org.aapachee.struuts.acction.ActioonMappping;import org.aapachee.struuts.acctionss.DisppatchAAction

57、n;import cn.eddu.thccic.deemo.boo.ZhSeervicee;import cn.eddu.thccic.deemo.foorm.ZhhForm;import cn.eddu.thccic.deemo.voo.Zh;public classs ZhAcction extennds DiispatcchActiion publicc ActiionForrward list(ActioonMappping mmappinng, AcctionFForm fform,HttppServlletReqquest requeest, HHttpSeervlettRespo

58、onse rresponnse) ZhForrm zhFForm = (ZhFForm) form;ZhSerrvice zhSerrvice = neww ZhSeervicee();requeest.seetAttrributee(zhLList, zhSeervicee.getAAllZhLList();returrn mappping.findFForwarrd(suuccesss);/* * 賬號(hào)新新加 * */publicc ActiionForrward saveOOrUpdaate(AcctionMMappinng mappping, ActiionForrm forrm,Ht

59、tppServlletReqquest requeest, HHttpSeervlettRespoonse rresponnse)ZhForrm zhFForm = (ZhFForm) form;ZhSerrvice zhSerrvice = neww ZhSeervicee();Zh zhh = neew Zh();zh.seetBz(zzhFormm.getBBz();zh.seetZh(zzhFormm.getZZh();zh.seetZhfzzr(zhFForm.ggetZhffzr();zh.seetZhmcc(zhFoorm.geetZhmcc();zh.seetZhztt(zhF

60、oorm.geetZhztt();if(zhhForm.getIdd() != nulll & zzhFormm.getIId().ttrim() != & zhForrm.gettId().lengtth()00)zh.ssetId(Long.parseeLong(zhForrm.gettId();zhSerrvice.saveOOrUpdaate(zhh);requeest.seetAttrributee(zhLList, zhSeervicee.getAAllZhLList();zhForrm.resset(maappingg, reqquest);returrn mappping.fi

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論