Skip to content

Commit

Permalink
BUG sui mandati collegati
Browse files Browse the repository at this point in the history
  • Loading branch information
mspasiano committed Jan 28, 2016
1 parent 9b02314 commit a9a4f81
Showing 1 changed file with 16 additions and 14 deletions.
Expand Up @@ -248,21 +248,23 @@ protected void executeSign(ActionContext actioncontext, List<StatoTrasmissione>
childs.addAll(allegati);
}
//Eseguo il merge dei documenti
PDFMergerUtility ut = new PDFMergerUtility();
ByteArrayOutputStream out = new ByteArrayOutputStream();
ut.setDestinationStream(out);
ut.addSource(documentiContabiliService.getStreamDocumento((V_mandato_reversaleBulk) statoTrasmissione));
for (Document document : childs) {
ut.addSource(document.getContentStream().getStream());
if (!childs.isEmpty()) {
PDFMergerUtility ut = new PDFMergerUtility();
ByteArrayOutputStream out = new ByteArrayOutputStream();
ut.setDestinationStream(out);
ut.addSource(documentiContabiliService.getStreamDocumento((V_mandato_reversaleBulk) statoTrasmissione));
for (Document document : childs) {
ut.addSource(document.getContentStream().getStream());
}
try {
ut.mergeDocuments();
} catch (IOException _ex) {
throw new ApplicationException("\nAl mandato n."+ statoTrasmissione.getPg_documento_cont()+ " risulta allegato un documento non in formato PDF" +
", pertanto è stato escluso dalla selezione.");
}
cmisService.restoreSimpleDocument((V_mandato_reversaleBulk)statoTrasmissione, new ByteArrayInputStream(out.toByteArray()), "application/pdf", "Mandato n. "
+ statoTrasmissione.getPg_documento_cont() + ".pdf", cmisPath);
}
try {
ut.mergeDocuments();
} catch (IOException _ex) {
throw new ApplicationException("\nAl mandato n."+ statoTrasmissione.getPg_documento_cont()+ " risulta allegato un documento non in formato PDF" +
", pertanto è stato escluso dalla selezione.");
}
cmisService.restoreSimpleDocument((V_mandato_reversaleBulk)statoTrasmissione, new ByteArrayInputStream(out.toByteArray()), "application/pdf", "Mandato n. "
+ statoTrasmissione.getPg_documento_cont() + ".pdf", cmisPath);
}
} catch(ApplicationException _ex) {
iterator.remove();
Expand Down

0 comments on commit a9a4f81

Please sign in to comment.