Resolved conflicts while sync with master
This commit is contained in:
@@ -2132,45 +2132,7 @@ public class ApplicationDao {
|
||||
tableDataByApp.put(appId, flattenedAll);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void sendApplicationSubmissionFailureEmail(EmailLogRequest emailLogRequest){
|
||||
|
||||
Long callId = emailLogRequest.getCallId();
|
||||
CallEntity call = callService.validateCall(callId);
|
||||
HubEntity hub = call.getHub();
|
||||
Long userId = emailLogRequest.getUserId();
|
||||
UserEntity user = userService.validateUser(userId);
|
||||
Long applicationId = emailLogRequest.getApplicatioId();
|
||||
ApplicationEntity applicationEntity = validateApplication(applicationId);
|
||||
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
||||
|
||||
|
||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
||||
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_FAILURE_NOTIFICATION,
|
||||
hub, null);
|
||||
|
||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||
subjectPlaceholders.put("{{call_name}}", call.getName());
|
||||
|
||||
Map<String, String> bodyPlaceholders = new HashMap<>();
|
||||
bodyPlaceholders.put("{{scenario}}",emailLogRequest.getEmailType().getValue());
|
||||
bodyPlaceholders.put("{{call_name}}", call.getName());
|
||||
bodyPlaceholders.put("{{application_id}}", applicationEntity.getId().toString());
|
||||
bodyPlaceholders.put("{{company_name}}", company.getCompanyName());
|
||||
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString());
|
||||
bodyPlaceholders.put("{{user_action_id}}",emailLogRequest.getUserActionId().toString());
|
||||
|
||||
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
||||
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
||||
|
||||
emailLogRequest=emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(),RecipientTypeEnum.PROPERTIES,null,user.getEmail(),user.getId(),applicationEntity.getId(),null,callId);
|
||||
|
||||
emailLogRequest.setRecipientEmails(GepafinConstant.RINALDO_EMAIL);
|
||||
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(GepafinConstant.RINALDO_EMAIL),emailLogRequest);
|
||||
}
|
||||
|
||||
public ApplicationResponse readmitApplication(HttpServletRequest request, Long applicationId) {
|
||||
public ApplicationResponse readmitApplication(HttpServletRequest request, Long applicationId) {
|
||||
log.info("Re-admiting the Application with id : {}", applicationId);
|
||||
|
||||
ApplicationEntity applicationEntity = fetchRejectedApplication(applicationId);
|
||||
@@ -2249,4 +2211,40 @@ public class ApplicationDao {
|
||||
}
|
||||
|
||||
|
||||
public void sendApplicationSubmissionFailureEmail(EmailLogRequest emailLogRequest){
|
||||
|
||||
Long callId = emailLogRequest.getCallId();
|
||||
CallEntity call = callService.validateCall(callId);
|
||||
HubEntity hub = call.getHub();
|
||||
Long userId = emailLogRequest.getUserId();
|
||||
UserEntity user = userService.validateUser(userId);
|
||||
Long applicationId = emailLogRequest.getApplicatioId();
|
||||
ApplicationEntity applicationEntity = validateApplication(applicationId);
|
||||
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
||||
|
||||
|
||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
||||
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_FAILURE_NOTIFICATION,
|
||||
hub, null);
|
||||
|
||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||
subjectPlaceholders.put("{{call_name}}", call.getName());
|
||||
|
||||
Map<String, String> bodyPlaceholders = new HashMap<>();
|
||||
bodyPlaceholders.put("{{scenario}}",emailLogRequest.getEmailType().getValue());
|
||||
bodyPlaceholders.put("{{call_name}}", call.getName());
|
||||
bodyPlaceholders.put("{{application_id}}", applicationEntity.getId().toString());
|
||||
bodyPlaceholders.put("{{company_name}}", company.getCompanyName());
|
||||
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString());
|
||||
bodyPlaceholders.put("{{user_action_id}}",emailLogRequest.getUserActionId().toString());
|
||||
|
||||
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
||||
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
||||
|
||||
emailLogRequest=emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(),RecipientTypeEnum.PROPERTIES,null,user.getEmail(),user.getId(),applicationEntity.getId(),null,callId);
|
||||
|
||||
emailLogRequest.setRecipientEmails(GepafinConstant.RINALDO_EMAIL);
|
||||
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(GepafinConstant.RINALDO_EMAIL),emailLogRequest);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user