update BuktiPengeluaranBarang

This commit is contained in:
ridwan 2025-12-02 15:42:30 +07:00
parent c8d1d80555
commit d4d9ef1ce8

View File

@ -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;
}
}
@ -211,12 +260,18 @@ public class ReportingController {
public void exportVerifikasiTagihanSupplier(
@PathVariable("noverifikasifk") String noverifikasifk, ModelAndView mv,
HttpServletResponse response, HttpServletRequest req) throws Exception {
JasperPrint jasperPrint = null;
JasperPrint jasperPrint = null;
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,9 +372,15 @@ public class ReportingController {
jasperPrint = this.reportingService
.printPdfRekapPenjamin(tglAwal, tglAkhir, idDept, kelompokPasien);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
// 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,21 +548,33 @@ 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;
}
}
@RequestMapping(value = {"/usulan/{norec}"}, method = {RequestMethod.GET})
public void exportMonitoringUsulan(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
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;
}
}
@ -449,13 +582,19 @@ public class ReportingController {
@RequestMapping(value = {"/sppb/{norec}"}, method = {RequestMethod.GET})
public void exportSppb(@PathVariable("norec") String norec,
@RequestParam(value = "jnsbrg", required = false) String jnsbrg,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
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;
}
}
@ -463,43 +602,62 @@ public class ReportingController {
@RequestMapping(value = {"/bukti-layanan-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiLayanan(@PathVariable("norec") String norec,
@RequestParam(value = "user", required = false, defaultValue = "") String user,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
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;
}
}
@RequestMapping(value = {"/bukti-nonlayanan-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiNoLayanFarmasi(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
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;
}
}
@RequestMapping(value = {"/label-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfLabelFarmasi(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
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,41 +690,59 @@ 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;
}
}
@RequestMapping(value = {"/label-farmasi-nonlayanan/{norec}"}, method = {RequestMethod.GET})
public void exportPdfLabelFarmasiNo(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
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;
}
}
@RequestMapping(value = {"/usulan-permintaan-barang-dan-jasa/{norec}"}, method = {RequestMethod.GET})
public void exportPdfUsulanPermintaanBdJ(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
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;
}
}
@RequestMapping(value = {"/triase-igd/{norec}"}, method = {RequestMethod.GET})
public void exportPdfTriaseIGD(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfTriaseIGD(norec);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
@ -568,7 +750,7 @@ public class ReportingController {
@RequestMapping(value = {"/daftar-triase-igd/{norec}"}, method = {RequestMethod.GET})
public void exportPdfDaftarTriaseIGD(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfDaftarTriaseIGD(norec);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
@ -615,7 +797,7 @@ public class ReportingController {
@RequestMapping(value = {"/bukti-tagihan-piutang/{noposting}"}, method = {RequestMethod.GET})
public void exportPdfTagihanPiutang(@PathVariable("noposting") String norec,
@RequestParam(value = "PrintBy", required = false, defaultValue = "") String PrintBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfTagihanPiutang(norec, PrintBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
@ -623,7 +805,7 @@ public class ReportingController {
@RequestMapping(value = {"/surat-collecting-piutang/{noposting}"}, method = {RequestMethod.GET})
public void exportPdfSuratCollectingPiutang(@PathVariable("noposting") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfSuratCollectingPiutang(norec);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
@ -632,12 +814,12 @@ public class ReportingController {
@RequestMapping(value = {"/kwitansi-collecting-piutang/{noposting}"}, method = {RequestMethod.GET})
public void exportPdfKwitansiCollectingPiutang(@PathVariable("noposting") String norec,
@RequestParam(value = "PrintBy", required = false, defaultValue = "") String PrintBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfKwitansiCollectingPiutang(norec, PrintBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
jasperPrint = this.reportingService.exportPdfKwitansiCollectingPiutang(norec, PrintBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
@ -658,21 +840,6 @@ public class ReportingController {
@RequestMapping(value = {"/daftar-penerima-barang-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfdaftarPenerimaBarangFarmasi(@PathVariable("norec") String norec,
@RequestParam(value = "idMenyerahkan", required = false, defaultValue = "") Integer idMenyerahkan,
@RequestParam(value = "idMengetahui", required = false, defaultValue = "") Integer idMengetahui,
@RequestParam(value = "idMenerima", required = false, defaultValue = "") Integer idMenerima,
@RequestParam(value = "jabatanMenyerahkan", required = false, defaultValue = "") String jabatanMenyerahkan,
@RequestParam(value = "jabatanMengetahui", required = false, defaultValue = "") String jabatanMengetahui,
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfdaftarPenerimaBarangFarmasi(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/bukti-pengeluaran-barang/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiPengeluaranBarang(@PathVariable("norec") String norec,
@RequestParam(value = "idMenyerahkan", required = false, defaultValue = "") Integer idMenyerahkan,
@RequestParam(value = "idMengetahui", required = false, defaultValue = "") Integer idMengetahui,
@RequestParam(value = "idMenerima", required = false, defaultValue = "") Integer idMenerima,
@ -681,31 +848,13 @@ public class ReportingController {
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiPengeluaranBarang(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
JasperPrint jasperPrint = this.reportingService.exportPdfdaftarPenerimaBarangFarmasi(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/kartu-pasien-pulang/{noregistrasi}"}, method = {RequestMethod.GET})
public void exportPdfKartuPasienPulang(@PathVariable("noregistrasi") String noregistrasi,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfKartuPasienPulang(noregistrasi, printBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/resume-medis"}, method = {RequestMethod.GET})
public void exportPdfResumeeMedis(@RequestParam("norec") String norec,
@RequestParam("nocm") String nocm,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfResumeeMedis(norec, nocm);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/bukti-penerimaan-barang-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiPenerimaanBarangFarmasi(@PathVariable("norec") String norec,
@RequestMapping(value = {"/bukti-pengeluaran-barang/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiPengeluaranBarang(@PathVariable("norec") String norec,
@RequestParam(value = "idMenyerahkan", required = false, defaultValue = "") Integer idMenyerahkan,
@RequestParam(value = "idMengetahui", required = false, defaultValue = "") Integer idMengetahui,
@RequestParam(value = "idMenerima", required = false, defaultValue = "") Integer idMenerima,
@ -714,6 +863,50 @@ public class ReportingController {
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiPengeluaranBarang(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
response.setContentType("application/pdf");
// 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})
public void exportPdfKartuPasienPulang(@PathVariable("noregistrasi") String noregistrasi,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfKartuPasienPulang(noregistrasi, printBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/resume-medis"}, method = {RequestMethod.GET})
public void exportPdfResumeeMedis(@RequestParam("norec") String norec,
@RequestParam("nocm") String nocm,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfResumeeMedis(norec, nocm);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/bukti-penerimaan-barang-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiPenerimaanBarangFarmasi(@PathVariable("norec") String norec,
@RequestParam(value = "idMenyerahkan", required = false, defaultValue = "") Integer idMenyerahkan,
@RequestParam(value = "idMengetahui", required = false, defaultValue = "") Integer idMengetahui,
@RequestParam(value = "idMenerima", required = false, defaultValue = "") Integer idMenerima,
@RequestParam(value = "jabatanMenyerahkan", required = false, defaultValue = "") String jabatanMenyerahkan,
@RequestParam(value = "jabatanMengetahui", required = false, defaultValue = "") String jabatanMengetahui,
@RequestParam(value = "jabatanMenerima", required = false, defaultValue = "") String jabatanMenerima,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiPenerimaanBarangFarmasi(norec, idMenyerahkan, idMengetahui, idMenerima, jabatanMenyerahkan, jabatanMengetahui, jabatanMenerima, printBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());