Updated response of communication API
This commit is contained in:
@@ -2623,7 +2623,7 @@ public class ApplicationEvaluationDao {
|
||||
|
||||
application.setStatus(ApplicationStatusForEvaluation.TECHNICAL_EVALUATION_REJECTED.getValue());
|
||||
log.info("Application status updated to {} for applicationId: {}", ApplicationStatusForEvaluation.TECHNICAL_EVALUATION_REJECTED, application.getId());
|
||||
emailNotificationDao.sendMailForApplicationTechnicalEvaluationRejected(application, hub, existingEntity,applicationRequest.getEmailJson());
|
||||
emailNotificationDao.sendMailForApplicationTechnicalEvaluationRejected(application, hub, existingEntity);
|
||||
application.setDateRejected(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
||||
application.setEmailJson(Utils.convertMapIntoJsonString(applicationRequest.getEmailJson()));
|
||||
emailSendResponse = emailDao.buildEmailSendResponseFromRequest(request);
|
||||
|
||||
@@ -1144,10 +1144,9 @@ public class AppointmentDao {
|
||||
richiestaCliente.setNota(requestNota);
|
||||
richiestaCliente.setDurataMesiFinanziamento(createAppointmentRequest.getDurataMesiFinanziamento());
|
||||
richiestaCliente.setImportoBreveTermine(createAppointmentRequest.getImportoBreveTermine());
|
||||
richiestaCliente.setDataAppuntamento(createAppointmentRequest.getDataAppuntamento());
|
||||
richiestaClienteList.add(richiestaCliente);
|
||||
}
|
||||
|
||||
input.setDataAppuntamento(createAppointmentRequest.getDataAppuntamento());
|
||||
input.setRichiestaCliente(richiestaClienteList);
|
||||
appointmentCreationRequest.setInput(input);
|
||||
return appointmentCreationRequest;
|
||||
|
||||
@@ -120,11 +120,17 @@ public class CommunicationDao {
|
||||
public ApplicationAmendmentResponse getAmendmentComments(Long amendmentId) {
|
||||
|
||||
ApplicationAmendmentRequestEntity amendmentData = applicationAmendmentRequestService.validateApplicationAmendmentRequest(amendmentId);
|
||||
List<CommunicationResponseBean> commentsList = communicationRepository.findCommentListDetailsByAmendmentId(amendmentId);
|
||||
List<CommunicationEntity> commentsList = communicationRepository.findByApplicationAmendmentRequestIdAndIsDeletedFalse(amendmentId);
|
||||
if (commentsList == null) {
|
||||
throw new CustomValidationException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.COMMENT_NOT_FOUND));
|
||||
}
|
||||
return new ApplicationAmendmentResponse(amendmentData, commentsList);
|
||||
List<CommunicationResponseBean> communicationResponseBeans=new ArrayList<>();
|
||||
for(CommunicationEntity communicationEntity:commentsList){
|
||||
List<DocumentResponseBean> communicationDocumentBeans=getDocumentResponseBean(communicationEntity);
|
||||
CommunicationResponseBean communicationResponseBean=convertToCommunicationResponseBean(communicationEntity,communicationDocumentBeans);
|
||||
communicationResponseBeans.add(communicationResponseBean);
|
||||
}
|
||||
return new ApplicationAmendmentResponse(amendmentData, communicationResponseBeans);
|
||||
}
|
||||
|
||||
public CommunicationResponseBean updateAmendmentComment(CommunicationRequestBean communicationRequestBean, Long amendmentId, Long commentId) {
|
||||
|
||||
@@ -429,28 +429,36 @@ public class EmailNotificationDao {
|
||||
throw new IllegalArgumentException("Failed to parse email configuration JSON", e);
|
||||
}
|
||||
}
|
||||
public void sendMailForApplicationTechnicalEvaluationRejected(ApplicationEntity applicationEntity,HubEntity hub,ApplicationEvaluationEntity applicationEvaluationEntity,Map<String, Object> emailJson) {
|
||||
|
||||
HubEntity hubEntity = hubService.valdateHub(applicationEntity.getHubId());
|
||||
SystemEmailTemplateResponse systemEmailTemplateResponse=new SystemEmailTemplateResponse();
|
||||
systemEmailTemplateResponse.setSubject((String) emailJson.get("subject"));
|
||||
systemEmailTemplateResponse.setHtmlContent((String) emailJson.get("message"));
|
||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
||||
subjectPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
|
||||
subjectPlaceholders.put("{{company_name}}", company.getCompanyName());
|
||||
public void sendMailForApplicationTechnicalEvaluationRejected(ApplicationEntity applicationEntity,HubEntity hub,ApplicationEvaluationEntity applicationEvaluationEntity) {
|
||||
|
||||
Map<String, String> bodyPlaceholders = prepareEmailPlaceholdersForTechnicalEvaluationRejected(applicationEntity,hub,applicationEvaluationEntity);
|
||||
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
||||
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
||||
SystemEmailTemplateResponse systemEmailTemplateResponse1=new SystemEmailTemplateResponse();
|
||||
systemEmailTemplateResponse1.setSubject(subject);
|
||||
systemEmailTemplateResponse1.setHtmlContent(body);
|
||||
systemEmailTemplateResponse1.setEmailScenario(EmailScenarioTypeEnum.APPLICATION_TECHNICAL_EVALUATION_REJECTED);
|
||||
EmailContentResponse emailContentResponse=new EmailContentResponse(subject,body,systemEmailTemplateResponse1);
|
||||
UserEntity userEntity = userService.validateUser(applicationEntity.getUserId());
|
||||
sendEmails(applicationEntity, userEntity, null,null,emailContentResponse.getSystemEmailTemplateResponse(),emailContentResponse.getSubject(),emailContentResponse.getBody());
|
||||
|
||||
sendEmail(applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.INADMISSIBILITY_NOTIFICATION_DUE_TO_TECHNICAL_EVALUATION_FAILURE, bodyPlaceholders, null,
|
||||
null);
|
||||
}
|
||||
|
||||
// public void sendMailForApplicationTechnicalEvaluationRejected(ApplicationEntity applicationEntity,HubEntity hub,ApplicationEvaluationEntity applicationEvaluationEntity,Map<String, Object> emailJson) {
|
||||
//
|
||||
// HubEntity hubEntity = hubService.valdateHub(applicationEntity.getHubId());
|
||||
// SystemEmailTemplateResponse systemEmailTemplateResponse=new SystemEmailTemplateResponse();
|
||||
// systemEmailTemplateResponse.setSubject((String) emailJson.get("subject"));
|
||||
// systemEmailTemplateResponse.setHtmlContent((String) emailJson.get("message"));
|
||||
// Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||
// CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
||||
// subjectPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
|
||||
// subjectPlaceholders.put("{{company_name}}", company.getCompanyName());
|
||||
// Map<String, String> bodyPlaceholders = prepareEmailPlaceholdersForTechnicalEvaluationRejected(applicationEntity,hub,applicationEvaluationEntity);
|
||||
// String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
||||
// String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
||||
// SystemEmailTemplateResponse systemEmailTemplateResponse1=new SystemEmailTemplateResponse();
|
||||
// systemEmailTemplateResponse1.setSubject(subject);
|
||||
// systemEmailTemplateResponse1.setHtmlContent(body);
|
||||
// systemEmailTemplateResponse1.setEmailScenario(EmailScenarioTypeEnum.APPLICATION_TECHNICAL_EVALUATION_REJECTED);
|
||||
// EmailContentResponse emailContentResponse=new EmailContentResponse(subject,body,systemEmailTemplateResponse1);
|
||||
// UserEntity userEntity = userService.validateUser(applicationEntity.getUserId());
|
||||
// sendEmails(applicationEntity, userEntity, null,null,emailContentResponse.getSystemEmailTemplateResponse(),emailContentResponse.getSubject(),emailContentResponse.getBody());
|
||||
//
|
||||
// }
|
||||
public Map<String, String> prepareEmailPlaceholdersForTechnicalEvaluationRejected(ApplicationEntity applicationEntity,HubEntity hub,ApplicationEvaluationEntity applicationEvaluationEntity) {
|
||||
Map<String, String> bodyPlaceholders = new HashMap<>();
|
||||
bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
|
||||
|
||||
@@ -15,6 +15,7 @@ public class AppointmentCreationRequest {
|
||||
private Long id;
|
||||
private String ndg;
|
||||
private List<RichiestaCliente> richiestaCliente;
|
||||
private LocalDateTime dataAppuntamento;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -11,10 +11,10 @@ import java.util.Optional;
|
||||
|
||||
public interface CommunicationRepository extends JpaRepository<CommunicationEntity, Long> {
|
||||
|
||||
@Query("SELECT new net.gepafin.tendermanagement.model.response.CommunicationResponseBean( " + "c.commentedDate, c.communicationComment, c.communicationTitle, c.createdDate, c" +
|
||||
".updatedDate, " + "c.applicationAmendmentRequest.id, c.senderUserId, c.receiverUserId, c.id " + ") " + "FROM CommunicationEntity c " + "WHERE c" +
|
||||
".applicationAmendmentRequest.id = :amendmentId AND c.isDeleted = false")
|
||||
List<CommunicationResponseBean> findCommentListDetailsByAmendmentId(@Param("amendmentId") Long amendmentId);
|
||||
// @Query("SELECT new net.gepafin.tendermanagement.model.response.CommunicationResponseBean( " + "c.commentedDate, c.communicationComment, c.communicationTitle, c.createdDate, c" +
|
||||
// ".updatedDate, " + "c.applicationAmendmentRequest.id, c.senderUserId, c.receiverUserId, c.id " + ") " + "FROM CommunicationEntity c " + "WHERE c" +
|
||||
// ".applicationAmendmentRequest.id = :amendmentId AND c.isDeleted = false")
|
||||
List<CommunicationEntity> findByApplicationAmendmentRequestIdAndIsDeletedFalse(Long amendmentId);
|
||||
|
||||
Optional<CommunicationEntity> findByIdAndIsDeletedFalse(Long commentId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user