今天为大家分享一个java语言的超市进销存管理系统,目前系统已经完成了初步功能,后续会进一步完善。整个系统界面漂亮,有完整得源码,希望大家可以喜欢。喜欢的帮忙点赞和关注。一起编程、一起进步
开发环境
开发语言为Java,开发环境Eclipse或者IDEA都可以,数据为MySQL。运行主程序,或者执行打开JAR文件即可以运行本程序。
系统框架
利用JDK自带的SWING框架开发,下载。纯窗体模式,直接运行Main文件即可以。同时带有详细得设计文档。
系统主要功能
开发背景
随着社会的快速发展,计算机的影响是全面且深入的。人们生活水平的不断提高,日常生活中人们对宠物医院管理系统方面的要求也在不断提高,随着宠物医院受到广大用户的注视,使得宠物医院管理系统的开发成为必需而且紧迫的事情。宠物医院管理系统主要是借助计算机,通过对宠物医院管理系统所需的信息管理,增加用户的选择,同时也方便对广大用户信息的及时查询、修改以及对用户信息的及时了解。宠物医院管理系统对用户带来了更多的便利,该系统通过和数据库管理系统软件协作来满足用户的需求。
主要功能
宠物医院系统主要的功能有以下几点
1 系统登陆:通过输入密码,登陆到系统中来
2 修改密码:对用户的密码进行修改,修改后密码保存到数据库
3 宠物登记:登记的信息包括:宠物编号、宠物名称、宠物类别(猫、狗)、性别、出生日期、外部特征、宠物主任、登记日期
4 宠物诊断:宠物编号、就诊日期、症状、诊断结果、处理措施、诊断人
5 防疫登记:宠物编号、接种日期、疫苗编号、使用数量、接种人
6 疫苗登记:疫苗编号、疫苗名称、疫苗类型、注意事项
7 收费登记:宠物编号、收费日期、金额、就诊日期、接种日期、收费人
8 权限管理:整个系统分四种分四种人员,他们的权限如下:管理员(所有人员)、负责人和业务员的权限(宠物登记、宠物诊断、防疫登记业务员、收费员(收费登记)。
系统运行效果










关键代码
package login;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import baseInfo.userInfo.UserInfo;
import readwrite.UserIO;
import ui.bacterin.ShowBacterinInfo;
import ui.charge.ShowChargeInfo;
import ui.diagnose.ShowDiagnoseInfo;
import ui.epidemic.ShowEpidemicInfo;
import ui.pet.ShowPetInfo;
import ui.query.QueryUI;
import ui.user.ChangePassword;
import ui.user.ShowUserInfo;
public class MainFrame extends JFrame implements Runnable{
/**
* 宠物管理系统主窗口
*/
private JLabel jwelcome,juser,jtime,jimage;
// 宠物、 诊断、 防疫登记、 收费登记、 查询、 系统管理、 帮助
private JMenu jmpet,jmdiagnose,jmepidemic,jmcharge,jmquery,jmsys,jmhelp;
// 宠物记录 诊断记录 防疫记录 疫苗信息
private JMenuItem jmipetnote,jmidiagnosenote,jmiepidemicnote,jmibacterininfo,
// 收费记录 收费查询 用户管理 修改密码
jmichargenote,jmiquery,jmisysusermanger,jmichangerpassword,
// 退出系统 帮助文档 关于
jmisysexit,jmihelptext,jmiwith;
private JPanel jp1,jp2;
private JMenuBar menubar;
private final String ImagePATH="src/file/petdoctorlog.jpg";
private int index,usercode,userlevel;
private String username,levelname,systemtime;
// public static void main(String[] args) {
// MainFrame mf = new MainFrame();
// }
public MainFrame(int index){
this.index = index;
init();
}
public void init(){
int width = 600;
int height = 430;
this.setSize(width, height);
this.setTitle("用户管理");
this.setResizable(false);
int x = (int)(Toolkit.getDefaultToolkit().getScreenSize().getWidth()-width)/2;
int y = (int)(Toolkit.getDefaultToolkit().getScreenSize().getHeight()-height)/2;
this.setLocation(x, y);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.addCompanel();
Thread t = new Thread(this);
t.start();
//调用重置对应用户权限的功能界面getRight(int userlevel);
this.getRight();
this.addListener();
this.setVisible(true);
}
public void addCompanel(){
this.getJmpet().add(this.getJmipetnote());
this.getJmdiagnose().add(this.getJmidiagnosenote());
this.getJmepidemic().add(this.getJmiepidemicnote());
this.getJmepidemic().add(this.getJmibacterininfo());
this.getJmcharge().add(this.getJmichargenote());
this.getJmquery().add(this.getJmiquery());
this.getJmsys().add(this.getJmisysusermanger());
this.getJmsys().add(this.getJmichangerpassword());
this.getJmsys().add(this.getJmisysexit());
this.getJmhelp().add(this.getJmihelptext());
this.getJmhelp().add(this.getJmiwith());
this.getMenubar().add(this.getJmpet());
this.getMenubar().add(this.getJmdiagnose());
this.getMenubar().add(this.getJmepidemic());
this.getMenubar().add(this.getJmcharge());
this.getMenubar().add(this.getJmquery());
this.getMenubar().add(this.getJmsys());
this.getMenubar().add(this.getJmhelp());
this.getJp1().setLayout(new GridLayout(1,3));
this.getJp1().add(this.getJwelcome());
this.getJp1().add(this.getJuser());
this.getJp1().add(this.getJtime());
this.getJp2().add(this.getJimage());
this.add(this.getMenubar(),BorderLayout.NORTH);
this.add(this.getJp2(),BorderLayout.CENTER);
this.add(this.getJp1(),BorderLayout.SOUTH);
}
public void addListener(){
/*宠物登记---宠物记录*/
this.getJmipetnote().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ShowPetInfo(getUserlevel());
}
});
/*诊断登记--诊断记录*/
this.getJmidiagnosenote().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ShowDiagnoseInfo();
}
});
/*系统管理---用户信息管理*/
this.getJmisysusermanger().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ShowUserInfo(getIndex());
}
});
/* 防疫登记--防疫记录*/
this.getJmiepidemicnote().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ShowEpidemicInfo();
}
});
/*防疫登记--疫苗信息*/
this.getJmibacterininfo().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ShowBacterinInfo();
}
});
this.getJmichargenote().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ShowChargeInfo();
}
});
/*收费查询*/
this.getJmiquery().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new QueryUI();
}
});
/*系统管理--退出系统*/
this.getJmisysexit().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int config=JOptionPane.showConfirmDialog(null, "是否退出当前系统?", "退出系统", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(config == JOptionPane.YES_OPTION){
System.exit(0);
// UserIO pio=new UserIO();
// boolean flag = pio.delUserinfo(index);
// if(flag){
// }else{
// return;
// }
}
}
});
/*系统管理--修改密码*/
this.getJmichangerpassword().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ChangePassword(getIndex());
}
});
/*帮助---关于*/
this.getJmiwith().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new With();
// JOptionPane.showConfirmDialog(null, "宠物医院门诊管理系统\n版本1.0\n\n本系统使用java/swing开发", "关于", JOptionPane.YES_OPTION);
}
});
}
public JLabel getJwelcome() {
if(jwelcome == null){
jwelcome = new JLabel("欢迎使用宠物医院门诊管理系统!");
}
return jwelcome;
}
public JLabel getJuser() {
if(juser == null){
juser = new JLabel("操作员:["+this.getUsercode()+","+this.getUsername()+",权限:"+this.getLevelname()+"]");
}
return juser;
}
public JLabel getJtime() {
if(jtime == null){
jtime = new JLabel("系统时间:"+this.getSystemtime());
}
return jtime;
}
public JMenu getJmpet() {
if(jmpet == null){
jmpet = new JMenu("宠物登记");
}
return jmpet;
}
public JMenu getJmdiagnose() {
if(jmdiagnose == null){
jmdiagnose = new JMenu("诊断登记");
}
return jmdiagnose;
}
public JMenu getJmepidemic() {
if(jmepidemic == null){
jmepidemic = new JMenu("防疫登记");
}
return jmepidemic;
}
public JMenu getJmcharge() {
if(jmcharge == null){
jmcharge = new JMenu("收费登记");
}
return jmcharge;
}
public JMenu getJmquery() {
if(jmquery == null){
jmquery = new JMenu("查 询");
}
return jmquery;
}
public JMenu getJmsys() {
if(jmsys == null){
jmsys = new JMenu("系统管理");
}
return jmsys;
}
public JMenu getJmhelp() {
if(jmhelp == null){
jmhelp = new JMenu("帮助");
}
return jmhelp;
}
public JMenuItem getJmipetnote() {
if(jmipetnote == null){
jmipetnote = new JMenuItem("宠物记录");
}
return jmipetnote;
}
public JMenuItem getJmidiagnosenote() {
if(jmidiagnosenote == null){
jmidiagnosenote = new JMenuItem("诊断记录");
}
return jmidiagnosenote;
}
public JMenuItem getJmiepidemicnote() {
if(jmiepidemicnote == null){
jmiepidemicnote = new JMenuItem("防疫记录");
}
return jmiepidemicnote;
}
public JMenuItem getJmibacterininfo() {
if(jmibacterininfo == null){
jmibacterininfo = new JMenuItem("疫苗信息");
}
return jmibacterininfo;
}
public JMenuItem getJmichargenote() {
if(jmichargenote == null){
jmichargenote = new JMenuItem("收费记录");
}
return jmichargenote;
}
public JMenuItem getJmiquery() {
if(jmiquery == null){
jmiquery = new JMenuItem("收费查询");
}
return jmiquery;
}
public JMenuItem getJmisysusermanger() {
if(jmisysusermanger == null){
jmisysusermanger = new JMenuItem("用户管理");
}
return jmisysusermanger;
}
public JMenuItem getJmichangerpassword() {
if(jmichangerpassword == null){
jmichangerpassword = new JMenuItem("修改密码");
}
return jmichangerpassword;
}
public JMenuItem getJmisysexit() {
if(jmisysexit == null){
jmisysexit = new JMenuItem("退出系统");
}
return jmisysexit;
}
public JMenuItem getJmihelptext() {
if(jmihelptext == null){
jmihelptext = new JMenuItem("帮助文档");
}
return jmihelptext;
}
public JMenuItem getJmiwith() {
if(jmiwith == null){
jmiwith = new JMenuItem("关于");
}
return jmiwith;
}
public JPanel getJp1() {
if(jp1 == null){
jp1 = new JPanel();
}
return jp1;
}
public JPanel getJp2() {
if(jp2 == null){
jp2 = new JPanel();
}
return jp2;
}
public JLabel getJimage() {
if(jimage == null){
java.net.URL imgURL = MainFrame.class.getResource("/file/petdoctorlog.jpg");
jimage = new JLabel(new ImageIcon(imgURL));
}
return jimage;
}
public JMenuBar getMenubar() {
if(menubar == null){
menubar = new JMenuBar();
}
return menubar;
}
public int getIndex() {
return index;
}
public int getUsercode() {
UserIO uio =new UserIO();
UserInfo ui=uio.queryUserinfoByIndex(this.getIndex());
this.usercode=ui.getUsercode();
return usercode;
}
public String getUsername() {
UserIO uio =new UserIO();
UserInfo ui=uio.queryUserinfoByIndex(this.getIndex());
this.username=ui.getUsername();
return username;
}
/*获取级别名称*/
public String getLevelname() {
UserIO uio =new UserIO();
UserInfo ui=uio.queryUserinfoByIndex(this.getIndex());
this.levelname=ui.getLevelname();
return levelname;
}
/*获取用户权限级别*/
public int getUserlevel() {
UserIO uio =new UserIO();
UserInfo ui=uio.queryUserinfoByIndex(this.getIndex());
this.userlevel=ui.getUserlevel();
return userlevel;
}
/**
* 重置界面菜单权限
* @param userlevel
*/
public void getRight(){
int userlevel=this.getUserlevel();
switch(userlevel){
case 1:
this.systemManger();//管理员
break;
case 2:
this.personInCharge();//负责人
break;
case 3:
this.salesman();//业务员
break;
case 4:
this.cashier();//收银员
break;
}
}
/**
* 管理员权限 ALL
*/
public void systemManger(){
}
/**
* 负责人权限 【不可用:用户管理,其他所有模块中有关新增,删除,编辑功能不可用】
*/
public void personInCharge(){
/*用户管理不可用*/
this.getJmisysusermanger().setEnabled(false);
}
/**
* 业务员 【不可用:收费登记及子功能,用户管理】
*/
public void salesman(){
this.getJmcharge().setEnabled(false);
this.getJmisysusermanger().setEnabled(false);
}
/**
* 收银员【可用:收费登记及子项,修改密码,退出系统,帮助及子项】
*/
public void cashier(){
this.getJmpet().setEnabled(false);
this.getJmdiagnose().setEnabled(false);
this.getJmepidemic().setEnabled(false);
this.getJmisysusermanger().setEnabled(false);
this.getJmquery().setEnabled(false);
}
public void setSystemtime(String systemtime){
this.systemtime=systemtime;
}
public String getSystemtime() {
return systemtime;
}
public void run() {
while (true) {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String stime="";
stime = sdf.format(date);
this.setSystemtime(stime);
this.getJtime().setText("系统时间:"+this.getSystemtime());
try {
Thread.sleep(1000);
} catch (Exception e) {
System.out.println("获取时间失败");
}
}
}
///////////////////////////////////////////////
///////////////////////////////////////////////
/**
* 帮助---关于
* @author Administrator
*
*/
final class With extends JFrame{
private JLabel j1,j2,j3;
private JPanel jp1,jp2,jp3,jp4,jp5;
private JButton submit;
public With(){
this.init();
}
public void init(){
int width = 230;
int height = 200;
this.setSize(width, height);
this.setTitle("关于");
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
int x = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth() - width) / 2;
int y = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight() - height) / 2;
this.setLocation(x, y);
addcop();
addal();
this.setVisible(true);
}
public void addcop(){
this.getJp1().add(this.getJ1());
this.getJp2().add(this.getJ2());
this.getJp4().add(this.getJ3());
this.getJp5().add(this.getSubmit());
this.setLayout(new GridLayout(5,1));
this.add(this.getJp1());
this.add(this.getJp2());
this.add(this.getJp3());
this.add(this.getJp4());
this.add(this.getJp5());
}
public void addal(){
this.getSubmit().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
}
public JLabel getJ1() {
if(j1 == null){
j1 = new JLabel("宠物医院门诊管理系统",JLabel.CENTER);
}
return j1;
}
public JLabel getJ2() {
if(j2 == null){
j2 = new JLabel("版本1.0",JLabel.CENTER);
}
return j2;
}
public JLabel getJ3() {
if(j3 == null){
j3 = new JLabel("本系统使用java/swing开发",JLabel.CENTER);
}
return j3;
}
public JPanel getJp1() {
if(jp1 == null){
jp1 = new JPanel();
}
return jp1;
}
public JPanel getJp2() {
if(jp2 == null){
jp2 = new JPanel();
}
return jp2;
}
public JPanel getJp3() {
if(jp3 == null){
jp3 = new JPanel();
}
return jp3;
}
public JPanel getJp4() {
if(jp4 == null){
jp4 = new JPanel();
}
return jp4;
}
public JPanel getJp5() {
if(jp5 == null){
jp5 = new JPanel();
}
return jp5;
}
public JButton getSubmit() {
if(submit == null){
submit = new JButton("确定");
}
return submit;
}
}
}
这是一个基于JavaSwing开发的宠物医院管理系统,具备宠物登记、诊断、防疫登记等功能,还包括权限管理,如管理员、负责人、业务员和收费员的权限分配。系统提供完整的源码,界面友好,支持密码修改和数据库交互。
1519

被折叠的 条评论
为什么被折叠?



