|
|
@ -93,6 +93,17 @@ public class Warenwirtschaftssystem {
|
|
|
|
System.exit(0);
|
|
|
|
System.exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkAndCreateFile(String fileName) {
|
|
|
|
|
|
|
|
File file = new File(fileName);
|
|
|
|
|
|
|
|
if (!file.exists()) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
file.createNewFile();
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void showCreateUserDialog() {
|
|
|
|
private void showCreateUserDialog() {
|
|
|
|
JPanel createUserPanel = new JPanel(new GridLayout(4, 2, 10, 10));
|
|
|
|
JPanel createUserPanel = new JPanel(new GridLayout(4, 2, 10, 10));
|
|
|
@ -128,8 +139,9 @@ public class Warenwirtschaftssystem {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeMainComponents() {
|
|
|
|
private void initializeMainComponents() {
|
|
|
|
frame = new JFrame("Warenwirtschaftssystem");
|
|
|
|
frame = new JFrame("Warenwirtschaftssystem");
|
|
|
|
frame.setSize(1200, 800);
|
|
|
|
frame.setSize(1200, 800);
|
|
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
|
|
|
|
|
|
|
@ -137,6 +149,13 @@ public class Warenwirtschaftssystem {
|
|
|
|
mainPanel.setLayout(new BorderLayout());
|
|
|
|
mainPanel.setLayout(new BorderLayout());
|
|
|
|
mainPanel.setBackground(Color.decode("#F5F5F5"));
|
|
|
|
mainPanel.setBackground(Color.decode("#F5F5F5"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Überprüfen und Erstellen der Dateien
|
|
|
|
|
|
|
|
checkAndCreateFile("products.txt");
|
|
|
|
|
|
|
|
checkAndCreateFile("suppliers.txt");
|
|
|
|
|
|
|
|
checkAndCreateFile("orders.txt");
|
|
|
|
|
|
|
|
checkAndCreateFile("customers.txt");
|
|
|
|
|
|
|
|
checkAndCreateFile("employees.txt");
|
|
|
|
|
|
|
|
checkAndCreateFile("users.txt");
|
|
|
|
// Menüleiste erstellen
|
|
|
|
// Menüleiste erstellen
|
|
|
|
menuBar = new JMenuBar();
|
|
|
|
menuBar = new JMenuBar();
|
|
|
|
|
|
|
|
|
|
|
@ -1015,36 +1034,91 @@ public class Warenwirtschaftssystem {
|
|
|
|
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Produktionsplanung", TitledBorder.CENTER, TitledBorder.TOP));
|
|
|
|
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Produktionsplanung", TitledBorder.CENTER, TitledBorder.TOP));
|
|
|
|
panel.setBackground(Color.decode("#ECF0F1"));
|
|
|
|
panel.setBackground(Color.decode("#ECF0F1"));
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Plan erstellen"));
|
|
|
|
|
|
|
|
JButton createPlanButton = new JButton("Plan erstellen");
|
|
|
|
JButton createPlanButton = new JButton("Plan erstellen");
|
|
|
|
|
|
|
|
JButton manageBOMButton = new JButton("Stückliste anzeigen");
|
|
|
|
|
|
|
|
JButton productionControlButton = new JButton("Steuerung anzeigen");
|
|
|
|
|
|
|
|
JButton qualityControlButton = new JButton("Kontrolle anzeigen");
|
|
|
|
|
|
|
|
JButton productionCostsButton = new JButton("Kosten anzeigen");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Plan erstellen"));
|
|
|
|
panel.add(createPlanButton);
|
|
|
|
panel.add(createPlanButton);
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Stückliste verwalten"));
|
|
|
|
panel.add(new JLabel("Stückliste verwalten"));
|
|
|
|
JButton manageBOMButton = new JButton("Stückliste anzeigen");
|
|
|
|
|
|
|
|
panel.add(manageBOMButton);
|
|
|
|
panel.add(manageBOMButton);
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Produktionssteuerung"));
|
|
|
|
panel.add(new JLabel("Produktionssteuerung"));
|
|
|
|
JButton productionControlButton = new JButton("Steuerung anzeigen");
|
|
|
|
|
|
|
|
panel.add(productionControlButton);
|
|
|
|
panel.add(productionControlButton);
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Qualitätskontrolle"));
|
|
|
|
panel.add(new JLabel("Qualitätskontrolle"));
|
|
|
|
JButton qualityControlButton = new JButton("Kontrolle anzeigen");
|
|
|
|
|
|
|
|
panel.add(qualityControlButton);
|
|
|
|
panel.add(qualityControlButton);
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Produktionskosten"));
|
|
|
|
panel.add(new JLabel("Produktionskosten"));
|
|
|
|
JButton productionCostsButton = new JButton("Kosten anzeigen");
|
|
|
|
|
|
|
|
panel.add(productionCostsButton);
|
|
|
|
panel.add(productionCostsButton);
|
|
|
|
|
|
|
|
|
|
|
|
createPlanButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Produktionsplan erstellt", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
|
|
|
createPlanButton.addActionListener(e -> showCreatePlanDialog());
|
|
|
|
manageBOMButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Stückliste verwaltet", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
|
|
|
manageBOMButton.addActionListener(e -> openStuecklisten());
|
|
|
|
productionControlButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Produktionssteuerung angezeigt", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
|
|
|
productionControlButton.addActionListener(e -> openProduktionssteuerung());
|
|
|
|
qualityControlButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Qualitätskontrolle durchgeführt", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
|
|
|
qualityControlButton.addActionListener(e -> openQualitaetskontrolle());
|
|
|
|
productionCostsButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Produktionskosten berechnet", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
|
|
|
productionCostsButton.addActionListener(e -> openProduktionskosten());
|
|
|
|
|
|
|
|
|
|
|
|
mainPanel.add(panel, BorderLayout.CENTER);
|
|
|
|
mainPanel.add(panel, BorderLayout.CENTER);
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void showCreatePlanDialog() {
|
|
|
|
|
|
|
|
JDialog dialog = new JDialog(frame, "Produktionsplan erstellen", true);
|
|
|
|
|
|
|
|
dialog.setSize(400, 300);
|
|
|
|
|
|
|
|
dialog.setLocationRelativeTo(frame);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new GridLayout(6, 2, 10, 10));
|
|
|
|
|
|
|
|
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Produktionsplan", TitledBorder.CENTER, TitledBorder.TOP));
|
|
|
|
|
|
|
|
panel.setBackground(Color.decode("#ECF0F1"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Produkt:"));
|
|
|
|
|
|
|
|
JTextField productField = new JTextField();
|
|
|
|
|
|
|
|
panel.add(productField);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Menge:"));
|
|
|
|
|
|
|
|
JTextField quantityField = new JTextField();
|
|
|
|
|
|
|
|
panel.add(quantityField);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Startdatum:"));
|
|
|
|
|
|
|
|
JTextField startDateField = new JTextField();
|
|
|
|
|
|
|
|
panel.add(startDateField);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel.add(new JLabel("Enddatum:"));
|
|
|
|
|
|
|
|
JTextField endDateField = new JTextField();
|
|
|
|
|
|
|
|
panel.add(endDateField);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JButton saveButton = new JButton("Speichern");
|
|
|
|
|
|
|
|
panel.add(saveButton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
saveButton.addActionListener(e -> {
|
|
|
|
|
|
|
|
String product = productField.getText();
|
|
|
|
|
|
|
|
int quantity = Integer.parseInt(quantityField.getText());
|
|
|
|
|
|
|
|
String startDate = startDateField.getText();
|
|
|
|
|
|
|
|
String endDate = endDateField.getText();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Speichern des Produktionsplans (Implementierung erforderlich)
|
|
|
|
|
|
|
|
saveProductionPlan(product, quantity, startDate, endDate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog.dispose();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog.add(panel);
|
|
|
|
|
|
|
|
dialog.setVisible(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveProductionPlan(String product, int quantity, String startDate, String endDate) {
|
|
|
|
|
|
|
|
// Implementiere die Logik zum Speichern des Produktionsplans (z.B. in einer Datei oder Datenbank)
|
|
|
|
|
|
|
|
// Beispiel: Produktionsplan in eine Datei speichern
|
|
|
|
|
|
|
|
try (BufferedWriter writer = new BufferedWriter(new FileWriter("production_plans.txt", true))) {
|
|
|
|
|
|
|
|
writer.write(product + "," + quantity + "," + startDate + "," + endDate);
|
|
|
|
|
|
|
|
writer.newLine();
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void openStuecklisten() {
|
|
|
|
private void openStuecklisten() {
|
|
|
|
mainPanel.removeAll();
|
|
|
|
mainPanel.removeAll();
|
|
|
@ -1056,8 +1130,18 @@ public class Warenwirtschaftssystem {
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
|
|
|
|
|
|
|
|
// Implementiere hier die Funktionalität zur Verwaltung von Stücklisten
|
|
|
|
// Beispielhafte Implementierung zur Anzeige der Stücklisten
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout());
|
|
|
|
|
|
|
|
DefaultTableModel bomModel = new DefaultTableModel(new Object[]{"Artikelnummer", "Komponente", "Menge"}, 0);
|
|
|
|
|
|
|
|
JTable bomTable = new JTable(bomModel);
|
|
|
|
|
|
|
|
JScrollPane scrollPane = new JScrollPane(bomTable);
|
|
|
|
|
|
|
|
panel.add(scrollPane, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Beispiel: Fügen Sie hier Stücklisten hinzu
|
|
|
|
|
|
|
|
bomModel.addRow(new Object[]{"P001", "K001", 5});
|
|
|
|
|
|
|
|
bomModel.addRow(new Object[]{"P001", "K002", 3});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainPanel.add(panel, BorderLayout.CENTER);
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1072,8 +1156,18 @@ public class Warenwirtschaftssystem {
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
|
|
|
|
|
|
|
|
// Implementiere hier die Funktionalität zur Produktionssteuerung
|
|
|
|
// Beispielhafte Implementierung zur Anzeige der Produktionssteuerung
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout());
|
|
|
|
|
|
|
|
DefaultTableModel controlModel = new DefaultTableModel(new Object[]{"Produkt", "Status", "Fortschritt"}, 0);
|
|
|
|
|
|
|
|
JTable controlTable = new JTable(controlModel);
|
|
|
|
|
|
|
|
JScrollPane scrollPane = new JScrollPane(controlTable);
|
|
|
|
|
|
|
|
panel.add(scrollPane, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Beispiel: Fügen Sie hier Produktionssteuerungsdaten hinzu
|
|
|
|
|
|
|
|
controlModel.addRow(new Object[]{"Produkt A", "In Produktion", "50%"});
|
|
|
|
|
|
|
|
controlModel.addRow(new Object[]{"Produkt B", "Geplant", "0%"});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainPanel.add(panel, BorderLayout.CENTER);
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1088,12 +1182,23 @@ public class Warenwirtschaftssystem {
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
|
|
|
|
|
|
|
|
// Implementiere hier die Funktionalität zur Qualitätskontrolle
|
|
|
|
// Beispielhafte Implementierung zur Anzeige der Qualitätskontrolle
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout());
|
|
|
|
|
|
|
|
DefaultTableModel qualityModel = new DefaultTableModel(new Object[]{"Produkt", "Tester", "Ergebnis", "Datum"}, 0);
|
|
|
|
|
|
|
|
JTable qualityTable = new JTable(qualityModel);
|
|
|
|
|
|
|
|
JScrollPane scrollPane = new JScrollPane(qualityTable);
|
|
|
|
|
|
|
|
panel.add(scrollPane, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Beispiel: Fügen Sie hier Qualitätskontrolldaten hinzu
|
|
|
|
|
|
|
|
qualityModel.addRow(new Object[]{"Produkt A", "Tester 1", "Bestanden", "2024-01-01"});
|
|
|
|
|
|
|
|
qualityModel.addRow(new Object[]{"Produkt B", "Tester 2", "Nicht bestanden", "2024-01-02"});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainPanel.add(panel, BorderLayout.CENTER);
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void openProduktionskosten() {
|
|
|
|
private void openProduktionskosten() {
|
|
|
|
mainPanel.removeAll();
|
|
|
|
mainPanel.removeAll();
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.repaint();
|
|
|
@ -1104,12 +1209,23 @@ public class Warenwirtschaftssystem {
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
label.setForeground(Color.decode("#2C3E50"));
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
mainPanel.add(label, BorderLayout.NORTH);
|
|
|
|
|
|
|
|
|
|
|
|
// Implementiere hier die Funktionalität zur Produktionskosten
|
|
|
|
// Beispielhafte Implementierung zur Anzeige der Produktionskosten
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout());
|
|
|
|
|
|
|
|
DefaultTableModel costsModel = new DefaultTableModel(new Object[]{"Produkt", "Materialkosten", "Arbeitskosten", "Gesamtkosten"}, 0);
|
|
|
|
|
|
|
|
JTable costsTable = new JTable(costsModel);
|
|
|
|
|
|
|
|
JScrollPane scrollPane = new JScrollPane(costsTable);
|
|
|
|
|
|
|
|
panel.add(scrollPane, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Beispiel: Fügen Sie hier Produktionskostendaten hinzu
|
|
|
|
|
|
|
|
costsModel.addRow(new Object[]{"Produkt A", 5000, 2000, 7000});
|
|
|
|
|
|
|
|
costsModel.addRow(new Object[]{"Produkt B", 3000, 1500, 4500});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainPanel.add(panel, BorderLayout.CENTER);
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
mainPanel.revalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void openBuchhaltung() {
|
|
|
|
private void openBuchhaltung() {
|
|
|
|
mainPanel.removeAll();
|
|
|
|
mainPanel.removeAll();
|
|
|
|
mainPanel.repaint();
|
|
|
|
mainPanel.repaint();
|
|
|
|