Resolved conflict
This commit is contained in:
@@ -1846,8 +1846,13 @@ public class ApplicationAmendmentRequestDao {
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,Translator.toLocale(GepafinConstant.INVALID_APPLICATION_STATUS));
|
||||
}
|
||||
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = new ApplicationAmendmentRequestEntity();
|
||||
if(Boolean.TRUE.equals(applicationAmendmentRequest.getAmendmentDocumentType().equals(AmendmentDocumentTypeEnum.ALTRE_GARANZIE))) {
|
||||
applicationAmendmentRequestEntity.setResponseDays(20l);
|
||||
applicationAmendmentRequestEntity.setEndDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()).plusDays(20));
|
||||
}
|
||||
else {
|
||||
applicationAmendmentRequestEntity.setResponseDays(10l);
|
||||
}
|
||||
applicationAmendmentRequestEntity.setEndDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()).plusDays(applicationAmendmentRequestEntity.getResponseDays()));
|
||||
applicationAmendmentRequestEntity.setIsEmail(Boolean.TRUE);
|
||||
applicationAmendmentRequestEntity.setIsNotification(Boolean.FALSE);
|
||||
applicationAmendmentRequestEntity.setStartDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
||||
|
||||
@@ -1235,6 +1235,7 @@ public class ApplicationDao {
|
||||
emailLogRequest.setRecipientType(RecipientTypeEnum.BENEFICIARY);
|
||||
|
||||
if(Boolean.TRUE.equals(hub.getUniqueUuid().equals(defaultHubUuid))){
|
||||
emailLogRequest.setRecipientType(RecipientTypeEnum.APPLICATION_PEC);
|
||||
email=applicationEntity.getPecEmail();
|
||||
}else {
|
||||
email = userEntity.getBeneficiary().getEmail();
|
||||
@@ -1242,6 +1243,12 @@ public class ApplicationDao {
|
||||
emailLogRequest.setRecipientId(userEntity.getBeneficiary().getId());
|
||||
}
|
||||
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email),emailLogRequest);
|
||||
if (Boolean.TRUE.equals(hub.getUniqueUuid().equals(defaultHubUuid)) && userEntity.getBeneficiary() != null) {
|
||||
emailLogRequest.setRecipientType(RecipientTypeEnum.BENEFICIARY);
|
||||
email = userEntity.getBeneficiary().getEmail();
|
||||
emailLogRequest.setRecipientId(userEntity.getBeneficiary().getId());
|
||||
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email),emailLogRequest);
|
||||
}
|
||||
List<String> recipientEmails = new ArrayList<>();
|
||||
// recipientEmails.add(email);
|
||||
String companyEmail = userWithCompany.getEmail();
|
||||
|
||||
@@ -145,12 +145,23 @@ public class EmailNotificationDao {
|
||||
Map<String, String> replacements=new HashMap<>();
|
||||
List<DocumentEntity> documentEntities=new ArrayList<>();
|
||||
if(systemEmailTemplateResponse.getEmailScenario().equals(EmailScenarioTypeEnum.SPECIAL_APPLICATION_AMENDMENT_REQUESTED)) {
|
||||
String amount=Utils.convertToItalianFormat(String.valueOf(applicationEntity.getAmountAccepted()));
|
||||
String protocolNumber=applicationEntity.getProtocol().getExternalProtocolNumber();
|
||||
if(protocolNumber==null){
|
||||
protocolNumber= String.valueOf(applicationEntity.getProtocol().getProtocolNumber());
|
||||
}
|
||||
replacements = Map.of(
|
||||
"{call_name}", applicationEntity.getCall().getName(),
|
||||
"{amount_accepted}", String.valueOf(applicationEntity.getAmountAccepted()),
|
||||
"{pec}", "bandi.gepafin@legalmail.it"
|
||||
"{amount_accepted}", amount,
|
||||
"{pec}", "bandi.gepafin@legalmail.it",
|
||||
"{company_name}", company.getCompanyName(),
|
||||
"{protocol_number}", protocolNumber
|
||||
);
|
||||
if(Boolean.TRUE.equals(AmendmentDocumentTypeEnum.ALTRE_GARANZIE.getValue().equals(applicationAmendmentRequest.getAmendmentDocumentType()))){
|
||||
documentEntities=documentRepository.findBySourceInAndIsDeletedFalse(List.of(applicationAmendmentRequest.getAmendmentDocumentType(),"MODELLO_AUTOCERTIFICAZIONE","MODELLO_PRIVACY"));
|
||||
}else {
|
||||
documentEntities = documentRepository.findBySourceInAndIsDeletedFalse(List.of(applicationAmendmentRequest.getAmendmentDocumentType()));
|
||||
}
|
||||
}
|
||||
if(Boolean.TRUE.equals(userEntity.getHub().getUniqueUuid().equals(defaultHubUuid)) && Boolean.TRUE.equals(systemEmailTemplateResponse.getEmailScenario().equals(EmailScenarioTypeEnum.APPLICATION_AMENDMENT_REQUESTED))) {
|
||||
List<Long> documentIds=applicationDao.validateDocumentIds(applicationAmendmentRequest.getAmendmentInitialDocument());
|
||||
@@ -216,11 +227,20 @@ public class EmailNotificationDao {
|
||||
|
||||
if (userEntity.getBeneficiary().getEmail() != null) {
|
||||
String beneficiaryEmail = null;
|
||||
RecipientTypeEnum recipientTypeEnum=RecipientTypeEnum.BENEFICIARY;
|
||||
if (Boolean.TRUE.equals(userEntity.getHub().getUniqueUuid().equals(defaultHubUuid))){
|
||||
recipientTypeEnum=RecipientTypeEnum.APPLICATION_PEC;
|
||||
beneficiaryEmail=applicationEntity.getPecEmail();
|
||||
}else {
|
||||
beneficiaryEmail=userEntity.getBeneficiary().getEmail();
|
||||
}
|
||||
EmailLogRequest emailLogRequest = emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(), recipientTypeEnum,userEntity.getBeneficiary().getId() ,
|
||||
beneficiaryEmail, userEntity.getId(), applicationEntity.getId(), amendmentId, applicationEntity.getCall().getId());
|
||||
emailLogRequest.setAttachments(attachmentRequests);
|
||||
sendMail(applicationEntity.getHubId(), subject, body, List.of(beneficiaryEmail), emailLogRequest);
|
||||
}
|
||||
if (Boolean.TRUE.equals(userEntity.getHub().getUniqueUuid().equals(defaultHubUuid)) && userEntity.getBeneficiary() != null) {
|
||||
String beneficiaryEmail = userEntity.getBeneficiary().getEmail();
|
||||
EmailLogRequest emailLogRequest = emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(), RecipientTypeEnum.BENEFICIARY, userEntity.getBeneficiary().getId(),
|
||||
beneficiaryEmail, userEntity.getId(), applicationEntity.getId(), amendmentId, applicationEntity.getCall().getId());
|
||||
emailLogRequest.setAttachments(attachmentRequests);
|
||||
|
||||
@@ -8,7 +8,8 @@ public enum RecipientTypeEnum {
|
||||
USER("USER"),
|
||||
COMPANY("COMPANY"),
|
||||
PROPERTIES("PROPERTIES"),
|
||||
INSTRUCTOR("INSTRUCTOR");
|
||||
INSTRUCTOR("INSTRUCTOR"),
|
||||
APPLICATION_PEC("APPLICATION_PEC");
|
||||
|
||||
private String value;
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URI;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
@@ -44,7 +46,7 @@ public class S3DocxProcessor {
|
||||
// Extract bucket & key from URL
|
||||
AmazonS3URI s3Uri = new AmazonS3URI(s3Url);
|
||||
String bucket = s3Uri.getBucket();
|
||||
String key = s3Uri.getKey();
|
||||
String key = URLDecoder.decode(s3Uri.getKey(), StandardCharsets.UTF_8);
|
||||
try (S3Object s3Object = s3Client.getObject(bucket, key);
|
||||
InputStream originalStream = new BufferedInputStream(s3Object.getObjectContent())) {
|
||||
byte[] updatedBytes=null;
|
||||
|
||||
@@ -3097,4 +3097,7 @@
|
||||
<column name="document_attachment_id" type="TEXT"></column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
<changeSet id="23-10-2025_RK_151527" author="Rajesh Khore">
|
||||
<sqlFile dbms="postgresql" path="db/dump/update_document_for_special_amendment_23-10-2025.sql"/>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
UPDATE gepafin_schema."document"
|
||||
SET file_name='lettera di accettazione esito delibera – 1.docx', file_path='https://mementoresources.s3.amazonaws.com/gepafin/staging/template/lettera%20di%20accettazione%20esito%20delibera%20%E2%80%93%201.docx'
|
||||
WHERE "source"='NESSUNA_GARANZIA';
|
||||
|
||||
UPDATE gepafin_schema."document"
|
||||
SET file_name='lettera di accettazione esito delibera – 2.docx', file_path='https://mementoresources.s3.amazonaws.com/gepafin/staging/template/lettera%20di%20accettazione%20esito%20delibera%20%E2%80%93%202.docx'
|
||||
WHERE "source"='GARANZIA_MCC';
|
||||
|
||||
UPDATE gepafin_schema."document"
|
||||
SET file_name='lettera di accettazione esito delibera – 3.docx', file_path='https://mementoresources.s3.amazonaws.com/gepafin/staging/template/lettera%20di%20accettazione%20esito%20delibera%20%E2%80%93%203.docx'
|
||||
WHERE "source"='MCC_START_UP';
|
||||
|
||||
UPDATE gepafin_schema."document"
|
||||
SET file_name='lettera di accettazione esito delibera – 4.docx', file_path='https://mementoresources.s3.amazonaws.com/gepafin/staging/template/lettera%20di%20accettazione%20esito%20delibera%20%E2%80%93%204.docx'
|
||||
WHERE "source"='ALTRE_GARANZIE';
|
||||
Reference in New Issue
Block a user