From 74a1d131fa6e807cb2c27efea972dc4055a9fe5b Mon Sep 17 00:00:00 2001 From: kanishq-egov Date: Fri, 31 May 2024 15:18:30 +0530 Subject: [PATCH] HLM Health-HRMS bug fix, user was set to null in hrms update as the tenantid was not provided during internal search --- .../main/java/org/egov/hrms/service/EmployeeService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 b3f05426c7a..fae197c316d 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);