14. Employee-Service
Der Zugriff erfolgt über client.employee(). Der Service stellt CRUD-Operationen und Zählfunktionen für Mitarbeiter (Employee) bereit.
14.1 Methodenübersicht
| Methode | Rückgabetyp | HTTP | Endpunkt |
|---|---|---|---|
create(EmployeeRequestV5) | EmployeeResponseV5 oder null | POST | /api/v5/employee |
update(employee_id, EmployeeRequestV5) | EmployeeResponseV5 oder null | PUT | /api/v5/employee/{id} |
delete(employee_id) | boolean | DELETE | /api/v5/employee/{id} |
get(employee_id) | EmployeeResponseV5 oder null | GET | /api/v5/employee/{id} |
list() | List<EmployeeResponseV5> | GET | /api/v5/employee |
exists(employee_id) | boolean | GET | /api/v5/employee/{id}/exists |
count() | long | GET | /api/v5/employee/count |
14.2 EmployeeRequestV5 / EmployeeResponseV5
| Feld | Typ | Beschreibung |
|---|---|---|
employee_id | String | Mitarbeiter-ID (PK, in der Regel Personalnummer) |
name | String | Name |
site_id | String | Zugehöriger Standort |
org_id | String | Organisations-ID |
email | String | |
phone | String | Telefonnummer |
role_code | String | Rollencode (OPERATOR, SUPERVISOR, ENGINEER usw.) |
department | String | Abteilung |
14.3 Anwendungsbeispiele
Mitarbeiter anlegen
import plantpulse.api.v5.dto.request.EmployeeRequestV5;
import plantpulse.api.v5.dto.response.EmployeeResponseV5;
EmployeeRequestV5 req = new EmployeeRequestV5();
req.setEmployee_id("EMP_E12345");
req.setName("홍길동");
req.setSite_id("SITE_DJ");
req.setOrg_id("ORG_100");
req.setEmail("hong@example.com");
req.setPhone("01012345678");
req.setRole_code("OPERATOR");
req.setDepartment("생산1팀");
EmployeeResponseV5 created = client.employee().create(req);
Abfrage
EmployeeResponseV5 emp = client.employee().get("EMP_E12345");
if (emp != null) {
System.out.println(emp.getName() + " - " + emp.getDepartment());
}
Gesamtliste + Filterung nach Abteilung
import java.util.List;
import java.util.stream.Collectors;
List<EmployeeResponseV5> all = client.employee().list();
List<EmployeeResponseV5> 생산1팀 = all.stream()
.filter(e -> "생산1팀".equals(e.getDepartment()))
.collect(Collectors.toList());
Zählung
long total = client.employee().count();
Ändern / Löschen
EmployeeRequestV5 update = new EmployeeRequestV5();
update.setEmployee_id("EMP_E12345");
update.setName("홍길동");
update.setSite_id("SITE_DJ");
update.setRole_code("SUPERVISOR"); // 승진
client.employee().update("EMP_E12345", update);
client.employee().delete("EMP_E12345");
Nächste Schritte
- Customer-Service
- Product-Service
- Order-Service — Zuweisung von Mitarbeitern zu Arbeitsaufträgen