updated code
This commit is contained in:
@@ -979,6 +979,7 @@ public class ApplicationDao {
|
|||||||
return getApplicationResponse(applicationEntity);
|
return getApplicationResponse(applicationEntity);
|
||||||
}
|
}
|
||||||
public byte[] downloadApplicationDocumentsAsZip(HttpServletRequest request,Long applicationId) {
|
public byte[] downloadApplicationDocumentsAsZip(HttpServletRequest request,Long applicationId) {
|
||||||
|
ApplicationEntity applicationEntity = validateApplication(applicationId);
|
||||||
AssignedApplicationsEntity assignedApplications = assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(applicationId).orElse(null);
|
AssignedApplicationsEntity assignedApplications = assignedApplicationsRepository.findByApplicationIdAndIsDeletedFalse(applicationId).orElse(null);
|
||||||
|
|
||||||
List<ApplicationFormEntity> applicationForms = applicationFormRepository.findByApplicationId(applicationId);
|
List<ApplicationFormEntity> applicationForms = applicationFormRepository.findByApplicationId(applicationId);
|
||||||
@@ -1014,7 +1015,7 @@ public class ApplicationDao {
|
|||||||
ZipOutputStream zos = new ZipOutputStream(zipOutputStream)) {
|
ZipOutputStream zos = new ZipOutputStream(zipOutputStream)) {
|
||||||
|
|
||||||
for (DocumentEntity document : documents) {
|
for (DocumentEntity document : documents) {
|
||||||
String s3Folder = s3PathConfig.generateDocumentPath(DocumentSourceTypeEnum.APPLICATION, applicationId, 0L);
|
String s3Folder = s3PathConfig.generateDocumentPath(DocumentSourceTypeEnum.APPLICATION, applicationEntity.getCall().getId(), applicationId);
|
||||||
try (InputStream fileInputStream = amazonS3Service.getFile(s3Folder, document.getFilePath())) {
|
try (InputStream fileInputStream = amazonS3Service.getFile(s3Folder, document.getFilePath())) {
|
||||||
String fileName = Utils.extractFileName(document.getFilePath());
|
String fileName = Utils.extractFileName(document.getFilePath());
|
||||||
zos.putNextEntry(new ZipEntry(fileName));
|
zos.putNextEntry(new ZipEntry(fileName));
|
||||||
|
|||||||
Reference in New Issue
Block a user