Updated response

This commit is contained in:
rajesh
2024-12-27 17:31:58 +05:30
parent 549478b610
commit f8099fd423
6 changed files with 31 additions and 2 deletions

View File

@@ -387,6 +387,16 @@ public class ApplicationDao {
responseBean.setStatus(applicationEntity.getStatus());
responseBean.setComments(applicationEntity.getComments());
responseBean.setCompanyId(applicationEntity.getCompanyId());
Optional<AssignedApplicationsEntity> assignedApplicationsOptional =
assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(applicationEntity.getId());
if(assignedApplicationsOptional.isPresent()){
responseBean.setAssignedUserId(assignedApplicationsOptional.get().getUserId());
UserEntity user = userService.validateUser(assignedApplicationsOptional.get().getUserId());
String firstName = user.getFirstName() != null ? user.getFirstName() : "";
String lastName = user.getLastName() != null ? user.getLastName() : "";
String userName = String.join(" ", firstName, lastName).trim();
responseBean.setAssignedUserName(userName);
}
CompanyEntity company=companyService.validateCompany(applicationEntity.getCompanyId());
responseBean.setCompanyName(company.getCompanyName());
if(applicationEntity.getProtocol() != null) {