Die Grundfunktionen des Reiters "Produktion" wurden implementiert.
Anmerkungen: Die KI implementiert die Funktionen besser und fehlerfreier, wenn man explizit fragt welche Methode hinzugefügt beziehungsweise erweitert werden soll.master
parent
509adb1ac3
commit
82d79c0ec6
|
@ -139,6 +139,7 @@ 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);
|
||||||
|
@ -1033,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();
|
||||||
|
@ -1074,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();
|
||||||
}
|
}
|
||||||
|
@ -1090,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();
|
||||||
}
|
}
|
||||||
|
@ -1106,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();
|
||||||
|
@ -1122,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();
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
2,manager,manager123,Manager
|
2,manager,manager123,Manager
|
||||||
3,user,user123,User
|
3,user,user123,User
|
||||||
4,Abbas,12,Administrator
|
4,Abbas,12,Administrator
|
||||||
|
5,Abbas,12,Administrator
|
||||||
|
|
Loading…
Reference in New Issue