14. Employee Service
Accessed via client.employee(). Provides CRUD operations and counts for employees.
14.1 Method Overview
| Method | Return Type | HTTP | Endpoint |
|---|---|---|---|
create(EmployeeRequestV5) | EmployeeResponseV5 or null | POST | /api/v5/employee |
update(employee_id, EmployeeRequestV5) | EmployeeResponseV5 or null | PUT | /api/v5/employee/{id} |
delete(employee_id) | boolean | DELETE | /api/v5/employee/{id} |
get(employee_id) | EmployeeResponseV5 or 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
| Field | Type | Description |
|---|---|---|
employee_id | String | Employee ID (PK, usually the employee number) |
name | String | Name |
site_id | String | Assigned site |
org_id | String | Organization ID |
email | String | |
phone | String | Phone number |
role_code | String | Role code (OPERATOR, SUPERVISOR, ENGINEER, etc.) |
department | String | Department |
14.3 Usage Examples
Creating an Employee
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);
Retrieval
EmployeeResponseV5 emp = client.employee().get("EMP_E12345");
if (emp != null) {
System.out.println(emp.getName() + " - " + emp.getDepartment());
}
Full List + Filtering by Department
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());
Count
long total = client.employee().count();
Update / Delete
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");
Next Steps
- Customer Service
- Product Service
- Order Service — assigning employees to work orders