Updated document logic for special amendment

This commit is contained in:
rajesh
2025-10-23 17:09:04 +05:30
parent 775f5a28b9
commit fdea8c47ce
4 changed files with 28 additions and 3 deletions

View File

@@ -145,12 +145,17 @@ 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()));
replacements = Map.of(
"{call_name}", applicationEntity.getCall().getName(),
"{amount_accepted}", String.valueOf(applicationEntity.getAmountAccepted()),
"{amount_accepted}", amount,
"{pec}", "bandi.gepafin@legalmail.it"
);
documentEntities=documentRepository.findBySourceInAndIsDeletedFalse(List.of(applicationAmendmentRequest.getAmendmentDocumentType(),"MODELLO_AUTOCERTIFICAZIONE","MODELLO_PRIVACY"));
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());

View File

@@ -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;