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,7 +109,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfRekapMakanan(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;
|
||||
}
|
||||
@ -109,7 +128,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportKartuPasien(nocm);
|
||||
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;
|
||||
}
|
||||
@ -134,7 +159,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.resepService.exportPdfResepPasien(strukOrder);
|
||||
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;
|
||||
}
|
||||
@ -147,7 +178,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportLapBedah(noregis);
|
||||
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;
|
||||
}
|
||||
@ -160,7 +197,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportKonsul(noorder);
|
||||
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;
|
||||
}
|
||||
@ -201,7 +244,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printReportUpk(nores);
|
||||
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;
|
||||
}
|
||||
@ -215,7 +264,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.verifikasiTagihanSupplierServices.generateVerifikasiTagihanPdf(noverifikasifk);
|
||||
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;
|
||||
}
|
||||
@ -230,7 +285,13 @@ public class ReportingController {
|
||||
jasperPrint = this.verifikasiTagihanSupplierServices
|
||||
.generateVerifikasiPembayaranUmumPdf(noverifikasifk);
|
||||
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;
|
||||
}
|
||||
@ -245,7 +306,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfLapRekapHarianByDept(deptId, 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;
|
||||
}
|
||||
@ -263,7 +330,13 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfLapRekapHarianByRuanganId(deptId, ruangId, 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;
|
||||
}
|
||||
@ -276,7 +349,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfPengkajianAwalByNoRes(nores);
|
||||
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;
|
||||
}
|
||||
@ -293,7 +372,13 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfRekapPenjamin(tglAwal, tglAkhir, idDept, kelompokPasien);
|
||||
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;
|
||||
}
|
||||
@ -310,7 +395,13 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfRekapPenjaminByInstitusiPasien(tglAwal, tglAkhir, idDept, kelompokPasien, institusiPasien);
|
||||
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;
|
||||
}
|
||||
@ -327,7 +418,13 @@ public class ReportingController {
|
||||
jasperPrint = this.reportingService
|
||||
.printPdfRekapPenjaminByRanap(tglAwal, tglAkhir, idDept, kelompokPasien);
|
||||
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;
|
||||
}
|
||||
@ -344,7 +441,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfPermintaanMakanan(idRu, tglAwal, tglAkhir, jenisDiet, tglLayanan);
|
||||
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;
|
||||
}
|
||||
@ -359,7 +462,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfRekapMakanan(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;
|
||||
}
|
||||
@ -396,7 +505,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfSummaryList(nocm);
|
||||
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;
|
||||
}
|
||||
@ -411,7 +526,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfAmprahanTindakan(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;
|
||||
}
|
||||
@ -427,7 +548,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi, jeniskwitansi, nama_pt, kasir);
|
||||
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;
|
||||
}
|
||||
@ -440,7 +567,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfMonitoringUsulan(norec);
|
||||
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;
|
||||
}
|
||||
@ -454,7 +587,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfSppb(norec, jnsbrg);
|
||||
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;
|
||||
}
|
||||
@ -468,7 +607,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfBuktiLayanan(norec, user);
|
||||
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;
|
||||
}
|
||||
@ -481,7 +626,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfBuktiNoLayanFarmasi(norec);
|
||||
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;
|
||||
}
|
||||
@ -494,12 +645,19 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfLabelFarmasi(norec);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/lap-tindakan"}, method = {RequestMethod.GET})
|
||||
public void exportPdfLaporanTindakan(
|
||||
@RequestParam("ruanganid") Integer ruanganid,
|
||||
@ -514,7 +672,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.printPdfLaporanTindakan(ruanganid, instalasiid, kelasid, unitid, produkid, statusprodukid);
|
||||
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;
|
||||
}
|
||||
@ -526,7 +690,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfDKamar();
|
||||
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;
|
||||
}
|
||||
@ -539,7 +709,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfLabelFarmasiNo(norec);
|
||||
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;
|
||||
}
|
||||
@ -552,7 +728,13 @@ public class ReportingController {
|
||||
try {
|
||||
jasperPrint = this.reportingService.exportPdfUsulanPermintaanBdJ(norec);
|
||||
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;
|
||||
}
|
||||
@ -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