• 750.00 KB
  • 2022-05-17 13:06:35 发布

职工考勤管理信息系统课程设计指导书(陈伟强10261023)

  • 22页
  • 当前文档由用户上传发布,收益归属用户
  1. 1、本文档共5页,可阅读全部内容。
  2. 2、本文档内容版权归属内容提供方,所产生的收益全部归内容提供方所有。如果您对本文有版权争议,可选择认领,认领后既往收益都归您。
  3. 3、本文档由用户上传,本站不保证质量和数量令人满意,可能有诸多瑕疵,付费之前,请仔细先通过免费阅读内容等途径辨别内容交易风险。如存在严重挂羊头卖狗肉之情形,可联系本站下载客服投诉处理。
  4. 文档侵权举报电话:19940600175。
《数据库系统原理课程设计报告》考勤管理系统学生姓名:陈伟强10261023系别:计科院班级:10计11专业:计算机科学与技术指导教师:唐蕾22 职工考勤管理信息系统的设计与实现一、绪论随着科学技术的不断发展,计算机科学日渐进步,其强大的功能耳闻目睹,它已进入人类社会的各个领域并发挥着越来越重要的作用。由于在之前学习课程像c++等的课程设计中遇到过要求实现功能与此实验相似的情况,所以选择此课题作为课程设计作业。此职工考勤管理信息系统的实现利用了计算机的相关技术,满足了单位日常考勤管理的需求,使单位考勤过程更加快速,安全,高效的信息管理系统。本系统基于C/S模式,采用java语言与SQLSERVER2000数据库开发完成,实现了职工出差信息管理,职工请假信息管理功能。其中职工出差信息管理主要包括出差起始时间、结束时间、统计总共天数等,职工请假信息管理主要包括请假开始时间,结束时间,统计请假天数等。本系统能基本满足用户在考勤管理方面的需求,界面较简洁,符合用户使用习惯能实际地提高单位的考勤管理的效率。 二、系统分析随着企业人事管理的日趋复杂和企业人员的增多,企业的考勤管理变得越来越复杂。规范的考勤管理是现代企业提高管理效益的重要保证,而传统的人工管理存在着效率低、不易统计、成本高和易出错等弊端,已经无法适应现代企业的需求。。本实验实现的职工信息管理系统主要包括以下功能:(1)提供简单、方便的操作;(2)根据企业原来的考勤管理制度,为企业不同管理层次提供相应的功能;(3)通过考勤管理无纸化的实现,使企业的考勤管理更加科学规范;(4)节省考勤管理的成本;(5)对系统提供必要的权限管理,具备一定的安全性管理功能。包括输入登录用户名和密码;(6)为企业实现整体信息化的其他相关系统提供必要的数据支持;(7)完成数据的录入和修改,并提交数据库保存。其中的数据包括:出差信息、请假信息;(8)系统功能基本要求:出差信息,包括出差起始时间、结束时间、统计总共天数等;请假信息,包括请假开始时间,结束时间,统计请假天数等;三、系统设计22 3.1功能模块设计本系统采用C/S体系结构,客户端负责提供表达逻辑、显示用户界面信息、访问数据库服务器,采用PowerBuilder9作为开发工具;服务器端则用于提供数据服务,采用SQLServer2000作为数据库管理系统。本系统按照功能划分为以下四个模块:职工请假信息管理(包括请假开始时间,结束时间,统计请假天数等),职工出差信息管理(包括出差起始时间、结束时间、统计总共天数等)系统的功能模块图如图1所示: 职工考勤管理信息系统     请假信息管理出差信息管理   图1系统的功能模块图3.2数据库设计3.2.1数据库概念结构设计本系统主要有职工信息、出差信息、请假信息、加班信息、出勤信息和职工考勤信息六个实体集。一个职工考勤信息包含有一个职工信息、一个出差信息、一个请假信息、一个出勤信息和一个加班信息。每个信息中又由多个属性组成。(1)每个本系统的E-R图如图2.1所示:用户口令用户名 图2.1系统的E-R图22 (2)图2.2为出差E-R图出差记录职工编号出差编号缺勤记录开始时间结束时间图2.2系统的职工出差E-R图(3)图2.3为请假E-R图请假记录请假编号编号请假统计开始时间结束时间图2.3系统中职工请假E-R图3.2.2数据库逻辑结构设计在物理结构中,数据的基本存取单位是存储记录。有了逻辑结构以后,就可以设计存储记录结构,一个存储记录可以与多个逻辑记录相对应。存储记录就包括记录的组成,数据项的类型和长度等。根据关系模型的转换原则,上面的E—R图可转换为如下所示的关系模型:evection(Wnum,Wname,Wleave,Wreturn,Wdays)其中各项含义分别为:出差信息(职工编号,职工姓名,出差开始时间,出差结束时间,出差天数)vacation(Wnum,Wname,Wstart,Wend,Wvadays)其中各项含义分别为:请假信息(职工编号,职工姓名,请假开始时间,请假结束时间,请假天数)load(User,psw)其中各项含义分别为:登录(用户名,口令)根据上面的22 E-R图设计及关系模型的设计,得出数据表的设计,在本系统中主要的数据表如下:表1出差信息表evecion的表结构主码列名数据类型宽度小数位空否备注PkWnumChar20 N职工编号 PkWnameChar20 Y姓名 WleaveDatetime Y出差开始时间 WreturnDatetimeY出差结束时间WdaysSmallintY出差天数创建表1的SQL语句如下:createtableevection(Wnumchar(20),Wnamechar(10),primarykey(Wnum,Wname),foreignkey(Wnum,Wname)referenceszhigongxinxi4(Wnum,Wname)ondeletecascadeonupdatecascade,Wleavedatetime,Wreturndatetime,Wdayssmallint,)表2请假信息表vacation的表结构主码列名数据类型宽度小数位空否备注PkWnumChar20 N职工编号WnameChar20 N姓名 WstartDatetimeY请假开始时间WendDatetimeY请假结束时间WvadaysSmallintY请假天数创建表3的SQL语句如下:createtableqingjia(Wnumchar(20),Wnamechar(10),primarykey(Wnum,Wname),foreignkey(Wnum,Wname)referenceszhigongxinxi4(Wnum,Wname)ondeletecascadeonupdatecascade,Wstartdatetime,Wenddatetime,Wvadayssmallint,)22 表3登录表load的表结构主码列名数据类型宽度小数位空否备注PkUserChar20 N用户名 pswChar20 Y口令创建表3的SQL语句如下:createtableload(Userchar(20)primarykey,pswchar(20),)四、系统实现结合Eclipse进行数据库应用开发的特点,设计过程可按如下步骤进行:l        创建主函数,设计一个Frame框架,用来调用相关类的实例,实现操作功能;l        创建职工请假类和出差类;l        创建类的事件监听,用来响应添加,查询,浏览,删除等功能;l        创建数据窗口和数据源,将数据库与应用程序相连接;l        创建各个类的窗口中放置所需控件和可视化用户图形界面。4.1 创建主函数,设计一个Frame框架,用来调用相关类的实例,实现操作功能;利用Eclipse创建工程WorkManage,进一步创建包workManageg,在创建主类名为WorkManage,注释为“职工考勤信息管理系统”。按照下面的方法,编写相应代码:⑴点击“新建类”新建一个类,名为“WorkManage”。⑵创建主函数,并创建一个Frame容器用来添加各种组件,程序代码如下:packageworkManae;/*职工考勤信息管理管理系统。程序名:WorkManage.java**/importjava.awt.*;importjava.awt.event.*;importjava.sql.*;importjava.util.*;importjava.util.Date;importjavax.swing.*;importjava.text.ParseException;importjava.text.SimpleDateFormat;importjava.util.*;importjava.applet.*;classWorkManage4{publicstaticvoidmain(Stringargs[])throwsParseException{22 dbframedb=newdbframe("职工考勤信息管理系统");}}//职工考勤信息管理系统主界面classdbframeextendsFrameimplementsActionListener{//成员变量//登录booleancanLogin;LabellabelLogIn=newLabel("系统登录");LabellabelUser=newLabel("用户名:");LabellabelPassword=newLabel("口令:");TextFieldtextFieldUser=newTextField();TextFieldtextFieldPassword=newTextField();JButtonjButtonConfirm=newJButton("确定");JButtonjButtonExit=newJButton("退出");Stringuser=newString();Stringtuser=newString();Stringtpassword=newString();////登录MenuBarnavigation=newMenuBar();//建立菜单栏//建立“功能”菜单组MenumenuWorkerInformation=newMenu("职工信息");MenumenuWentOnErrands=newMenu("出差管理");MenumenuGoToWork=newMenu("出勤管理");MenumenuLeave=newMenu("请假管理");MenumenuWorkOverTime=newMenu("加班管理");MenumenuSystemManage=newMenu("系统管理");//建立“帮助”菜单组}4.2创建请假类和出差类;1.出差类MenuItemmenuItemWentOnErrandsQuery=newMenuItem("查询出差记录");MenuItemmenumItemWentOnErrandsAddtion=newMenuItem("添加出差记录");MenuItemmenuItemWentOnErrandsDelete=newMenuItem("删除出差记录");MenuItemmenuItemWentOnErrandsModify=newMenuItem("修改出差记录");MenuItemmenuItemchuchailiulan=newMenuItem("浏览出差记录");//出差查询classPanelchuchaichaxunextendsPanelimplementsActionListener{Choicecchaxun;TextFieldtchaxun;Buttonbtnchaxun;TextAreatachaxun;22 Panelchuchaichaxun(){setLayout(null);cchaxun=newChoice();//创建下拉菜单cchaxun.add("职工编号");cchaxun.add("职工姓名");tchaxun=newTextField();btnchaxun=newButton("查询");//创建按钮tachaxun=newTextArea();//创建多行文本框add(cchaxun);add(tchaxun);add(btnchaxun);add(tachaxun);tchaxun.setText("");cchaxun.setBounds(10,60,70,20);tchaxun.setBounds(85,60,180,20);btnchaxun.setBounds(275,60,40,20);tachaxun.setBounds(10,90,305,145);cchaxun.select(0);//下拉菜单的初始选项setSize(340,250);//设置窗口大小setBackground(Color.white);setVisible(true);btnchaxun.addActionListener(this);validate();}//出差修改classPanelchuchaixiugaiextendsPanelimplementsActionListener{TextFieldtextFieldWorkerName,textFieldWorkerNumber,textFieldchuchaiqishiriqi,textFieldchuchaijieshuriqi,textFieldchuchaitianshu;LabellabelWorkerName,labelWorkerNumber,labelchuchaiqishiriqi,labelchuchaijieshuriqi,labelchuchaitianshu;Buttonbtn;Panelchuchaixiugai(){setLayout(null);btn=newButton("添加");//创建“添加”按钮textFieldWorkerName=newTextField();textFieldWorkerNumber=newTextField();textFieldchuchaiqishiriqi=newTextField();22 textFieldchuchaijieshuriqi=newTextField();textFieldchuchaitianshu=newTextField();labelWorkerName=newLabel("职工姓名:");labelWorkerNumber=newLabel("职工编号:");labelchuchaiqishiriqi=newLabel("出差开始日期:");labelchuchaijieshuriqi=newLabel("出差结束日期:");labelchuchaitianshu=newLabel("出差天数:");add(labelWorkerName);add(textFieldWorkerName);add(labelWorkerNumber);add(textFieldWorkerNumber);add(labelchuchaiqishiriqi);add(textFieldchuchaiqishiriqi);add(labelchuchaijieshuriqi);add(textFieldchuchaijieshuriqi);add(labelchuchaitianshu);add(textFieldchuchaitianshu);add(btn);//添加“按钮”到窗口面板上labelWorkerName.setBounds(10,60,70,25);textFieldWorkerName.setBounds(90,60,220,25);labelWorkerNumber.setBounds(10,90,70,25);textFieldWorkerNumber.setBounds(90,90,220,25);labelchuchaiqishiriqi.setBounds(10,120,80,25);textFieldchuchaiqishiriqi.setBounds(90,120,220,25);labelchuchaijieshuriqi.setBounds(10,150,80,25);textFieldchuchaijieshuriqi.setBounds(90,150,220,25);labelchuchaitianshu.setBounds(10,180,70,25);textFieldchuchaitianshu.setBounds(90,180,220,25);btn.setBounds(130,250,70,25);//设置按钮位置btn.addActionListener(this);//设置按钮监听setSize(340,300);//设置窗口大小setBackground(Color.white);//设置窗口背景颜色setVisible(true);validate();}//出差浏览classPanelchuchailiulanextendsPanelimplementsActionListener{22 Buttonbtnliulan;TextAreatachaxun;Panelchuchailiulan(){setLayout(null);btnliulan=newButton("浏览职工出差记录");//创建按钮tachaxun=newTextArea();//创建多行文本框add(btnliulan);add(tachaxun);//tchaxun.setText("");//cchaxun.setBounds(10,60,70,20);//tchaxun.setBounds(85,60,180,20);btnliulan.setBounds(75,60,100,20);tachaxun.setBounds(10,90,400,200);setSize(500,400);//设置窗口大小setBackground(Color.white);setVisible(true);btnliulan.addActionListener(this);validate();}//职工出差添加classPanelchuchaitianjiaextendsPanelimplementsActionListener{TextFieldtextFieldWorkerName,textFieldWorkerNumber,textFieldchuchaiqishiriqi,textFieldchuchaijieshuriqi;Labellabeltongjitianshu;LabellabelWorkerName,labelWorkerNumber,labelchuchaiqishiriqi,labelchuchaijieshuriqi,labelchuchaitianshu;Buttonbtnchuchaitianshu;Buttonbtn;Panelchuchaitianjia(){setLayout(null);btn=newButton("添加");//创建“添加”按钮btnchuchaitianshu=newButton("统计出差天数");textFieldWorkerName=newTextField();textFieldWorkerNumber=newTextField();textFieldchuchaiqishiriqi=newTextField();22 textFieldchuchaijieshuriqi=newTextField();labeltongjitianshu=newLabel();labelWorkerName=newLabel("职工姓名:");labelWorkerNumber=newLabel("职工编号:");labelchuchaiqishiriqi=newLabel("出差开始日期:");labelchuchaijieshuriqi=newLabel("出差结束日期:");labelchuchaitianshu=newLabel("出差天数:");add(labelWorkerName);add(textFieldWorkerName);add(labelWorkerNumber);add(textFieldWorkerNumber);add(labelchuchaiqishiriqi);add(textFieldchuchaiqishiriqi);add(labelchuchaijieshuriqi);add(textFieldchuchaijieshuriqi);add(labelchuchaitianshu);add(labeltongjitianshu);add(btnchuchaitianshu);add(btn);//添加“按钮”到窗口面板上labelWorkerName.setBounds(10,60,70,25);textFieldWorkerName.setBounds(90,60,220,25);labelWorkerNumber.setBounds(10,90,70,25);textFieldWorkerNumber.setBounds(90,90,220,25);labelchuchaiqishiriqi.setBounds(10,120,80,25);textFieldchuchaiqishiriqi.setBounds(90,120,220,25);labelchuchaijieshuriqi.setBounds(10,150,80,25);textFieldchuchaijieshuriqi.setBounds(90,150,220,25);labelchuchaitianshu.setBounds(10,180,70,25);labeltongjitianshu.setBounds(90,180,220,25);labeltongjitianshu.setBackground(Color.cyan);btnchuchaitianshu.setBounds(100,220,80,25);btn.setBounds(220,220,70,25);//设置按钮位置btn.addActionListener(this);//设置按钮监听btnchuchaitianshu.addActionListener(this);setSize(340,300);//设置窗口大小setBackground(Color.white);//设置窗口背景颜色22 setVisible(true);validate();}图3出差类的图形界面2.请假类MenuItemmenuItemLeaveQuery=newMenuItem("查询请假记录");MenuItemmenumItemLeaveAddtion=newMenuItem("添加请假记录");MenuItemmenuItemLeaveDelete=newMenuItem("删除请假记录");MenuItemmenuItemLeaveModify=newMenuItem("修改请假记录");MenuItemmenuItemqingjialiulan=newMenuItem("浏览请假记录");//请假查询classPanelqingjiachaxunextendsPanelimplementsActionListener{Choicecchaxun;TextFieldtchaxun;Buttonbtnchaxun;TextAreatachaxun;Panelqingjiachaxun(){setLayout(null);cchaxun=newChoice();//创建下拉菜单22 cchaxun.add("职工编号");cchaxun.add("职工姓名");tchaxun=newTextField();btnchaxun=newButton("查询");//创建按钮tachaxun=newTextArea();//创建多行文本框add(cchaxun);add(tchaxun);add(btnchaxun);add(tachaxun);tchaxun.setText("");cchaxun.setBounds(10,60,70,20);tchaxun.setBounds(85,60,180,20);btnchaxun.setBounds(275,60,40,20);tachaxun.setBounds(10,90,305,145);cchaxun.select(0);//下拉菜单的初始选项setSize(340,250);//设置窗口大小setBackground(Color.white);setVisible(true);btnchaxun.addActionListener(this);validate();}//请假浏览classPanelqingjialiulanextendsPanelimplementsActionListener{//请假类Buttonbtnliulan;TextAreatachaxun;Panelqingjialiulan(){setLayout(null);btnliulan=newButton("浏览职工请假记录");//创建按钮tachaxun=newTextArea();//创建多行文本框tachaxun.setEditable(false);add(btnliulan);add(tachaxun);btnliulan.setBounds(75,60,100,20);tachaxun.setBounds(10,90,400,200);setSize(500,400);//设置窗口大小setBackground(Color.white);setVisible(true);btnliulan.addActionListener(this);validate();}22 //请假修改classPanelqingjiaxiugaiextendsPanelimplementsActionListener{TextFieldtextFieldWorkerName,textFieldWorkerNumber,textFieldqingjiakaishi,textFieldqingjiajieshu,textFieldqingjiatianshu;LabellabelWorkerName,labelWorkerNumber,labelqingjiakaishi,labelqingjiajieshu,labelqingjiatianshu;Buttonbtn;Panelqingjiaxiugai(){setLayout(null);btn=newButton("添加");//创建“添加”按钮textFieldWorkerName=newTextField();textFieldWorkerNumber=newTextField();textFieldqingjiakaishi=newTextField();textFieldqingjiajieshu=newTextField();textFieldqingjiatianshu=newTextField();labelWorkerName=newLabel("职工姓名:");labelWorkerNumber=newLabel("职工编号:");labelqingjiakaishi=newLabel("请假开始日期:");labelqingjiajieshu=newLabel("请假结束日期:");labelqingjiatianshu=newLabel("请假天数:");add(labelWorkerName);add(textFieldWorkerName);add(labelWorkerNumber);add(textFieldWorkerNumber);add(labelqingjiakaishi);add(textFieldqingjiakaishi);add(labelqingjiajieshu);add(textFieldqingjiajieshu);add(labelqingjiatianshu);add(textFieldqingjiatianshu);add(btn);//添加“按钮”到窗口面板上labelWorkerName.setBounds(10,60,70,25);textFieldWorkerName.setBounds(90,60,220,25);labelWorkerNumber.setBounds(10,90,70,25);textFieldWorkerNumber.setBounds(90,90,220,25);labelqingjiakaishi.setBounds(10,120,80,25);textFieldqingjiakaishi.setBounds(90,120,220,25);22 labelqingjiajieshu.setBounds(10,150,80,25);textFieldqingjiajieshu.setBounds(90,150,220,25);labelqingjiatianshu.setBounds(10,180,80,25);textFieldqingjiatianshu.setBounds(90,180,220,25);btn.setBounds(130,250,70,25);//设置按钮位置btn.addActionListener(this);//设置按钮监听setSize(340,300);//设置窗口大小setBackground(Color.white);//设置窗口背景颜色setVisible(true);validate();}//请假添加classPanelqingjiatianjiaextendsPanelimplementsActionListener{TextFieldtextFieldWorkerName,textFieldWorkerNumber,textFieldqingjiakaishi,textFieldqingjiajieshu;Labellabeltongjitianshu;LabellabelWorkerName,labelWorkerNumber,labelqingjiakaishi,labelqingjiajieshu,labelqingjiatianshu;Buttonbtn;Buttonbtntongjiqingjiatianshu;Panelqingjiatianjia(){setLayout(null);btn=newButton("添加");//创建“添加”按钮btntongjiqingjiatianshu=newButton("统计请假天数");textFieldWorkerName=newTextField();textFieldWorkerNumber=newTextField();textFieldqingjiakaishi=newTextField();textFieldqingjiajieshu=newTextField();labeltongjitianshu=newLabel("");labelWorkerName=newLabel("职工姓名:");labelWorkerNumber=newLabel("职工编号:");labelqingjiakaishi=newLabel("请假开始日期:");labelqingjiajieshu=newLabel("请假结束日期:");labelqingjiatianshu=newLabel("请假天数:");labeltongjitianshu.setBackground(Color.cyan);22 add(labelWorkerName);add(textFieldWorkerName);add(labelWorkerNumber);add(textFieldWorkerNumber);add(labelqingjiakaishi);add(textFieldqingjiakaishi);add(labelqingjiajieshu);add(textFieldqingjiajieshu);add(labelqingjiatianshu);add(labeltongjitianshu);add(btn);//添加“按钮”到窗口面板上add(btntongjiqingjiatianshu);labelWorkerName.setBounds(10,60,70,25);textFieldWorkerName.setBounds(90,60,220,25);labelWorkerNumber.setBounds(10,90,70,25);textFieldWorkerNumber.setBounds(90,90,220,25);labelqingjiakaishi.setBounds(10,120,80,25);textFieldqingjiakaishi.setBounds(90,120,220,25);labelqingjiajieshu.setBounds(10,150,80,25);textFieldqingjiajieshu.setBounds(90,150,220,25);labelqingjiatianshu.setBounds(10,180,80,25);labeltongjitianshu.setBounds(90,180,220,25);btntongjiqingjiatianshu.setBounds(120,220,80,25);btn.setBounds(220,220,70,25);//设置按钮位置btn.addActionListener(this);//设置按钮监听btntongjiqingjiatianshu.addActionListener(this);setSize(340,350);//设置窗口大小setBackground(Color.white);//设置窗口背景颜色setVisible(true);validate();}22 图4请假类的图形用户界面4.3创建类的事件监听,用来响应添加,查询,浏览,删除等功能;//出差类的动作监听添加publicvoidactionPerformed(ActionEvente){inti=cchaxun.getSelectedIndex();Strings=tchaxun.getText();if(s.equals(""))JOptionPane.showMessageDialog(this,"查询内容不能为空","查询系统",JOptionPane.WARNING_MESSAGE);else{Connectioncon;Statementsql;ResultSetrs;try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//加载JDBC驱动}catch(ClassNotFoundExceptionee){System.out.println(""+ee);}try{con=DriverManager.getConnection("jdbc:odbc:evection4","sa","123");//连接数据库sql=con.createStatement();if(i==0)//根据下拉菜单的选项执行不同的SQL语句rs=sql.executeQuery("select*fromevection4whereWnum="22 +"""+s+""");elseif(i==1)rs=sql.executeQuery("select*fromevection4whereWname="+"""+s+""");elsers=sql.executeQuery("select*fromevection4wherepublisher="+"""+s+""");tachaxun.setText("");Stringpanduan="false";while(rs.next()){panduan="true";tachaxun.append("职工编号:"+rs.getString(1)+"n");tachaxun.append("职工姓名:"+rs.getString(2)+"n");tachaxun.append("出差开始时间:"+rs.getString(3)+"n");tachaxun.append("出差结束时间:"+rs.getString(4)+"n");tachaxun.append("出差总天数:"+rs.getString(5)+"n");}//显示查询到的职工信息rs=sql.executeQuery("selectcount(*)fromevection4");//统计所有职工数while(rs.next()){tachaxun.append("n");tachaxun.append("职工考勤信息管理系统暂有"+rs.getString(1)+"个职工出差记录");}//显示所有职工数量信息con.close();//关闭数据库if(panduan.equals("false"))JOptionPane.showMessageDialog(this,"没有该记录","查询系统",JOptionPane.WARNING_MESSAGE);}catch(SQLExceptioneee){System.out.println(eee);}}}//请假类的动作监听添加publicvoidactionPerformed(ActionEvente){inti=cchaxun.getSelectedIndex();Strings=tchaxun.getText();if(s.equals(""))JOptionPane.showMessageDialog(this,"查询内容不能为空","查询系统",JOptionPane.WARNING_MESSAGE);else{Connectioncon;22 Statementsql;ResultSetrs;try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//加载JDBC驱动}catch(ClassNotFoundExceptionee){System.out.println(""+ee);}try{con=DriverManager.getConnection("jdbc:odbc:evection4","sa","123");//连接数据库sql=con.createStatement();if(i==0)//根据下拉菜单的选项执行不同的SQL语句rs=sql.executeQuery("select*fromevection4whereWnum="+"""+s+""");elseif(i==1)rs=sql.executeQuery("select*fromevection4whereWname="+"""+s+""");tachaxun.setText("");Stringpanduan="false";while(rs.next()){panduan="true";tachaxun.append("职工编号:"+rs.getString(1)+"n");tachaxun.append("职工姓名:"+rs.getString(2)+"n");tachaxun.append("出差开始时间:"+rs.getString(3)+"n");tachaxun.append("出差结束时间:"+rs.getString(4)+"n");tachaxun.append("出差总天数:"+rs.getString(5)+"n");}//显示查询到的职工信息rs=sql.executeQuery("selectcount(*)fromevection4");//统计所有职工数while(rs.next()){tachaxun.append("n");tachaxun.append("职工考勤信息管理系统暂有"+rs.getString(1)+"个职工出差记录");}//显示所有职工数量信息con.close();//关闭数据库if(panduan.equals("false"))JOptionPane.showMessageDialog(this,"没有该记录","查询系统",JOptionPane.WARNING_MESSAGE);}catch(SQLExceptioneee){System.out.println(eee);}}}22 4.4创建各个类的窗口中放置所需控件和可视化用户图形界面。(1)将出差类添加到主函数中。MenuItemmenuItemWentOnErrandsQuery=newMenuItem("查询出差记录");MenuItemmenumItemWentOnErrandsAddtion=newMenuItem("添加出差记录");MenuItemmenuItemWentOnErrandsDelete=newMenuItem("删除出差记录");MenuItemmenuItemWentOnErrandsModify=newMenuItem("修改出差记录");MenuItemmenuItemevectionliulan=newMenuItem("浏览出差记录");Panelevectiontianjiapjiabantianjia=newPanelevectiontianjia();Panelevectionshanchupjiabanshanchu=newPanelevectionshanchu();Panelevectionchaxunpjiabanchaxun=newPanelevectionchaxun();Panelevectionliulanpjiabanliulan=newPanelevectionliulan();图7将出差类添加到主面板中的运行效果图(2)将请假类添加到主函数中。MenuItemmenuItemLeaveQuery=newMenuItem("查询请假记录");MenuItemmenumItemLeaveAddtion=newMenuItem("添加请假记录");MenuItemmenuItemLeaveDelete=newMenuItem("删除请假记录");MenuItemmenuItemLeaveModify=newMenuItem("修改请假记录");MenuItemmenuItemqingjialiulan=newMenuItem("浏览请假记录");Panelqingjiatianjiapjiabantianjia=newPanelqingjiatianjia();Panelqingjiashanchupjiabanshanchu=newPanelqingjiashanchu();Panelqingjiachaxunpjiabanchaxun=newPanelchqingjiaaxun();Panelqingjialiulanpjiabanliulan=newPanelchqingjiaulan();22 图6将请假类添加到主面板中的运行效果图(3)将登录类添加到主函数中。MenuItemmenuItemSystemManageExit=newMenuItem("退出系统");MenuItemmenuItemWelcome=newMenuItem("返回欢迎界面");PanelWelcomepwelcome=newPanelWelcome()图7将登录类添加到主面板中的运行效果图(8)出差信息添加效果图22 图11本系统经过实际的测试和运行,基本可以满足中小企业考勤业务的要求。该系统运行稳定,在使用和维护中应该注意以下几个问题:(1)定期备份数据库和日志,以使数据库在发生故障后恢复到一致性状态,保障数据库的完整性。(2)定期清理数据库中的无效数据,以提高运行效率。(3)对软件及运行环境进行日常维护。五、总结本系统中我主要实现了职工出差信息管理和在职工请假信息管理,其余功能由麦丞程同学实现。本系统在信息表述上还不完备,一些模块的信息还不够详细,主要是提供的报表有限。系统虽然针对中小企业的考勤管理业务。对使用打卡机、指纹机进行出、退勤的企业,还需要添加一个采集打卡机和指纹机的数据模块。下一步可以再熟悉系统设计风格的基础上,在各个界面上进一步添加多需要的字段和报表,或者添加采集数据的模块,以扩充系统的功能。本系统的创新点在于触发器的应用,每增加一条记录,都会重新统计一下记录次数,并存入月纪录中,使得信息更加准确。在设计时由于对编程语言知识的匮乏,所以数据库的界面化没有做成,如若想更加完善数据库,应该结合一些编程语言,使得操作界面更加人性化,简单化。22