diff --git a/src/main/java/com/reporting/controller/ReportingController.java b/src/main/java/com/reporting/controller/ReportingController.java index 6a61d59..f7f5471 100644 --- a/src/main/java/com/reporting/controller/ReportingController.java +++ b/src/main/java/com/reporting/controller/ReportingController.java @@ -327,9 +327,16 @@ public class ReportingController { @RequestMapping(value = {"/bukti-layanan-farmasi/{norec}"}, method = {RequestMethod.GET}) public void exportPdfBuktiLayanan(@PathVariable("norec") String norec, - @RequestParam(value = "jenisbukti", required = false) String jenisbukti, ModelAndView mv, HttpServletResponse response) throws Exception { - JasperPrint jasperPrint = this.reportingService.exportPdfBuktiLayanan(norec, jenisbukti); + JasperPrint jasperPrint = this.reportingService.exportPdfBuktiLayanan(norec); + response.setContentType("application/pdf"); + JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); + } + + @RequestMapping(value = {"/bukti-nonlayanan-farmasi/{norec}"}, method = {RequestMethod.GET}) + public void exportPdfBuktiNoLayanFarmasi(@PathVariable("norec") String norec, + ModelAndView mv, HttpServletResponse response) throws Exception { + JasperPrint jasperPrint = this.reportingService.exportPdfBuktiNoLayanFarmasi(norec); response.setContentType("application/pdf"); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); } diff --git a/src/main/java/com/reporting/service/ReportingService.java b/src/main/java/com/reporting/service/ReportingService.java index 7a3d4ea..5b60831 100644 --- a/src/main/java/com/reporting/service/ReportingService.java +++ b/src/main/java/com/reporting/service/ReportingService.java @@ -147,12 +147,12 @@ public class ReportingService { return this.reportingDao.exportPdfSppb(norec); } - public JasperPrint exportPdfBuktiLayanan(String norec, String jenisbukti) { - if (Objects.equals(jenisbukti, "NONLAYANAN")){ - return this.reportingDao.exportPdfBuktiNoLayanFarmasi(norec); - } else { + public JasperPrint exportPdfBuktiLayanan(String norec) { return this.reportingDao.exportPdfBuktiLayanan(norec); - } + } + + public JasperPrint exportPdfBuktiNoLayanFarmasi(String norec) { + return this.reportingDao.exportPdfBuktiNoLayanFarmasi(norec); } }