李丹M人事管理系統(tǒng)_第1頁
李丹M人事管理系統(tǒng)_第2頁
李丹M人事管理系統(tǒng)_第3頁
李丹M人事管理系統(tǒng)_第4頁
李丹M人事管理系統(tǒng)_第5頁
已閱讀5頁,還剩32頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

M人事管理系統(tǒng)JAVA程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告課題:mini人事管理系統(tǒng)姓名:學(xué)號(hào):201214同組姓名:專業(yè)班級(jí):網(wǎng)工指導(dǎo)教師:設(shè)計(jì)時(shí)間:2014年6月17日目錄一系統(tǒng)描述...............................................1(一)前言...............................................1(二)開發(fā)系統(tǒng)的功能介紹.................................1二分析與設(shè)計(jì)...............................................2(一)功能模塊劃分.......................................2(二)數(shù)據(jù)庫結(jié)構(gòu)描述.....................................2(三)各個(gè)模塊實(shí)現(xiàn)方法描述.............................3(四)測(cè)試數(shù)據(jù)及期望結(jié)果.................................3三源代碼...................................................5(一)主頁面設(shè)計(jì)........................................5(二)記錄添加界面的開發(fā)設(shè)計(jì).............................11(三)上班登記子系統(tǒng)開發(fā)設(shè)計(jì).............................13(四)信息統(tǒng)計(jì)頁面的設(shè)計(jì)開發(fā).............................15四系統(tǒng)測(cè)試................................................18五總結(jié)..................................................21(一)實(shí)驗(yàn)心得..........................................21(二)參考文獻(xiàn)..........................................22一.系統(tǒng)描述(一)前言隨著科學(xué)技術(shù)的不斷提高,計(jì)算機(jī)科學(xué)日漸成熟,其強(qiáng)大的功能已為人們深刻認(rèn)識(shí),它已進(jìn)入人類社會(huì)的各個(gè)領(lǐng)域并發(fā)揮著越來越重要的作用。作為計(jì)算機(jī)應(yīng)用的一部分,使用計(jì)算機(jī)對(duì)人事信息進(jìn)行管理,具有著手工管理所無法比擬的優(yōu)點(diǎn).例如:本低等。這些優(yōu)點(diǎn)能夠極大地提高人事理的效率,也是企業(yè)的科學(xué)化、正規(guī)化管理,高素質(zhì)的管理人員,而且也需要信息化工具進(jìn)行輔助軟件系統(tǒng)來于小型的企事業(yè)單位,不啻于“殺雞用牛刀,因此小型的的軟件對(duì)于這種單位自然有十分重要作用。(二)開發(fā)系統(tǒng)的功能介紹1.上班登記子系統(tǒng)上班登記子系統(tǒng)主要對(duì)所有員工的上班信息進(jìn)行登記,包括員工的工號(hào)、員班時(shí)間信息的記錄2.下班登記子系統(tǒng)班時(shí)間信息的記錄。3.請(qǐng)假登記子系統(tǒng)請(qǐng)假登記子系統(tǒng)主要對(duì)所有員工的請(qǐng)假信息進(jìn)行登記,包括員工的工號(hào)、員假時(shí)間信息的記錄。4.信息統(tǒng)計(jì)子系統(tǒng)5.記錄添加子系統(tǒng)時(shí)間和備注。二.分析與設(shè)計(jì)總結(jié)到一塊。大家一起研究錯(cuò)誤出在哪里,該怎么改正這些錯(cuò)誤。(一)功能模塊劃分本系統(tǒng)分為如下的幾大模塊:Mini人事管理系統(tǒng)上班登記請(qǐng)假登記退出系統(tǒng)(二)數(shù)據(jù)庫結(jié)構(gòu)描述在這個(gè)MINImysqlmysql每個(gè)子系統(tǒng)里面讀取的數(shù)據(jù)部分不同。設(shè)計(jì)的表如下:如表一列名數(shù)據(jù)類型可否允空長(zhǎng)度工號(hào)數(shù)值型否50姓名字符型否50上班時(shí)間日期型否30下班時(shí)間日期型否30請(qǐng)假時(shí)間日期型是30備注字符型是50(三)各個(gè)模塊實(shí)現(xiàn)方法描述1)上班登記模塊描述(負(fù)責(zé)人:李丹)上班登記子系統(tǒng)主要包括一個(gè)上班信息統(tǒng)計(jì)界面和一個(gè)上班信息添加界面。不符合要求,可以將此條記錄刪除。上班信息添加界面主要是員工工號(hào)、員工姓名、相應(yīng)時(shí)間和相關(guān)備注信息。可以根據(jù)信息添加界面上的系統(tǒng)時(shí)間指示來填入相應(yīng)的時(shí)間。其流程圖為:(四)測(cè)試數(shù)據(jù)及期望結(jié)果登錄界面,各種情況。時(shí)也許還需要返回初始階段。期望結(jié)果:比方說,員工A3:00來上班,點(diǎn)擊上班登記,手動(dòng)添加上班記的全部記錄。三.源代碼(一)主頁面的設(shè)計(jì)開發(fā)packagemanpowersystem;importjavax.swing.*;importjava.awt.event.*;importjava.awt.*;importcom.borland.jbcl.layout.*;importjavax.swing.event.*;/***<p>Title:</p>*<p>Description:</p>*<p>Copyright:Copyright(c)2003</p>*<p>Company:</p>*@authornotattributable*@version1.0*/publicclassMainFrameextendsJFrame{privateImageIconfmImage;//主框架面板代碼文件聲明的屬性和變量XYLayoutxYLayout1=newXYLayout();JButtonjTitleButton=newJButton();JButtonjOnWorkButton=newJButton();JButtonjOffWorkButton=newJButton();JButtonjLeaveWorkButton=newJButton();JButtonjStaticButton=newJButton();JButtonjExitButton=newJButton();publicMainFrame(){try{jbInit();addWindowListener(newWindowAdapter(){//窗口事件監(jiān)聽publicvoidwindowClosing(WindowEvente){dispose();//銷毀窗口}});}catch(Exceptione){e.printStackTrace();}}publicstaticvoidmain(String[]args){MainFramemainFrame=newMainFrame();mainFrame.validate();mainFrame.setLocation(200,150);mainFrame.setSize(600,480);mainFrame.setVisible(true);mainFrame.pack();}privatevoidjbInit()throwsException{fmImage=newImageIcon(manpowersystem.MainFrame.class.getResource("Fengmian.png"));jTitleButton.setBackground(newColor(210,138,177));jTitleButton.setIcon(fmImage);jTitleButton.setFocusable(false);//此按鈕的聚焦作用失效xYLayout1.setWidth(540);xYLayout1.setHeight(407);this.getContentPane().setBackground(newColor(210,138,177));this.setLocale(java.util.Locale.getDefault());this.setResizable(true);this.setTitle("Mini人事管理系統(tǒng)");this.addWindowListener(newMainFrame_this_windowAdapter(this));this.getContentPane().setLayout(xYLayout1);jOnWorkButton.setBackground(newColor(212,158,217));jOnWorkButton.setFont(newjava.awt.Font("DialogInput",1,16));jOnWorkButton.setText("上班登記");jOnWorkButton.addActionListener(newMainFrame_jOnWorkButton_actionAdapter(this));jOnWorkButton.addHierarchyBoundsListener(newMainFrame_jOnWorkButton_hierarchyBoundsAdapter(this));OffWorkButton.setBackground(newColor(212,158,217));jOffWorkButton.setFont(newjava.awt.Font("DialogInput",1,16));jOffWorkButton.setText("下班登記");jOffWorkButton.addActionListener(newMainFrame_jOffWorkButton_actionAdapter(this));jOffWorkButton.addAncestorListener(newMainFrame_jOffWorkButton_ancestorAdapter(this));jLeaveWorkButton.setBackground(newColor(212,158,217));jLeaveWorkButton.setFont(newjava.awt.Font("DialogInput",1,16));jLeaveWorkButton.setText("請(qǐng)假登記");jLeaveWorkButton.addActionListener(newMainFrame_jLeaveWorkButton_actionAdapter(this));jLeaveWorkButton.addAncestorListener(newMainFrame_jLeaveWorkButton_ancestorAdapter(this));jStaticButton.setBackground(newColor(212,158,217));jStaticButton.setFont(newjava.awt.Font("DialogInput",1,16));jStaticButton.setText("統(tǒng)計(jì)情況");jStaticButton.addActionListener(newMainFrame_jStaticButton_actionAdapter(this));jStaticButton.addAncestorListener(newMainFrame_jStaticButton_ancestorAdapter(this));jExitButton.setBackground(newColor(212,158,217));jExitButton.setFont(newjava.awt.Font("DialogInput",1,16));jExitButton.setText("退出系統(tǒng)");jExitButton.addActionListener(newMainFrame_jExitButton_actionAdapter(this));jExitButton.addAncestorListener(newMainFrame_jExitButton_ancestorAdapter(this));this.getContentPane().add(jTitleButton,newXYConstraints(0,0,358,409));this.getContentPane().add(jOnWorkButton,newXYConstraints(393,35,115,45));this.getContentPane().add(jOffWorkButton,newXYConstraints(393,109,115,45));this.getContentPane().add(jLeaveWorkButton,newXYConstraints(393,184,115,45));this.getContentPane().add(jStaticButton,newXYConstraints(393,258,115,45));this.getContentPane().add(jExitButton,newXYConstraints(393,332,115,45));this.setResizable(false);}voidthis_windowClosed(WindowEvente){System.exit(0);}voidjOnWorkButton_ancestorMoved(HierarchyEvente){}voidjOffWorkButton_ancestorMoved(AncestorEvente){}voidjLeaveWorkButton_ancestorMoved(AncestorEvente){}voidjStaticButton_ancestorMoved(AncestorEvente){}voidjExitButton_ancestorMoved(AncestorEvente){}voidjExitButton_actionPerformed(ActionEvente){System.exit(0);}//退出系統(tǒng)按鈕的事件處理voidjOnWorkButton_actionPerformed(ActionEvente){OnWorkPanelonWorkPanel=newOnWorkPanel();onWorkPanel.setVisible(true);}//上班登記按鈕的事件處理voidjOffWorkButton_actionPerformed(ActionEvente){OffWorkPaneloffWorkPanel=newOffWorkPanel();offWorkPanel.setVisible(true);}//下班登記按鈕的事件處理voidjLeaveWorkButton_actionPerformed(ActionEvente){LeaveWorkPanelleaveWorkPanel=newLeaveWorkPanel();leaveWorkPanel.setVisible(true);}//請(qǐng)假登記按鈕的事件處理voidjStaticButton_actionPerformed(ActionEvente){StaticPanelstaticPanel=newStaticPanel();staticPanel.setVisible(true);}//統(tǒng)計(jì)情況按鈕的事件處理}ClassMainFrame_this_windowAdapterextendsjava.awt.event.WindowAdapter{MainFrameadaptee;MainFrame_this_windowAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidwindowClosed(WindowEvente){adaptee.this_windowClosed(e);}}classMainFrame_jOnWorkButton_hierarchyBoundsAdapterextendsjava.awt.event.HierarchyBoundsAdapter{MainFrameadaptee;MainFrame_jOnWorkButton_hierarchyBoundsAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidancestorMoved(HierarchyEvente){adaptee.jOnWorkButton_ancestorMoved(e);}}classMainFrame_jOffWorkButton_ancestorAdapterimplementsjavax.swing.event.AncestorListener{MainFrameadaptee;MainFrame_jOffWorkButton_ancestorAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidancestorAdded(AncestorEvente){}publicvoidancestorRemoved(AncestorEvente){}publicvoidancestorMoved(AncestorEvente){adaptee.jOffWorkButton_ancestorMoved(e);}}classMainFrame_jLeaveWorkButton_ancestorAdapterimplementsjavax.swing.event.AncestorListener{MainFrameadaptee;MainFrame_jLeaveWorkButton_ancestorAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidancestorAdded(AncestorEvente){}publicvoidancestorRemoved(AncestorEvente){}publicvoidancestorMoved(AncestorEvente){adaptee.jLeaveWorkButton_ancestorMoved(e);}}classMainFrame_jStaticButton_ancestorAdapterimplementsjavax.swing.event.AncestorListener{MainFrameadaptee;MainFrame_jStaticButton_ancestorAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidancestorAdded(AncestorEvente){}publicvoidancestorRemoved(AncestorEvente){}publicvoidancestorMoved(AncestorEvente){adaptee.jStaticButton_ancestorMoved(e);}}classMainFrame_jExitButton_ancestorAdapterimplementsjavax.swing.event.AncestorListener{MainFrameadaptee;MainFrame_jExitButton_ancestorAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidancestorAdded(AncestorEvente){}publicvoidancestorRemoved(AncestorEvente){}publicvoidancestorMoved(AncestorEvente){adaptee.jExitButton_ancestorMoved(e);}}classMainFrame_jExitButton_actionAdapterimplementsjava.awt.event.ActionListener{MainFrameadaptee;MainFrame_jExitButton_actionAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidactionPerformed(ActionEvente){adaptee.jExitButton_actionPerformed(e);}}classMainFrame_jOnWorkButton_actionAdapterimplementsjava.awt.event.ActionListener{MainFrameadaptee;MainFrame_jOnWorkButton_actionAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidactionPerformed(ActionEvente){adaptee.jOnWorkButton_actionPerformed(e);}}classMainFrame_jOffWorkButton_actionAdapterimplementsjava.awt.event.ActionListener{MainFrameadaptee;MainFrame_jOffWorkButton_actionAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidactionPerformed(ActionEvente){adaptee.jOffWorkButton_actionPerformed(e);}}classMainFrame_jLeaveWorkButton_actionAdapterimplementsjava.awt.event.ActionListener{MainFrameadaptee;MainFrame_jLeaveWorkButton_actionAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidactionPerformed(ActionEvente){adaptee.jLeaveWorkButton_actionPerformed(e);}}classMainFrame_jStaticButton_actionAdapterimplementsjava.awt.event.ActionListener{MainFrameadaptee;MainFrame_jStaticButton_actionAdapter(MainFrameadaptee){this.adaptee=adaptee;}publicvoidactionPerformed(ActionEvente){adaptee.jStaticButton_actionPerformed(e);}}(二)記錄添加界面的開發(fā)設(shè)計(jì)packagemanpowersystem;/***<p>Title:</p>*<p>Description:</p>*<p>Copyright:Copyright(c)2003</p>*<p>Company:</p>*@authornotattributable*@version1.0*/importjava.io.*;importjava.util.*;importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjavax.swing.event.*;importjavax.swing.border.*;importjavax.swing.table.*;publicclassRecordItem{privateStringstrEmployeeID;privateStringstrEmployeeName;privateStringstrOnWorkTime;privateStringstrOffWorkTime;privateStringstrLeaveWorkTime;privateStringstrDescribe;publicRecordItem(){strEmployeeID=newString("");strEmployeeName=newString("");strOnWorkTime=newString("");strOffWorkTime=newString("");strLeaveWorkTime=newString("");strDescribe=newString("");}publicvoidSetOnworkItem(StringstrEmployeeID,StringstrEmployeeName,StringstrOnWorkTime,StringstrDescribe){this.strEmployeeID=strEmployeeID;this.strEmployeeName=strEmployeeName;this.strOnWorkTime=strOnWorkTime;this.strDescribe=strDescribe;}publicvoidSetOffworkItem(StringstrEmployeeID,StringstrEmployeeName,StringstrOffWorkTime,StringstrDescribe){this.strEmployeeID=strEmployeeID;this.strEmployeeName=strEmployeeName;this.strOffWorkTime=strOffWorkTime;this.strDescribe=strDescribe;}publicvoidSetLeaveworkItem(StringstrEmployeeID,StringstrEmployeeName,StringstrLeaveWorkTime,StringstrDescribe){this.strEmployeeID=strEmployeeID;this.strEmployeeName=strEmployeeName;this.strLeaveWorkTime=strLeaveWorkTime;this.strDescribe=strDescribe;}publicStringGetEmployeeID(){returnstrEmployeeID;}publicStringGetEmployeeName(){returnstrEmployeeName;}publicStringGetOnWorkTime(){returnstrOnWorkTime;}publicStringGetOffWorkTime(){returnstrOffWorkTime;}publicStringGetLeaveWorkTime(){returnstrLeaveWorkTime;}publicStringGetDescribe(){returnstrDescribe;}publicvoidSetEmployeeID(StringstrEmployeeID){this.strEmployeeID=strEmployeeID;}publicvoidSetEmployeeName(StringstrEmployeeName){this.strEmployeeName=strEmployeeName;}publicvoidSetOnWorkTime(StringstrOnWorkTime){this.strOnWorkTime=strOnWorkTime;}publicvoidSetOffWorkTime(StringstrOffWorkTime){this.strOffWorkTime=strOffWorkTime;}publicvoidSetLeaveWorkTime(StringstrLeaveWorkTime){this.strLeaveWorkTime=strLeaveWorkTime;}publicvoidSetDescribe(StringstrDescribe){this.strDescribe=strDescribe;}}(三)上班登記子系統(tǒng)開發(fā)設(shè)計(jì)packagemanpowersystem;/***<p>Title:</p>*<p>Description:</p>*<p>Copyright:Copyright(c)2003</p>*<p>Company:</p>*@authornotattributable*@version1.0*/importjava.io.*;importjava.util.*;importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjavax.swing.event.*;importjavax.swing.border.*;importjavax.swing.table.*;importjava.util.*;importcom.borland.jbcl.layout.*;publicclassOnWorkPanelextendsTablePanel{String[]arrField={"工號(hào)","姓名","上班時(shí)間","備注"};publicOnWorkPanel(){tableModel=newDefaultTableModel(arrData,arrField);jRecordTable=newJTable(tableModel);jTableScrollPane.getViewport().add(jRecordTable,null);UpdateRecord();//更新表格this.setTitle("上班登記頁面");}publicvoidAddRecord(){OnWorkRecordPanerecordPane=newOnWorkRecordPane();recordPane.setSize(630,300);recordPane.setLocation(230,100);recordPane.setVisible(true);recordPane.setResizable(false);recordPane.validate();UpdateRecord();//更新表格}publicvoidDelRecord(){jTableScrollPane.getViewport().add(jRecordTable,null);intRow=jRecordTable.getSelectedRow();if(intRow==-1)return;try{database.DeleteData(tableModel.getValueAt(intRow,0).toStri());}catch(Exceptione){e.printStackTrace();}UpdateRecord();//更新表格}publicvoidUpdateRecord(){Object[][]arrTmp={};//設(shè)定表格的字段tableModel=newDefaultTableModel(arrTmp,arrField);jRecordTable=newJTable(tableModel);jTableScrollPane.getViewport().add(jRecordTable,null);try{RecordItem[]result=newRecordItem[100];for(intj=0;j<100;j++)result[j]=newRecordItem();result=database.AccessData();for(inti=0;i<result.length;i++){Objectnewdata[]={result[i].GetEmployeeID(),result[i].GetEmployeeName(),result[i].GetOnWorkTime(),result[i].GetDescribe()};StringstrTmp=result[i].GetOnWorkTime();if(strTmp.trim().length()==0)continue;tableModel.addRow(newdata);}}catch(Exceptione){e.printStackTrace();}}}publicclassOnWorkRecordPaneextendsRecordPane{publicOnWorkRecordPane(){}publicvoidRestoreRecord(){StringstrTmp=jEmployeeIDTextField.getText();if(strTmp.trim().length()==0){this.dispose();return;}item.SetOnworkItem(jEmployeeIDTextField.getText(),jEmployeeNameTextField.getText(),jDateTimeTextField.getText(),jReasonTextField.getText());try{database.StoreData(item);}catch(Exceptione){e.printStackTrace();}this.dispose();}}(四)信息統(tǒng)計(jì)頁面的設(shè)計(jì)開發(fā)packagemanpowersystem;importjava.util.*;importjava.awt.*;importjavax.swing.*;publicclassClockextendsJPanelimplementsRunnable{booleankeepRunning=true;intlastxs=0,lastys=0,lastxm=0,lastym=0,lastxh=0,lastyh=0;Datedummy=newDate();Stringlastdate=dummy.toLocaleString();StringmyName;publicClock(StringinName){myName=newString(inName);}publicvoidplotpoints(intx0,inty0,intx,inty,Graphicsg){g.drawLine(x0+x,y0+y,x0+x,y0+y);g.drawLine(x0+y,y0+x,x0+y,y0+x);g.drawLine(x0+y,y0-x,x0+y,y0-x);g.drawLine(x0+x,y0-y,x0+x,y0-y);g.drawLine(x0-x,y0-y,x0-x,y0-y);g.drawLine(x0-y,y0-x,x0-y,y0-x);g.drawLine(x0-y,y0+x,x0-y,y0+x);g.drawLine(x0-x,y0+y,x0-x,y0+y);}publicvoidcircle(intx0,inty0,intr,Graphicsg){intx,y;floatd;x=0;y=r;d=5/4-r;plotpoints(x0,y0,x,y,g);while(y>x){if(d<0){d=d+2*x+3;x++;}else{d=d+2*(x-y)+5;x++;y--;}plotpoints(x0,y0,x,y,g);}}publicvoidpaintComponent(Graphicsg){super.paintComponent(g);intxh,yh,xm,ym,xs,ys,s,m,h,xcenter,ycenter;Stringtoday;Datedat=newDate();s=dat.getSeconds();m=dat.getMinutes();h=dat.getHours();today=dat.toLocaleString();xcenter=getWidth()/2;ycenter=getHeight()/2-10;xs=(int)(Math.cos(s*3.14f/30-3.14f/2)*35+xcenter);ys=(int)(Math.sin(s*3.14f/30-3.14f/2)*35+ycenter);xm=(int)(Math.cos(m*3.14f/30-3.14f/2)

溫馨提示

  • 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)論