use of org.estatio.module.capex.app.paymentline.PaymentLineForExcelExportV1 in project estatio by estatio.
the class PaymentBatchManager method downloadExcelExportForCompletedBatches.
@Action(semantics = SemanticsOf.SAFE, commandPersistence = CommandPersistence.NOT_PERSISTED, publishing = Publishing.DISABLED)
public Blob downloadExcelExportForCompletedBatches(@Nullable final String documentName, final LocalDate startExecutionDate, final LocalDate endExecutionDate) {
List<PaymentLineForExcelExportV1> lineVms = new ArrayList<>();
List<PaymentBatch> batchesToExport = getCompletedBatches().stream().filter(x -> x.getRequestedExecutionDate().toLocalDate().isAfter(startExecutionDate.minusDays(1)) && x.getRequestedExecutionDate().toLocalDate().isBefore(endExecutionDate.plusDays(1))).collect(Collectors.toList());
for (PaymentBatch batch : batchesToExport) {
lineVms.addAll(batch.paymentLinesForExcelExport());
}
String name = documentName != null ? documentName.concat(".xlsx") : "export.xlsx";
return excelService.toExcel(lineVms, PaymentLineForExcelExportV1.class, "export", name);
}
use of org.estatio.module.capex.app.paymentline.PaymentLineForExcelExportV1 in project estatio by estatio.
the class PaymentBatchManager method downloadExcelExportForNewBatches.
@Action(semantics = SemanticsOf.SAFE, commandPersistence = CommandPersistence.NOT_PERSISTED, publishing = Publishing.DISABLED)
public Blob downloadExcelExportForNewBatches(@Nullable final String documentName, @Nullable final List<PaymentBatch> newPaymentBatches) {
List<PaymentLineForExcelExportV1> lineVms = new ArrayList<>();
for (PaymentBatch batch : newPaymentBatches) {
lineVms.addAll(batch.paymentLinesForExcelExport());
}
String name = documentName != null ? documentName.concat(".xlsx") : "export.xlsx";
return excelService.toExcel(lineVms, PaymentLineForExcelExportV1.class, "export", name);
}
Aggregations