Resolved Conflicts
This commit is contained in:
@@ -186,8 +186,12 @@ public class ApplicationEvaluationDao {
|
||||
List<CallTargetAudienceChecklistEntity> checklistEntities = callTargetAudienceChecklistRepository
|
||||
.findByCallIdAndLookupDataTypeAndIsDeletedFalse(call.getId(), LookUpDataEntity.LookUpDataTypeEnum.CHECKLIST.getValue());
|
||||
List<ApplicationFormEntity> applicationFormEntities = applicationFormRepository.findByApplicationId(entity.getApplicationId());
|
||||
CompanyEntity company=companyService.validateCompany(entity.getAssignedApplicationsEntity().getApplication().getCompanyId());
|
||||
|
||||
setAmendmentDetails(entity,response);
|
||||
|
||||
response.setCompanyVatNumber(company.getVatNumber());
|
||||
response.setCompanyCodiceAteco(company.getCodiceAteco());
|
||||
setCriteriaResponses(entity, response, evaluationCriterias);
|
||||
setChecklistResponses(entity, response, checklistEntities);
|
||||
setFieldResponses(entity, response, applicationFormEntities);
|
||||
@@ -261,27 +265,32 @@ public class ApplicationEvaluationDao {
|
||||
for (EvaluationDocumentRequest doc : docRequest) {
|
||||
EvaluationDocumentResponse evaluationDocResponse = new EvaluationDocumentResponse();
|
||||
if (doc.getFileValue() != null) {
|
||||
Long fileId = Long.valueOf(doc.getFileValue().toString());
|
||||
documentRepository.findByIdAndNotDeleted(fileId).ifPresent(documentEntity -> {
|
||||
DocumentResponseBean documentResponseBean = new DocumentResponseBean();
|
||||
documentResponseBean.setId(documentEntity.getId());
|
||||
documentResponseBean.setName(documentEntity.getFileName());
|
||||
documentResponseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
|
||||
documentResponseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
|
||||
documentResponseBean.setSourceId(documentEntity.getSourceId());
|
||||
documentResponseBean.setFilePath(documentEntity.getFilePath());
|
||||
documentResponseBean.setCreatedDate(documentEntity.getCreatedDate());
|
||||
documentResponseBean.setUpdatedDate(documentEntity.getUpdatedDate());
|
||||
documentResponseBean.setDocumentAttachmentId(documentEntity.getDocumentAttachmentId());
|
||||
evaluationDocResponse.setFileValue(List.of(documentResponseBean));
|
||||
evaluationDocResponse.setNameValue(doc.getNameValue());
|
||||
evaluationDocResponse.setValid(doc.getValid());
|
||||
evaluationDocResponse.setFieldId(doc.getFieldId());
|
||||
});
|
||||
}
|
||||
if (evaluationDocResponse.getFileValue() == null) {
|
||||
continue;
|
||||
if( Boolean.FALSE.equals(doc.getFileValue().isEmpty())) {
|
||||
Long fileId = Long.valueOf(doc.getFileValue().toString());
|
||||
documentRepository.findByIdAndNotDeleted(fileId).ifPresent(documentEntity -> {
|
||||
DocumentResponseBean documentResponseBean = new DocumentResponseBean();
|
||||
documentResponseBean.setId(documentEntity.getId());
|
||||
documentResponseBean.setName(documentEntity.getFileName());
|
||||
documentResponseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
|
||||
documentResponseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
|
||||
documentResponseBean.setSourceId(documentEntity.getSourceId());
|
||||
documentResponseBean.setFilePath(documentEntity.getFilePath());
|
||||
documentResponseBean.setCreatedDate(documentEntity.getCreatedDate());
|
||||
documentResponseBean.setUpdatedDate(documentEntity.getUpdatedDate());
|
||||
documentResponseBean.setDocumentAttachmentId(documentEntity.getDocumentAttachmentId());
|
||||
evaluationDocResponse.setFileValue(List.of(documentResponseBean));
|
||||
});
|
||||
}
|
||||
else {
|
||||
evaluationDocResponse.setFileValue(null);
|
||||
}
|
||||
evaluationDocResponse.setNameValue(doc.getNameValue());
|
||||
evaluationDocResponse.setValid(doc.getValid());
|
||||
evaluationDocResponse.setFieldId(doc.getFieldId());
|
||||
}
|
||||
// if (evaluationDocResponse.getFileValue() == null) {
|
||||
// continue;
|
||||
// }
|
||||
evaluationDocResponses.add(evaluationDocResponse);
|
||||
}
|
||||
response.setEvaluationDocument(evaluationDocResponses);
|
||||
@@ -1150,6 +1159,7 @@ public class ApplicationEvaluationDao {
|
||||
call = callRepository.findCallEntityByApplicationId(applicationId);
|
||||
assignedApplications = assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(applicationId).orElse(null);
|
||||
}
|
||||
CompanyEntity company=companyService.validateCompany(application.getCompanyId());
|
||||
List<EvaluationCriteriaEntity> evaluationCriterias = evaluationCriteriaRepository
|
||||
.findByCallIdAndLookupDataTypeAndIsDeletedFalse(call.getId(), LookUpDataEntity.LookUpDataTypeEnum.EVALUATION_CRITERIA.getValue());
|
||||
List<CallTargetAudienceChecklistEntity> checklistEntities = callTargetAudienceChecklistRepository
|
||||
@@ -1168,6 +1178,8 @@ public class ApplicationEvaluationDao {
|
||||
response.setCallEndDate(callEndDate);
|
||||
response.setNumberOfCheck(call.getNumberOfCheck());
|
||||
response.setAppointmentTemplateId(call.getAppointmentTemplateId());
|
||||
response.setCompanyVatNumber(company.getVatNumber());
|
||||
response.setCompanyCodiceAteco(company.getCodiceAteco());
|
||||
setCriteriaResponses(entity, application.getId(), response, evaluationCriterias);
|
||||
setChecklistResponses(entity, application.getId(), response, checklistEntities);
|
||||
setFileResponses(entity, application.getId(), response, applicationFormEntities);
|
||||
@@ -1963,8 +1975,10 @@ public class ApplicationEvaluationDao {
|
||||
|
||||
for (EvaluationDocumentRequest doc : docRequest) {
|
||||
if (doc.getFileValue() != null) {
|
||||
Long fileId = Long.valueOf(doc.getFileValue());
|
||||
documentService.validateDocument(fileId);
|
||||
if(Boolean.FALSE.equals(doc.getFileValue().isEmpty())) {
|
||||
Long fileId = Long.valueOf(doc.getFileValue());
|
||||
documentService.validateDocument(fileId);
|
||||
}
|
||||
existingDocs.add(doc);
|
||||
}
|
||||
}
|
||||
@@ -2234,6 +2248,7 @@ public class ApplicationEvaluationDao {
|
||||
private ApplicationEvaluationFormResponse processEvaluationForm(ApplicationEvaluationEntity evaluationEntity){
|
||||
|
||||
Object convertedResponse = convertToResponse(evaluationEntity);
|
||||
CompanyEntity company=companyService.validateCompany(evaluationEntity.getAssignedApplicationsEntity().getApplication().getCompanyId());
|
||||
|
||||
ApplicationEvaluationFormResponse response = objectMapper.convertValue(convertedResponse, ApplicationEvaluationFormResponse.class);
|
||||
EvaluationFormEntity evaluationFormEntity = evaluationFormRepository.findByCallIdAndIsDeletedFalse(evaluationEntity.getAssignedApplicationsEntity().getApplication().getCall().getId());
|
||||
@@ -2242,7 +2257,8 @@ public class ApplicationEvaluationDao {
|
||||
if (evaluationFormEntity != null) {
|
||||
response.setApplicationEvaluationFormResponse(convertEvaluationFormToResponse(evaluationFormEntity, evaluationEntity));
|
||||
}
|
||||
|
||||
response.setCompanyVatNumber(company.getVatNumber());
|
||||
response.setCompanyCodiceAteco(company.getCodiceAteco());
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.entities.*;
|
||||
import net.gepafin.tendermanagement.model.request.FieldLabelValuePairRequest;
|
||||
import net.gepafin.tendermanagement.model.response.*;
|
||||
import net.gepafin.tendermanagement.repositories.DocumentRepository;
|
||||
import net.gepafin.tendermanagement.repositories.HubRepository;
|
||||
import net.gepafin.tendermanagement.service.CallService;
|
||||
import net.gepafin.tendermanagement.util.PdfUtils;
|
||||
@@ -54,6 +55,9 @@ public class PdfDao {
|
||||
@Autowired
|
||||
private HubRepository hubRepository;
|
||||
|
||||
@Autowired
|
||||
private DocumentRepository documentRepository;
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(PdfDao.class);
|
||||
|
||||
public byte[] generatePdf(HttpServletRequest request,Long applicationId) {
|
||||
@@ -219,8 +223,10 @@ public class PdfDao {
|
||||
if (fieldValue.trim().equalsIgnoreCase("true")) {
|
||||
// Use images for tick and cross
|
||||
try {
|
||||
DocumentEntity documentEntity = documentRepository.findBySource(GepafinConstant.PDF_TRUE).get(0);
|
||||
|
||||
// img = Image.getInstance("true.jpg"); update code after cherry-pick
|
||||
img = Image.getInstance("https://mementoresources.s3.eu-west-1.amazonaws.com/gepafin/true.png");
|
||||
img = Image.getInstance(documentEntity.getFilePath());
|
||||
} catch (IOException e) {
|
||||
log.error("Error while uploading image for pdf for true");
|
||||
}
|
||||
@@ -238,7 +244,9 @@ public class PdfDao {
|
||||
} else if (fieldValue.trim().equalsIgnoreCase("false")) {
|
||||
// Use images for tick and cross
|
||||
try {
|
||||
img = Image.getInstance("https://mementoresources.s3.eu-west-1.amazonaws.com/gepafin/false.png");
|
||||
DocumentEntity documentEntity = documentRepository.findBySource(GepafinConstant.PDF_FALSE).get(0);
|
||||
|
||||
img = Image.getInstance(documentEntity.getFilePath());
|
||||
} catch (IOException e) {
|
||||
log.error("Error while uploading image for pdf for false");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user