实验室设备管理系统(毕业课程设计报告)

  • 格式:doc
  • 大小:1.22 MB
  • 文档页数:53

(此文档为word格式,下载后您可任意编辑修改!)西安文理学院软件学院课程设计报告设计名称:实验设备管理系统设计题目:实验设备管理系统专业班级:软件工程一班学生姓名:学生成绩:指导教师(职称):课题工作时间:2013年12月20日至2014年1月8日软件学院课程设计任务书指导教师:院主任:日期:2014年01月06日课程设计:实验室设备管理系统一、项目管理:二、软件需求分析1.引言1.1编写目的此需求说明书详细陈述了“实验设备管理系统”的所提供各项功能。

其中包括用户的功能性需求以及非功能性需求,为用户提供完整且较详尽的系统功能运作蓝图。

同时为设计人员提供一个完整的、可靠的设计约束,以便高质量地设计、编写代码,完成系项目预期目标。

还给开发人员提供了参考。

此需求说明书的预期读者为项目经理、设计人员、开发人员、用户等。

1.2背景说明:a.待开发的软件系统的名称:实验设备管理系统;b.本项目的任务提出者:西安文理学院;c.本项目的开发者:d.本项目的用户:西安文理学院相关管理人员;e.该软件系统同其他系统或其他机构的基本的相互来往关系:与西安文理学院财务管理软件系统有相应接口。

1.3定义LEM:实验室设备管理系统(Laboratory Equipment Management);2.任务概述2.1目标随着高校规模的扩大,实验室及仓库的增多,人工管理实验设备已变得过于低效,为了解决这一问题,高校实验室设备管理系统将实现设备管理的自动化。

实验室设备管理系统将贯穿于设备从购进到报废的整个流程的管理过程,帮助管理员高效地管理整个高校的所有设备,并给上级领导提供一个审核监督管理的平台。

2.2用户的特点此软件的使用用户为:西安文理学院相关管理人员。

因此,我们通常可以认为:用户具有较高的文化水平和学习能力,并且具有一定的计算机使用水平和经验,可以了解整个LEM系统的工作流程及注意事项,与此同时对于LEM系统的基本操作,可以无困难执行。

在参考用户手册的情况下可以无需进行专业培训,即可顺利使用本系统。

3.需求规定3.1功能性需求规定3.1.1系统整体功能层次图3.1.2 业务流程分析数据流图:流程详细说明:(1)仓库管理员统计仓库中设备的库存量,找出库存量不足的设备,填写购买申请表,领导对此申请表进行审核,审核通过后,产生购买报表交给购买员。

(2)购买员将购买的设备及购买信息交给购买登记员,由他进行购买登记。

购买登记员查询申请审核表,将设备分配到各仓库。

(3)仓库管理员对购买的设备进行入库登记,出库登记。

(4)实验室管理员负责对报废的设备进行报废登记并处理,找出要维修的设备填写维修申请表,领导对维修申请表进行审核,通过后产生维修报表交给维修员,维修员将设备送交某一修理厂家进行维修。

(5)设备维修完后,交还原实验室,由实验室管理员进行维修登记。

3.1.2系统用户列表高校LEM面向五类用户:系统管理员,购买登记员,仓库管理员,实验室管理员,上级领导,这几类用户通过高校LEM系统进行设备管理上的交流,而该系统为用户提供不同的功能。

【1】系统管理员1.注册本系统用户;2.注销本系统用户;3.数据库的维护;4.本人信息维护;【2】购买登记员1.将购买员提交的购买信息进行登记,记录有关设备基本信息,设备的购买信息如价格,数量等;2.查询领导的购买申请审核信息;3.根据审核信息将购买的设备分配到相应的仓库,将有关详单提交仓库管理员,4.本人信息维护。

【3】仓库管理员1.根据购买登记员提交的详单进行入库登记;2.根据实验室管理员提交的详单进行出库登记;3.查询统计本仓库中的所有设备的库存量,统计出库存量不足的设备;4.根据统计信息进行购买申请。

5.本人信息维护;【4】实验室管理员1.管理本实验室中各设备,找出需要维修的设备,进行维修申请;2.对于不能维修的设备,要进行报废记录;3.查询统计本实验室设备拥有量,统计出数量不足的设备,产生详单提交仓库管理员;4.对于已维修完成的设备,根据维修员提交维修单进行维修记录;5.本人信息维护。

【5】上级领导1.查看购买申请表,对申请进行审核,审核后产生购买订单交于购买员;2.查看维修申请表,对申请进行审核,审核后产生维修订单交于维修员;3.个人信息维护。

3.2软件系统数据字典3.21数据流条目①登陆信息输入:设备管理员输出:身份验证1描述:登陆信息=用户名+密码+登陆权限②查询信息输入:合法人员对设备的查询操作输出:设备信息表描述:查询信息=设备名型号类别购置日期③维修信息输入:所需维修设备的信息输出:确定维修设备的记录描述:维修信息=设备名+修理日期+修理厂家+修理费+负责人④新设备输入:购买设备的信息输出:确定购买的新设备的记录描述:新设备=类别+设备名+型号+规格+单价+数量等⑤报废设备输入:所需报废的设备的信息输出:报废的设备记录描述:报废设备=类别+设备名+型号等⑥审核信息输入:审核3输出:上级领导描述:审核信息=报废设备信息新设备购买记录3.22加工条目身份验证1,统计查询2.1,维修2.2,购买2.3,报废2.4,生产报表3.1,审核3.23.23文件条目⑦登陆表输入:身份验证1输出:身份验证1数据结构:用户名+密码+登陆权限⑧设备基本信息表输入:统计查询2.1数据结构:类别+设备名+型号+规格等⑨维修记录表输入:统计查询2.1,维修2.2输出:统计查询2.1数据结构:设备名+修理日期+修理厂家+修理费+责任人等⑩新设备表输入:统计查询2.1,购买2.2输出:统计查询2.1数据结构:类别+设备名+型号+规格+单价+数量+生产厂家+购买人等⑪报废记录表输入:报废2.4,统计查询2.1,生产报表3.1输出:统计查询2.1,生产报表3.1数据结构:类别+设备名+型号等⑫申请表输入:统计查询2.1,生产报表3.1输出:统计查询2.1,生产报表3.1,购买2.3数据结构:设备名+型号+规格+数量+负责人3.3非功能新需求规定3.3.1精度软件的输入精度:a.输入的数字信息,精度保留到小数点后两位。

b.输入的公司或单位名称,必须是全称,不可以是简称或者是简写。

e.输入的可选信息时,以下拉框内容为备选选择,不可以自行输入。

3.3.2时间特性需求对于该软件的时间特性要求为:a.响应时间:小于7秒钟;b.更新处理时间:小于6秒钟;3.3.3灵活性该软件的灵活性的要求(即当需求发生某些变化时,该软件对这些变化的适应能力):a.运行环境的变化:可以实现跨平台操作;b.同其他软件的接口的变化:设计多元化接口,以实现与其他软件接口之间的通信;c.精度和有效时限的变化:统一修改数据精度、以及有效时限的数据库内容;3.3.4可靠性本系统的可靠性是指:系统在规定的条件下、在规定的时间内完成规定的功能的能力。

影响可靠性的操作流程有:1. 新增用户时可能出现信息无法提交的情况。

2. 设备购买登记阶段,可能出现设备信息无法写入,购买信息登记错误。

由于本系统是LEM系统,故对于可靠性的要求较高。

具体要求:1. 全部录入信息以各纸质详单,如购买详单,维修详单等为准;2. 数据的正确性需经过多方核查。

3.自动对于各种信息数据进行备份。

4.报表生成与纸质、电子报表相一致。

3.4输入输出要求输入:a.输入数据数字信息符合输入精度要求b.输入可选信息完全使用下拉框完成输出:a.输出数据符合输出精度要求b.输出数据格式字体大小统一3.4故障处理要求当服务器死机时,要求服务器必须在2小时内恢复,数据必须在3小时内恢复。

4.运行环境规定4.1设备运行该软件所需要的硬设备,包括:【1】处理器型号:Intel Core2;【2】内存容量:1.00G;【3】硬盘:120G4.2支持软件【1】操作系统:windows7操作系统以及以上版本;【2】数据库:Sql Server 2008 R2版数据库【3】MyEclipse开发工具5文化和政策需求不得引起用户文化上的冲突,不能出现敏感和不应出现的字眼和图片。

符合国家基本法律法规以及最新的国家营销以及市场战略上的相关政策,不得与我国社会主义政策相违背。

三:软件设计1实验室设备管理系统模块结构图2界面设计(1)登录界面(2)任意注册管理人员登录后界面3实验室设备管理系统数据设计4管理系统其中的3个模块的详细设计①上级领导操作模块②设备管理员操作模块③统功能操作模块5数据库设计1.模型图2.E-R图3.物理实现(1)实体表四、编码与单元测试1、用户登录界面:package com.niit.gui_event;import com.niit.logical.*;import java.awt.*;import java.awt.event.*;import javax.swing.*;public class Login extends JFrame {****private static final long serialVersionUID = 1L;控件声明private JLabel lPosition, lName, lPasswd, lTitle;private JComboBox cbPosition, cbName;private JPasswordField pfPasswd;private JButton bConfirm, bCancel;private Container con;private JPanel[] pCon;private User info;public Login() {super("用户登录");控件初始化con = getContentPane();lPosition = new JLabel("身份:");lName = new JLabel("用户名:");lPasswd = new JLabel("密码:");lTitle = new JLabel("实验室设备管理系统");lTitle.setForeground(Color.RED);pfPasswd = new JPasswordField();bConfirm = new JButton("确定");bCancel = new JButton("取消");String[] aPosition = new String[] { "系统管理员", "仓库管理员", "实验室管理员","购买登记员", "上级领导" };cbPosition = new JComboBox(aPosition);int index = cbPosition.getSelectedIndex();if (index == 0) {info = new Administration();} else if (index == 1) {info = new StoreManager();} else if (index == 2) {info = new LabManager();} else if (index == 3) {info = new BuyManager();} else {info = new OverLeader();}数组初始化pCon = new JPanel[5];String[] cName = info.getIdByPosition(info);cbName = new JComboBox(cName);for (int i = 0; i < pCon.length; i++)pCon[i] = new JPanel();}public void launch() {控件添加con.setLayout(new GridLayout(5, 1));pCon[0].add(lPosition);pCon[0].add(cbPosition);pCon[1].add(lName);pCon[1].add(cbName);pCon[2].add(lPasswd);pCon[2].add(pfPasswd);pCon[3].add(bConfirm);pCon[3].add(bCancel);pCon[4].add(lTitle);add(pCon[4]);for (int i = 0; i < pCon.length - 1; i++)con.add(pCon[i]);控件设置pfPasswd.setEchoChar('*');pfPasswd.setColumns(10);setBounds(400, 100, 400, 400);setVisible(true);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);添加监听器cbPosition.addActionListener(new ListenAction());bConfirm.addActionListener(new ListenAction());bCancel.addActionListener(new ListenAction());pfPasswd.addKeyListener(new ListenKey());}定义按钮,下拉框处理器class ListenAction implements ActionListener {public void actionPerformed(ActionEvent e) {if (e.getSource() == bConfirm) {点击确定按钮info.setuId(cbName.getSelectedItem().toString());info.setuPasswd(new String(pfPasswd.getPassword()));info.setuPosition(cbPosition.getSelectedItem().toString());if (info.login(info)) {new Main(info).launch();setVisible(false);pfPasswd.setText(null);} else {JOptionPane.showMessageDialog(new Login(), "用户名,密码或身份错误");pfPasswd.setText(null);}} else if (e.getSource() == cbPosition) {身份下拉框改变时int index = cbPosition.getSelectedIndex();if (index == 0) {info = new Administration();} else if (index == 1) {info = new StoreManager();} else if (index == 2) {info = new LabManager();} else if (index == 3) {info = new BuyManager();} else {info = new OverLeader();}String[] cName = info.getIdByPosition(info);刷新用户名列表cbName.removeAllItems();for (int i = 0; i < cName.length; i++)cbName.addItem(cName[i]);} else {System.exit(0);}pfPasswd.setText(null);}}定义键盘处理器class ListenKey extends KeyAdapter {@SuppressWarnings("static-access")public void keyPressed(KeyEvent e) {if (e.getKeyText(e.getKeyCode())pareToIgnoreCase("ENTER") == 0) {bConfirm.doClick();}}}}}2、主界面:package com.niit.gui_event;import javax.swing.*;import com.niit.logical.*;import java.awt.event.*;public class Main extends JFrame {****private static final long serialVersionUID = 1L;private JTabbedPane tp;private JPanel p[];private User info;public Main() {super("实验室设备管理系统");tp = new JTabbedPane();p = new JPanel[8];}public Main(User info){this();=info;p[0] = new UserManage();p[1] = new EquipIn();p[2] = new EquipOut();p[3] = new Register(info);p[4] = new Apply(info);p[5] = new Checks(info);p[6]= new Search();p[7]=new PasswdModyfy(info);}public void launch() {tp.addTab("用户管理", p[0]);tp.addTab("设备入库", p[1]);tp.addTab("设备出库", p[2]);tp.addTab("设备登记", p[3]);tp.addTab("设备申请", p[4]);tp.addTab("审核申请", p[5]);tp.addTab("统计查询", p[6]);tp.addTab("个人信息维护", p[7]);if(info instanceof Administration){tp.setEnabledAt(1, false);tp.setEnabledAt(2, false);tp.setEnabledAt(3, false);tp.setEnabledAt(4, false);tp.setEnabledAt(5, false);tp.setEnabledAt(6, false);}else if(info instanceof StoreManager){ tp.setEnabledAt(0, false);tp.setEnabledAt(3, false);tp.setEnabledAt(5, false);tp.setSelectedIndex(1);}else if(info instanceof LabManager){tp.setEnabledAt(0, false);tp.setEnabledAt(1, false);tp.setEnabledAt(2, false);tp.setEnabledAt(5, false);tp.setSelectedIndex(3);}else if(info instanceof BuyManager){tp.setEnabledAt(0, false);tp.setEnabledAt(1, false);tp.setEnabledAt(2, false);tp.setEnabledAt(4, false);tp.setEnabledAt(5, false);tp.setSelectedIndex(3);}else if(info instanceof OverLeader){tp.setEnabledAt(0, false);tp.setEnabledAt(1, false);tp.setEnabledAt(2, false);tp.setEnabledAt(3, false);tp.setEnabledAt(4, false);tp.setSelectedIndex(5);}getContentPane().add(tp);setSize(1280, 780);setVisible(true);addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){System.exit(0);}});}}3、设备申请:package com.niit.gui_event;import javax.swing.*;import com.niit.logical.*;import java.awt.*;import java.awt.event.*;import com.niit.data.*;import java.sql.*;public class MaintainApply extends JPanel { ****private static final long serialVersionUID = 1L;private JLabel lpId;private JTextField tf;private JButton bApply, bAgain, bDelete;private JPanel pUp, pDown;private JTable t;private JScrollPane jsp;private User user;private LabManager lm;private MaintainApplyData maInfo;public MaintainApply(User user) {super(new BorderLayout());er = user;lpId = new JLabel("固定资产编号");tf = new JTextField();tf.setColumns(15);bApply = new JButton("申请");bAgain = new JButton("重置");bDelete = new JButton("取消申请");pUp = new JPanel();pDown = new JPanel();lm = new LabManager();maInfo = new MaintainApplyData();String[] );pDown.add(bDelete);add(pUp, BorderLayout.NORTH);add(jsp, BorderLayout.CENTER);add(pDown, BorderLayout.SOUTH);添加监听器bApply.addActionListener(new ListenButton());bAgain.addActionListener(new ListenButton());bDelete.addActionListener(new ListenButton());}处理器class ListenButton implements ActionListener {public void actionPerformed(ActionEvent e) {if (e.getSource() == bApply) {申请按钮maInfo.setpId(new Integer(tf.getText()));maInfo.setuId(user.getuId());maInfo.setDate(new Date(System.currentTimeMillis()));lm.add(maInfo);bAgain.doClick();} else if (e.getSource() == bAgain) {重置按钮tf.setText(null);} else if (e.getSource() == bDelete) {删除按钮int selectedIndex = -1;for (int i = 0; i < t.getRowCount(); i++) {if (t.isRowSelected(i) == true)selectedIndex = i;}if (selectedIndex == -1) {JOptionPane.showMessageDialog(null, "请先选择某一项!");return;} else {int option = JOptionPane.showConfirmDialog(null, "是否确定删除?","提示", JOptionPane.YES_NO_CANCEL_OPTION);if (option == JOptionPane.YES_OPTION) {maInfo.setId(newInteger(t.getValueAt(selectedIndex, 0).toString()));lm.delete(maInfo);}}}刷新数据表remove(jsp);String[] extends JPanel {****private static final long serialVersionUID = 1L;private JLabel leId, lsId, liNum, lPara;private JTextField tfiNum;private JComboBox cbeId, cbsId;private JButton bIn, bAgain, bDelete;private JPanel pUp, pDown;private JScrollPane jsp;private JTable t;private StoreManager sma;private InData inInfo;public EquipIn() {super(new BorderLayout());设置布局管理器控件初始化leId = new JLabel("设备编号");lsId = new JLabel("仓库编号");liNum = new JLabel("入库数量");lPara = new JLabel("参数设置");lPara.setForeground(Color.RED);tfiNum = new JTextField();tfiNum.setColumns(10);bIn = new JButton("入库");bAgain = new JButton("重置");bDelete = new JButton("删除");pUp = new JPanel();pDown = new JPanel();sma = new StoreManager();inInfo = new InData();String[] eId = sma.geteId();String[] sId = sma.getsIdAll();cbeId = new JComboBox(eId);cbsId = new JComboBox(sId);String[] );pUp.add(bAgain);pUp.add(lPara);pDown.add(bDelete);add(pUp, BorderLayout.NORTH);add(jsp, BorderLayout.CENTER);add(pDown, BorderLayout.SOUTH);添加监听器bIn.addActionListener(new ListenButton());bAgain.addActionListener(new ListenButton());bDelete.addActionListener(new ListenButton());lPara.addMouseListener(new ListenMouse());}定义按钮处理器class ListenButton implements ActionListener {public void actionPerformed(ActionEvent e) {if (e.getSource() == bIn) {点击入库按钮inInfo.seteId(cbeId.getSelectedItem().toString());inInfo.setsId(cbsId.getSelectedItem().toString());inInfo.setDate(new Date(System.currentTimeMillis()));inInfo.setNum(new Integer(tfiNum.getText()));sma.add(inInfo);bAgain.doClick();} else if (e.getSource() == bAgain) {点击重置按钮tfiNum.setText(null);} else if (e.getSource() == bDelete) {点击删除按钮int selectedIndex = -1;for (int i = 0; i < t.getRowCount(); i++) {if (t.isRowSelected(i) == true)selectedIndex = i;}if (selectedIndex == -1) {JOptionPane.showMessageDialog(null, "请先选择某一项!");return;} else {int option = JOptionPane.showConfirmDialog(null, "是否确定删除?","提示", JOptionPane.YES_NO_CANCEL_OPTION);if (option == JOptionPane.YES_OPTION) {inInfo.seteId((String)t.getValueAt(selectedIndex, 0));inInfo.setsId((String)t.getValueAt(selectedIndex, 1));inInfo.setDate((Date)t.getValueAt(selectedIndex, 2));sma.delete(inInfo);}}}刷新数据表remove(jsp);String[] [] bArray = new JButton[3];private JTextField[] tfArray = new JTextField[2];private JPasswordField[] pfArray = new JPasswordField[2];private JPanel[] pArray = new JPanel[4];private JComboBox cbPosition, cbSL;private JScrollPane jsp;private JTable t;private Administration Admin;private StoreManager sma;private LabManager lm;public UserManage() {super(new BorderLayout());设置布局管理器控件初始化lArray[0] = new JLabel("注册身份");lArray[1] = new JLabel("用户名");lArray[2] = new JLabel("姓名");lArray[3] = new JLabel("密码");lArray[4] = new JLabel("确认密码");lArray[5] = new JLabel("编号");lArray[6] = new JLabel("参数设置");bArray[0] = new JButton("注册");bArray[1] = new JButton("重置");bArray[2] = new JButton("删除");for (int i = 0; i < 2; i++) {tfArray[i] = new JTextField();tfArray[i].setColumns(10);pfArray[i] = new JPasswordField();pfArray[i].setColumns(10);pArray[i] = new JPanel();}pArray[2] = new JPanel();pArray[3] = new JPanel(new GridLayout(2, 1));String[] position = new String[] { "系统管理员", "仓库管理员", "实验室管理员", "购买登记员","上级领导" };cbPosition = new JComboBox(position);cbSL = new JComboBox();Admin = new Administration();sma = new StoreManager();lm = new LabManager();String[] .getAll();t = new JTable(data, );pArray[0].add(lArray[1]);pArray[0].add(tfArray[0]);pArray[0].add(lArray[2]);pArray[0].add(tfArray[1]);pArray[1].add(lArray[3]);pArray[1].add(pfArray[0]);pArray[1].add(lArray[4]);pArray[1].add(pfArray[1]);pArray[1].add(lArray[5]);pArray[1].add(cbSL);pArray[1].add(bArray[0]);pArray[1].add(bArray[1]);pArray[1].add(lArray[6]);pArray[2].add(bArray[2]);pArray[3].add(pArray[0]);pArray[3].add(pArray[1]);add(pArray[3], BorderLayout.NORTH);add(jsp, BorderLayout.CENTER);add(pArray[2], BorderLayout.SOUTH);添加监听器bArray[0].addActionListener(new ListenAction());bArray[1].addActionListener(new ListenAction());bArray[2].addActionListener(new ListenAction());cbPosition.addActionListener(new ListenAction());lArray[6].addMouseListener(new ListenMouse());}定义按钮,下拉框动作处理器class ListenAction implements ActionListener {public void actionPerformed(ActionEvent e) {Admin.setuId(tfArray[0].getText());Admin.setuName(tfArray[1].getText());Admin.setuPasswd(new String(pfArray[0].getPassword()));Admin.setuPosition(cbPosition.getSelectedItem().toString());if (e.getSource() == bArray[0]) {点击注册按钮if (tfArray[0].getText().equals("")|| newString(pfArray[0].getPassword()).toString().equals("")) {JOptionPane.showMessageDialog(null, "用户名或密码不可为空");bArray[1].doClick();return;}String[] strKey = new String[] { Admin.getuId(),Admin.getuPosition() };if (Admin.getKey().contains(strKey)) {JOptionPane.showMessageDialog(null, "用户已存在!");bArray[1].doClick();return;}if (!new String(pfArray[0].getPassword()).equals(new String(pfArray[1].getPassword()))) {JOptionPane.showMessageDialog(null, "密码不一致!");bArray[1].doClick();return;}Admin.add(Admin);if (cbPosition.getSelectedItem().equals("仓库管理员")) {sma.setuId(tfArray[0].getText());sma.setsId(cbSL.getSelectedItem().toString());Admin.add(sma);} else if (cbPosition.getSelectedItem().equals("实验室管理员")) {lm.setuId(tfArray[0].getText());lm.setlId(cbSL.getSelectedItem().toString());Admin.add(lm);}bArray[1].doClick();} else if (e.getSource() == bArray[1]) {点击重置按钮tfArray[0].setText(null);tfArray[1].setText(null);pfArray[0].setText(null);pfArray[1].setText(null);} else if (e.getSource() == bArray[2]) {点击删除按钮int selectedIndex = -1;for (int i = 0; i < t.getRowCount(); i++) {if (t.isRowSelected(i) == true)selectedIndex = i;}if (selectedIndex == -1) {JOptionPane.showMessageDialog(null, "请先选择某一项!");return;} else {int option = JOptionPane.showConfirmDialog(null, "是否确定删除?","提示", JOptionPane.YES_NO_CANCEL_OPTION);if (option == JOptionPane.YES_OPTION) {Admin.setuId((String)t.getValueAt(selectedIndex, 0));Admin.setuPosition((String)t.getValueAt(selectedIndex,2));Admin.delete(Admin);}}} else if (e.getSource() == cbPosition) {改变身份下拉框时if (cbPosition.getSelectedItem().equals("仓库管理员")) {lArray[5].setText("仓库编号");lArray[5].setVisible(true);cbSL.setVisible(true);cbSL.removeAllItems();String[] sId = Admin.getsIdAll();for (int i = 0; i < sId.length; i++)cbSL.addItem(sId[i]);} else if (cbPosition.getSelectedItem().equals("实验室管理员")) {lArray[5].setText("实验室编号");lArray[5].setVisible(true);cbSL.setVisible(true);cbSL.removeAllItems();String[] sId = Admin.getlIdAll();for (int i = 0; i < sId.length; i++)cbSL.addItem(sId[i]);} else {lArray[5].setVisible(false);cbSL.setVisible(false);}}刷新数据表remove(jsp);String[] .getAll();t = new JTable(data, rbStore, rbLab, rbeId, rbSingleeId; private JComboBox cbStore, cbLab, cbeId;private JLabel lStore, lLab, leId;private JTable t;private JScrollPane jsp;private JPanel pUp, pDown, p;private StoreManager sma;private InData inInfo;public Search() {super(new BorderLayout());rbStore = new JRadioButton("仓库库存统计", true);rbLab = new JRadioButton("实验室库存统计");rbeId = new JRadioButton("所有设备", true);rbSingleeId = new JRadioButton("单个设备");sma = new StoreManager();inInfo = new InData();cbStore = new JComboBox(sma.getsIdAll());cbLab = new JComboBox(sma.getlIdAll());cbeId = new JComboBox(sma.geteId());lStore = new JLabel("仓库编号");lLab = new JLabel("实验室编号");leId = new JLabel("设备编号");cbLab.setVisible(false);lLab.setVisible(false);leId.setVisible(false);cbeId.setVisible(false);pUp = new JPanel();pDown = new JPanel();p = new JPanel();pUp.add(rbStore);pUp.add(lStore);pUp.add(cbStore);pUp.add(rbLab);pUp.add(lLab);pUp.add(cbLab);pDown.add(rbeId);pDown.add(rbSingleeId);pDown.add(leId);pDown.add(cbeId);p.setLayout(new GridLayout(2, 1));p.add(pUp);p.add(pDown);inInfo.setsId(cbStore.getSelectedItem().toString());String[] ());rbLab.addActionListener(new ListenAction());rbeId.addActionListener(new ListenAction());rbSingleeId.addActionListener(new ListenAction());cbStore.addActionListener(new ListenAction());cbLab.addActionListener(new ListenAction());cbeId.addActionListener(new ListenAction());}定义处理器class ListenAction implements ActionListener { public void actionPerformed(ActionEvent e) {if (e.getSource() == rbStore) {rbLab.setSelected(false);} else if (e.getSource() == rbLab) {rbStore.setSelected(false);} else if (e.getSource() == rbeId) {rbSingleeId.setSelected(false);} else if (e.getSource() == rbSingleeId) {rbeId.setSelected(false);}StoreManager sma = new StoreManager();LabManager lm = new LabManager();String[] (idInfo);}} else {lStore.setVisible(false);cbStore.setVisible(false);lLab.setVisible(true);cbLab.setVisible(true);rbStore.setSelected(false);(odInfo);}}刷新数据表remove(jsp);t = new JTable(data,*import java.io.*;import .*;import java.sql.*;import ng.*;import javax.sql.*;import java.awt.*;import java.awt.event.*;import javax.swing.*;import yout.*;import com.borland.dbswing.*;public class Frame6 extends JFrame {JPanel contentPane;JLabel jLabel1 = new JLabel();XYLayout xYLayout1 = new XYLayout();JLabel jLabel2 = new JLabel();JLabel jLabel3 = new JLabel();JTextField jTextField1 = new JTextField();JLabel jLabel4 = new JLabel();JTextField jTextField2 = new JTextField();JPanel jPanel1 = new JPanel();XYLayout xYLayout2 = new XYLayout();JScrollPane jScrollPane1 = new JScrollPane(); JLabel jLabel5 = new JLabel();JTextField jTextField3 = new JTextField(); public Frame6() {enableEvents(AWTEvent.WINDOW_EVENT_MASK);try {jbInit();}catch(Exception e) {e.printStackTrace();}}private void jbInit() throws Exception {contentPane = (JPanel) this.getContentPane();contentPane.setLayout(xYLayout1);this.setSize(new Dimension(600, 500));this.setTitle("实验室设备管理系统");this.addHierarchyBoundsListener(new Frame6_this_ con = null; String url = "jdbc:odbc:shebeiguanli";String user = "";String password = "";Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con = DriverManager.getConnection(url,user,password);Statement stmt =con.createStatement();PreparedStatement pstmt = con.prepareStatement("use shebeiguanli select * from 报废记录 where 设备型号=? and 设备名=? ");pstmt.setString(2, str1);pstmt.setString(1, str2);ResultSet res = pstmt.executeQuery();String id;String name;String guige,danjia,day,changjia,peo,num;String outputarea=" 设备型号 " +" 设备名称 "+" 报废记录 "+" 责任人 "+'\n';if(res.next()){do{id = res.getString(1);name = res.getString(2);day=res.getString(5);peo=res.getString(7);outputarea+=" "+id+" "+name+" "+day+" "+peo+""+"\n";jTextField3.setText(outputarea);}while(res.next());}else{jTextField3.setText("不存在");}}catch (ClassNotFoundException e) {System.out.println(e.getMessage());}catch (SQLException edd) {edd.printStackTrace() ;System.out.println(edd.getMessage());}}void this_ancestorMoved(HierarchyEvent e) {}void jTextField2_actionPerformed(ActionEvent e) { Select();}}class Frame6_this_;private JButton bApply, bAgain, bDelete;private JTable t;private JScrollPane jsp;private JComboBox cbeId;private JTextField tfNum;private User user;private StoreManager sma;private BuyApplyData baInfo;public BuyApply(User user) {super(new BorderLayout());设置布局管理器er = user;控件初始化leId = new JLabel("设备编号");lNum = new JLabel("申请数量");bApply = new JButton("申请");bAgain = new JButton("重置");bDelete = new JButton("删除");sma = new StoreManager();baInfo = new BuyApplyData();String[] = new JPanel();控件添加pUp.add(leId);pUp.add(cbeId);pUp.add(lNum);pUp.add(tfNum);pUp.add(bApply);pUp.add(bAgain);pDown.add(bDelete);add(pUp, BorderLayout.NORTH);add(jsp, BorderLayout.CENTER);add(pDown, BorderLayout.SOUTH);添加监听器bApply.addActionListener(new ListenButton());bAgain.addActionListener(new ListenButton());bDelete.addActionListener(new ListenButton());}定义按钮处理器class ListenButton implements ActionListener {public void actionPerformed(ActionEvent e) {if (e.getSource() == bApply) {点击申请按钮baInfo.seteId(cbeId.getSelectedItem().toString());baInfo.setuId(user.getuId());baInfo.setDate(new Date(System.currentTimeMillis()));baInfo.setbaNum(new Integer(tfNum.getText()));sma.add(baInfo);bAgain.doClick();} else if (e.getSource() == bAgain) {点击重置按钮tfNum.setText(null);} else if (e.getSource() == bDelete) {点击删除按钮int selectedIndex = -1;for (int i = 0; i < t.getRowCount(); i++) {if (t.isRowSelected(i) == true)selectedIndex = i;}if (selectedIndex == -1) {JOptionPane.showMessageDialog(null, "请先选择某一项!");return;} else {int option = JOptionPane.showConfirmDialog(null, "是否确定删除?","提示", JOptionPane.YES_NO_CANCEL_OPTION);if (option == JOptionPane.YES_OPTION) {baInfo.setId(newInteger(t.getValueAt(selectedIndex, 0).toString()));sma.delete(baInfo);}}}刷新数据表remove(jsp);String[] ;private JButton bUp,bDown;private JTable tLeft,tRight;private JScrollPane jspLeft,jspRight;private User user;public MaintainCheck(User user){t er=user;l Left=new JLabel("未审核列表");l Right=new JLabel("已审核列表");b Up=new JButton("通过");b Down=new JButton("不通过");p Left=new JPanel();p Right=new JPanel();p Center=new JPanel();p CUp=new JPanel();p CUp.add(bUp);p CDown=new JPanel();pCDown.add(bDown);pCenter.setLayout(new GridLayout(2,1));pCenter.add(pCUp);pCenter.add(pCDown);OverLeader ol=new OverLeader();String[] ());bDown.addActionListener(new ListenButton());}class ListenButton implements ActionListener{p ublic void actionPerformed(ActionEvent e){int selectedIndex = -1;for (int i = 0; i < tLeft.getRowCount(); i++) {if (tLeft.isRowSelected(i) == true)selectedIndex = i;}if (selectedIndex == -1) {JOptionPane.showMessageDialog(null, "请先选择某一项!");return;} else {int option = JOptionPane.showConfirmDialog(null,"是否确定审核此申请?", "提示",JOptionPane.YES_NO_CANCEL_OPTION);if (option == JOptionPane.YES_OPTION) {MaintainCheckData info = new MaintainCheckData();info.setaId(newInteger(tLeft.getValueAt(selectedIndex, 0).toString()));info.setuId(user.getuId());info.setDate(new Date(System.currentTimeMillis()));if(e.getSource()==bUp){info.setResult("通过");}else if(e.getSource()==bDown){info.setResult("不通过");}OverLeader ol=new OverLeader();ol.add(info);}}刷新remove(jspLeft);。