Compare commits
No commits in common. "82d79c0ec6677f7a08a477c8cd241a6df0f369c6" and "69ba157b30d5dc51bc62d6aba28ab55adce8d248" have entirely different histories.
82d79c0ec6
...
69ba157b30
|
@ -93,17 +93,6 @@ public class Warenwirtschaftssystem {
|
|||
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() {
|
||||
JPanel createUserPanel = new JPanel(new GridLayout(4, 2, 10, 10));
|
||||
|
@ -139,9 +128,8 @@ public class Warenwirtschaftssystem {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void initializeMainComponents() {
|
||||
frame = new JFrame("Warenwirtschaftssystem");
|
||||
frame = new JFrame("Warenwirtschaftssystem");
|
||||
frame.setSize(1200, 800);
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
|
@ -149,13 +137,6 @@ public class Warenwirtschaftssystem {
|
|||
mainPanel.setLayout(new BorderLayout());
|
||||
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
|
||||
menuBar = new JMenuBar();
|
||||
|
||||
|
@ -1034,91 +1015,36 @@ public class Warenwirtschaftssystem {
|
|||
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Produktionsplanung", TitledBorder.CENTER, TitledBorder.TOP));
|
||||
panel.setBackground(Color.decode("#ECF0F1"));
|
||||
|
||||
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"));
|
||||
JButton createPlanButton = new JButton("Plan erstellen");
|
||||
panel.add(createPlanButton);
|
||||
|
||||
panel.add(new JLabel("Stückliste verwalten"));
|
||||
JButton manageBOMButton = new JButton("Stückliste anzeigen");
|
||||
panel.add(manageBOMButton);
|
||||
|
||||
panel.add(new JLabel("Produktionssteuerung"));
|
||||
JButton productionControlButton = new JButton("Steuerung anzeigen");
|
||||
panel.add(productionControlButton);
|
||||
|
||||
panel.add(new JLabel("Qualitätskontrolle"));
|
||||
JButton qualityControlButton = new JButton("Kontrolle anzeigen");
|
||||
panel.add(qualityControlButton);
|
||||
|
||||
panel.add(new JLabel("Produktionskosten"));
|
||||
JButton productionCostsButton = new JButton("Kosten anzeigen");
|
||||
panel.add(productionCostsButton);
|
||||
|
||||
createPlanButton.addActionListener(e -> showCreatePlanDialog());
|
||||
manageBOMButton.addActionListener(e -> openStuecklisten());
|
||||
productionControlButton.addActionListener(e -> openProduktionssteuerung());
|
||||
qualityControlButton.addActionListener(e -> openQualitaetskontrolle());
|
||||
productionCostsButton.addActionListener(e -> openProduktionskosten());
|
||||
createPlanButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Produktionsplan erstellt", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
||||
manageBOMButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Stückliste verwaltet", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
||||
productionControlButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Produktionssteuerung angezeigt", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
||||
qualityControlButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Qualitätskontrolle durchgeführt", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
||||
productionCostsButton.addActionListener(e -> JOptionPane.showMessageDialog(frame, "Produktionskosten berechnet", "Erfolg", JOptionPane.INFORMATION_MESSAGE));
|
||||
|
||||
mainPanel.add(panel, BorderLayout.CENTER);
|
||||
mainPanel.repaint();
|
||||
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() {
|
||||
mainPanel.removeAll();
|
||||
|
@ -1130,18 +1056,8 @@ public class Warenwirtschaftssystem {
|
|||
label.setForeground(Color.decode("#2C3E50"));
|
||||
mainPanel.add(label, BorderLayout.NORTH);
|
||||
|
||||
// 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);
|
||||
// Implementiere hier die Funktionalität zur Verwaltung von Stücklisten
|
||||
|
||||
// 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.revalidate();
|
||||
}
|
||||
|
@ -1156,18 +1072,8 @@ public class Warenwirtschaftssystem {
|
|||
label.setForeground(Color.decode("#2C3E50"));
|
||||
mainPanel.add(label, BorderLayout.NORTH);
|
||||
|
||||
// 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);
|
||||
// Implementiere hier die Funktionalität zur Produktionssteuerung
|
||||
|
||||
// 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.revalidate();
|
||||
}
|
||||
|
@ -1182,23 +1088,12 @@ public class Warenwirtschaftssystem {
|
|||
label.setForeground(Color.decode("#2C3E50"));
|
||||
mainPanel.add(label, BorderLayout.NORTH);
|
||||
|
||||
// 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);
|
||||
// Implementiere hier die Funktionalität zur Qualitätskontrolle
|
||||
|
||||
// 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.revalidate();
|
||||
}
|
||||
|
||||
|
||||
private void openProduktionskosten() {
|
||||
mainPanel.removeAll();
|
||||
mainPanel.repaint();
|
||||
|
@ -1209,23 +1104,12 @@ public class Warenwirtschaftssystem {
|
|||
label.setForeground(Color.decode("#2C3E50"));
|
||||
mainPanel.add(label, BorderLayout.NORTH);
|
||||
|
||||
// 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);
|
||||
// Implementiere hier die Funktionalität zur Produktionskosten
|
||||
|
||||
// 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.revalidate();
|
||||
}
|
||||
|
||||
|
||||
private void openBuchhaltung() {
|
||||
mainPanel.removeAll();
|
||||
mainPanel.repaint();
|
||||
|
|
|
@ -2,4 +2,3 @@
|
|||
2,manager,manager123,Manager
|
||||
3,user,user123,User
|
||||
4,Abbas,12,Administrator
|
||||
5,Abbas,12,Administrator
|
||||
|
|
Loading…
Reference in New Issue