update BuktiPengeluaranBarang
This commit is contained in:
parent
c8d1d80555
commit
d4d9ef1ce8
@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.sql.Timestamp;
|
||||
@ -66,7 +67,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfLabelGizi(noregistrasi, jnsdiet);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null; // Membebaskan memori setelah penggunaan
|
||||
}
|
||||
@ -81,7 +88,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfPermintaanMakanan(idRu, tglAwal, tglAkhir);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
@ -96,8 +109,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfRekapMakanan(idRu, tglAwal, tglAkhir);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -109,8 +128,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportKartuPasien(nocm);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -134,8 +159,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.resepService.exportPdfResepPasien(strukOrder);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -147,8 +178,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportLapBedah(noregis);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -160,8 +197,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportKonsul(noorder);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -201,8 +244,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportUpk(nores);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -215,8 +264,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.verifikasiTagihanSupplierServices.generateVerifikasiTagihanPdf(noverifikasifk);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -230,8 +285,14 @@ public class ReportingController {
|
||||
jasperPrint = this.verifikasiTagihanSupplierServices
|
||||
.generateVerifikasiPembayaranUmumPdf(noverifikasifk);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -245,8 +306,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfLapRekapHarianByDept(deptId, tglAwal, tglAkhir);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -263,8 +330,14 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfLapRekapHarianByRuanganId(deptId, ruangId, tglAwal, tglAkhir);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -276,8 +349,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfPengkajianAwalByNoRes(nores);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -293,8 +372,14 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfRekapPenjamin(tglAwal, tglAkhir, idDept, kelompokPasien);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -310,8 +395,14 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfRekapPenjaminByInstitusiPasien(tglAwal, tglAkhir, idDept, kelompokPasien, institusiPasien);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -327,8 +418,14 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfRekapPenjaminByRanap(tglAwal, tglAkhir, idDept, kelompokPasien);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -344,8 +441,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfPermintaanMakanan(idRu, tglAwal, tglAkhir, jenisDiet, tglLayanan);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -359,8 +462,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfRekapMakanan(idRu, tglAwal, tglAkhir);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -396,8 +505,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfSummaryList(nocm);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -411,8 +526,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfAmprahanTindakan(idRu, tglAwal, tglAkhir);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -427,8 +548,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi, jeniskwitansi, nama_pt, kasir);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -440,8 +567,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfMonitoringUsulan(norec);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -454,8 +587,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfSppb(norec, jnsbrg);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -468,8 +607,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfBuktiLayanan(norec, user);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -481,8 +626,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfBuktiNoLayanFarmasi(norec);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -494,12 +645,19 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfLabelFarmasi(norec);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/lap-tindakan"}, method = {RequestMethod.GET})
|
||||
public void exportPdfLaporanTindakan(
|
||||
@RequestParam("ruanganid") Integer ruanganid,
|
||||
@ -514,8 +672,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfLaporanTindakan(ruanganid, instalasiid, kelasid, unitid, produkid, statusprodukid);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -526,8 +690,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfDKamar();
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -539,8 +709,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfLabelFarmasiNo(norec);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -552,8 +728,14 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfUsulanPermintaanBdJ(norec);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}finally {
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
System.gc();
|
||||
}
|
||||
} finally {
|
||||
jasperPrint = null;
|
||||
}
|
||||
}
|
||||
@ -683,7 +865,18 @@ public class ReportingController {
|
||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiPengeluaranBarang(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
// Gunakan try-with-resources untuk memastikan OutputStream ditutup otomatis, mencegah kebocoran memori
|
||||
try (OutputStream outputStream = response.getOutputStream()) {
|
||||
// Ekspor PDF ke stream
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
|
||||
|
||||
// Panggil garbage collection secara eksplisit setelah pemrosesan untuk membantu mengelola memori (khususnya saat memproses gambar besar)
|
||||
// Catatan: Ini bukan jaminan, tetapi bisa mengurangi risiko OutOfMemoryError
|
||||
System.gc();
|
||||
} catch (Exception e) {
|
||||
// Log error jika diperlukan (opsional, tambahkan logging sesuai kebutuhan aplikasi)
|
||||
throw e; // Rethrow untuk menjaga perilaku asli
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/kartu-pasien-pulang/{noregistrasi}"}, method = {RequestMethod.GET})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user