diff --git a/core-services/egov-hrms/src/main/java/org/egov/hrms/service/EmployeeService.java b/core-services/egov-hrms/src/main/java/org/egov/hrms/service/EmployeeService.java index b3f05426c7..fae197c316 100644 --- a/core-services/egov-hrms/src/main/java/org/egov/hrms/service/EmployeeService.java +++ b/core-services/egov-hrms/src/main/java/org/egov/hrms/service/EmployeeService.java @@ -343,11 +343,18 @@ public Long getPosition() { */ public EmployeeResponse update(EmployeeRequest employeeRequest) { RequestInfo requestInfo = employeeRequest.getRequestInfo(); + + String tenantId = null; + if (!CollectionUtils.isEmpty(employeeRequest.getEmployees())) { + tenantId = employeeRequest.getEmployees().get(0).getTenantId(); + } + List uuidList= new ArrayList<>(); for(Employee employee: employeeRequest.getEmployees()) { uuidList.add(employee.getUuid()); } - EmployeeResponse existingEmployeeResponse = search(EmployeeSearchCriteria.builder().uuids(uuidList).build(),requestInfo); + + EmployeeResponse existingEmployeeResponse = search(EmployeeSearchCriteria.builder().uuids(uuidList).tenantId(tenantId).build(),requestInfo); List existingEmployees = existingEmployeeResponse.getEmployees(); employeeRequest.getEmployees().stream().forEach(employee -> { enrichUpdateRequest(employee, requestInfo, existingEmployees);