Updated response
This commit is contained in:
@@ -110,6 +110,8 @@ public class ApplicationAmendmentRequestDao {
|
||||
|
||||
@Autowired
|
||||
private DocumentRepository documentRepository;
|
||||
@Autowired
|
||||
private CompanyService companyService;
|
||||
|
||||
public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(Long applicationEvaluationId) {
|
||||
log.info("Fetching the application data for the Amendment process {}", applicationEvaluationId);
|
||||
@@ -454,7 +456,8 @@ public class ApplicationAmendmentRequestDao {
|
||||
|
||||
UserEntity userEntity = userService.validateUser(application.getUserId());
|
||||
response.setBeneficiaryName(buildBeneficiaryName(userEntity));
|
||||
|
||||
CompanyEntity company = companyService.validateCompany(application.getCompanyId());
|
||||
response.setCompanyName(company.getCompanyName());
|
||||
Long protocolNumber = entity.getProtocol() != null ? entity.getProtocol().getProtocolNumber() : null;
|
||||
response.setProtocolNumber(protocolNumber);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -558,7 +558,16 @@ public class ApplicationEvaluationDao {
|
||||
response.setAssignedAt(assignedApplications.getAssignedAt());
|
||||
}
|
||||
response.setEvaluationEndDate(entity.getEndDate());
|
||||
|
||||
Optional<AssignedApplicationsEntity> assignedApplicationsOptional =
|
||||
assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(application.getId());
|
||||
if(assignedApplicationsOptional.isPresent()){
|
||||
response.setAssignedUserId(assignedApplicationsOptional.get().getUserId());
|
||||
UserEntity assignedUser = userService.validateUser(assignedApplicationsOptional.get().getUserId());
|
||||
String assignedUserFirstName = assignedUser.getFirstName() != null ? assignedUser.getFirstName() : "";
|
||||
String assignedUserLastName = assignedUser.getLastName() != null ? assignedUser.getLastName() : "";
|
||||
String userName = String.join(" ", assignedUserFirstName, assignedUserLastName).trim();
|
||||
response.setAssignedUserName(userName);
|
||||
}
|
||||
LocalDateTime callEndDate = application.getCall().getEndDate();
|
||||
response.setCallEndDate(callEndDate);
|
||||
if (application.getCompanyId() != null) {
|
||||
|
||||
Reference in New Issue
Block a user