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

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

M人事管理系統JAVA程序設計課程設計報告課題:mini人事管理系統姓名:學號:201214同組姓名:專業(yè)班級:網工指導教師:設計時間:2014年6月17日目錄一系統描述...............................................1(一)前言...............................................1(二)開發(fā)系統的功能介紹.................................1二分析與設計...............................................2(一)功能模塊劃分.......................................2(二)數據庫結構描述.....................................2(三)各個模塊實現方法描述.............................3(四)測試數據及期望結果.................................3三源代碼...................................................5(一)主頁面設計........................................5(二)記錄添加界面的開發(fā)設計.............................11(三)上班登記子系統開發(fā)設計.............................13(四)信息統計頁面的設計開發(fā).............................15四系統測試................................................18五總結..................................................21(一)實驗心得..........................................21(二)參考文獻..........................................22一.系統描述(一)前言隨著科學技術的不斷提高,計算機科學日漸成熟,其強大的功能已為人們深刻認識,它已進入人類社會的各個領域并發(fā)揮著越來越重要的作用。作為計算機應用的一部分,使用計算機對人事信息進行管理,具有著手工管理所無法比擬的優(yōu)點.例如:本低等。這些優(yōu)點能夠極大地提高人事理的效率,也是企業(yè)的科學化、正規(guī)化管理,高素質的管理人員,而且也需要信息化工具進行輔助軟件系統來于小型的企事業(yè)單位,不啻于“殺雞用牛刀,因此小型的的軟件對于這種單位自然有十分重要作用。(二)開發(fā)系統的功能介紹1.上班登記子系統上班登記子系統主要對所有員工的上班信息進行登記,包括員工的工號、員班時間信息的記錄2.下班登記子系統班時間信息的記錄。3.請假登記子系統請假登記子系統主要對所有員工的請假信息進行登記,包括員工的工號、員假時間信息的記錄。4.信息統計子系統5.記錄添加子系統時間和備注。二.分析與設計總結到一塊。大家一起研究錯誤出在哪里,該怎么改正這些錯誤。(一)功能模塊劃分本系統分為如下的幾大模塊:Mini人事管理系統上班登記請假登記退出系統(二)數據庫結構描述在這個MINImysqlmysql每個子系統里面讀取的數據部分不同。設計的表如下:如表一列名數據類型可否允空長度工號數值型否50姓名字符型否50上班時間日期型否30下班時間日期型否30請假時間日期型是30備注字符型是50(三)各個模塊實現方法描述1)上班登記模塊描述(負責人:李丹)上班登記子系統主要包括一個上班信息統計界面和一個上班信息添加界面。不符合要求,可以將此條記錄刪除。上班信息添加界面主要是員工工號、員工姓名、相應時間和相關備注信息??梢愿鶕畔⑻砑咏缑嫔系南到y時間指示來填入相應的時間。其流程圖為:(四)測試數據及期望結果登錄界面,各種情況。時也許還需要返回初始階段。期望結果:比方說,員工A3:00來上班,點擊上班登記,手動添加上班記的全部記錄。三.源代碼(一)主頁面的設計開發(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人事管理系統");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("請假登記");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("統計情況");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("退出系統");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);}//退出系統按鈕的事件處理voidjOnWorkButton_actionPerformed(ActionEvente){OnWorkPanelonWorkPanel=newOnWorkPanel();onWorkPanel.setVisible(true);}//上班登記按鈕的事件處理voidjOffWorkButton_actionPerformed(ActionEvente){OffWorkPaneloffWorkPanel=newOffWorkPanel();offWorkPanel.setVisible(true);}//下班登記按鈕的事件處理voidjLeaveWorkButton_actionPerformed(ActionEvente){LeaveWorkPanelleaveWorkPanel=newLeaveWorkPanel();leaveWorkPanel.setVisible(true);}//請假登記按鈕的事件處理voidjStaticButton_actionPerformed(ActionEvente){StaticPanelstaticPanel=newStaticPanel();staticPanel.setVisible(true);}//統計情況按鈕的事件處理}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ā)設計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;}}(三)上班登記子系統開發(fā)設計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={"工號","姓名","上班時間","備注"};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={};//設定表格的字段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();}}(四)信息統計頁面的設計開發(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等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論