Updated document logic for special amendment
This commit is contained in:
@@ -145,12 +145,17 @@ public class EmailNotificationDao {
|
|||||||
Map<String, String> replacements=new HashMap<>();
|
Map<String, String> replacements=new HashMap<>();
|
||||||
List<DocumentEntity> documentEntities=new ArrayList<>();
|
List<DocumentEntity> documentEntities=new ArrayList<>();
|
||||||
if(systemEmailTemplateResponse.getEmailScenario().equals(EmailScenarioTypeEnum.SPECIAL_APPLICATION_AMENDMENT_REQUESTED)) {
|
if(systemEmailTemplateResponse.getEmailScenario().equals(EmailScenarioTypeEnum.SPECIAL_APPLICATION_AMENDMENT_REQUESTED)) {
|
||||||
|
String amount=Utils.convertToItalianFormat(String.valueOf(applicationEntity.getAmountAccepted()));
|
||||||
replacements = Map.of(
|
replacements = Map.of(
|
||||||
"{call_name}", applicationEntity.getCall().getName(),
|
"{call_name}", applicationEntity.getCall().getName(),
|
||||||
"{amount_accepted}", String.valueOf(applicationEntity.getAmountAccepted()),
|
"{amount_accepted}", amount,
|
||||||
"{pec}", "bandi.gepafin@legalmail.it"
|
"{pec}", "bandi.gepafin@legalmail.it"
|
||||||
);
|
);
|
||||||
|
if(Boolean.TRUE.equals(AmendmentDocumentTypeEnum.ALTRE_GARANZIE.getValue().equals(applicationAmendmentRequest.getAmendmentDocumentType()))){
|
||||||
documentEntities=documentRepository.findBySourceInAndIsDeletedFalse(List.of(applicationAmendmentRequest.getAmendmentDocumentType(),"MODELLO_AUTOCERTIFICAZIONE","MODELLO_PRIVACY"));
|
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))) {
|
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());
|
List<Long> documentIds=applicationDao.validateDocumentIds(applicationAmendmentRequest.getAmendmentInitialDocument());
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@@ -44,7 +46,7 @@ public class S3DocxProcessor {
|
|||||||
// Extract bucket & key from URL
|
// Extract bucket & key from URL
|
||||||
AmazonS3URI s3Uri = new AmazonS3URI(s3Url);
|
AmazonS3URI s3Uri = new AmazonS3URI(s3Url);
|
||||||
String bucket = s3Uri.getBucket();
|
String bucket = s3Uri.getBucket();
|
||||||
String key = s3Uri.getKey();
|
String key = URLDecoder.decode(s3Uri.getKey(), StandardCharsets.UTF_8);
|
||||||
try (S3Object s3Object = s3Client.getObject(bucket, key);
|
try (S3Object s3Object = s3Client.getObject(bucket, key);
|
||||||
InputStream originalStream = new BufferedInputStream(s3Object.getObjectContent())) {
|
InputStream originalStream = new BufferedInputStream(s3Object.getObjectContent())) {
|
||||||
byte[] updatedBytes=null;
|
byte[] updatedBytes=null;
|
||||||
|
|||||||
@@ -3085,4 +3085,7 @@
|
|||||||
<sqlFile dbms="postgresql" path="db/dump/update_system_email_template_of_application_rejected_17_10_2025.sql"/>
|
<sqlFile dbms="postgresql" path="db/dump/update_system_email_template_of_application_rejected_17_10_2025.sql"/>
|
||||||
</changeSet>
|
</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>
|
</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