From 53a4d429a257ca14ddce5085bd1fcdc890972a2c Mon Sep 17 00:00:00 2001 From: ridwan Date: Mon, 3 Feb 2025 09:46:30 +0700 Subject: [PATCH] update label bintaro --- .../controller/ReportingController.java | 16 +++++++++++ .../java/com/reporting/dao/ReportingDao.java | 28 +++++++++++++++++++ .../reporting/service/ReportingService.java | 8 ++++++ 3 files changed, 52 insertions(+) diff --git a/src/main/java/com/reporting/controller/ReportingController.java b/src/main/java/com/reporting/controller/ReportingController.java index b425ae8..907ca2e 100644 --- a/src/main/java/com/reporting/controller/ReportingController.java +++ b/src/main/java/com/reporting/controller/ReportingController.java @@ -423,4 +423,20 @@ public class ReportingController { JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); } + @RequestMapping(value = {"/label-farmasi-nonlayanan-bintaro/{norec}"}, method = {RequestMethod.GET}) + public void exportPdfLabelNoLayanFarmasiBintaro(@PathVariable("norec") String norec, + ModelAndView mv, HttpServletResponse response) throws Exception { + JasperPrint jasperPrint = this.reportingService.exportPdfLabelNoLayanFarmasiBintaro(norec); + response.setContentType("application/pdf"); + JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); + } + + @RequestMapping(value = {"/label-farmasi-bintaro/{norec}"}, method = {RequestMethod.GET}) + public void exportPdfLabelFarmasiBintaro(@PathVariable("norec") String norec, + ModelAndView mv, HttpServletResponse response) throws Exception { + JasperPrint jasperPrint = this.reportingService.exportPdfLabelFarmasiBintaro(norec); + response.setContentType("application/pdf"); + JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); + } + } diff --git a/src/main/java/com/reporting/dao/ReportingDao.java b/src/main/java/com/reporting/dao/ReportingDao.java index 6145776..2ad8c5a 100644 --- a/src/main/java/com/reporting/dao/ReportingDao.java +++ b/src/main/java/com/reporting/dao/ReportingDao.java @@ -689,4 +689,32 @@ public class ReportingDao { return null; } + public JasperPrint exportPdfLabelNoLayanFarmasiBintaro(String norec) { + try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { + String path = jasperBintaroDirPath + "label_resep_manual_bintaro.jrxml"; + JasperReport jasperReport = JasperCompileManager.compileReport(path); + Map parameters = new HashMap<>(); + parameters.put("norec", norec); + return JasperFillManager.fillReport(jasperReport, parameters, conn); + } catch (Exception var17) { + LOG.error("Exception at exportPdfLabelNoLayanFarmasiBintaro"); + LOG.error(ReportingDao.class, var17); + } + return null; + } + + public JasperPrint exportPdfLabelFarmasiBintaro(String norec) { + try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { + String path = jasperBintaroDirPath + "label_farmasi_racikan_bintaro.jrxml"; + JasperReport jasperReport = JasperCompileManager.compileReport(path); + Map parameters = new HashMap<>(); + parameters.put("norec", norec); + return JasperFillManager.fillReport(jasperReport, parameters, conn); + } catch (Exception var15) { + LOG.error("Exception at exportPdfLabelFarmasiBintaro"); + LOG.error(ReportingDao.class, var15); + } + return null; + } + } diff --git a/src/main/java/com/reporting/service/ReportingService.java b/src/main/java/com/reporting/service/ReportingService.java index 3021fa1..3107da1 100644 --- a/src/main/java/com/reporting/service/ReportingService.java +++ b/src/main/java/com/reporting/service/ReportingService.java @@ -194,4 +194,12 @@ public class ReportingService { return this.reportingDao.exportPdfBuktiNoLayanFarmasiBintaro(norec); } + public JasperPrint exportPdfLabelNoLayanFarmasiBintaro(String norec) { + return this.reportingDao.exportPdfLabelNoLayanFarmasiBintaro(norec); + } + + public JasperPrint exportPdfLabelFarmasiBintaro(String norec) { + return this.reportingDao.exportPdfLabelFarmasiBintaro(norec); + } + }