From 57f8cd4e5e34d385363d20935867402c60d5b765 Mon Sep 17 00:00:00 2001 From: ridwan Date: Tue, 26 Aug 2025 10:21:51 +0700 Subject: [PATCH] update param --- .../java/com/reporting/controller/ReportingController.java | 3 ++- src/main/java/com/reporting/dao/ReportingDao.java | 5 +++-- src/main/java/com/reporting/service/ReportingService.java | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/reporting/controller/ReportingController.java b/src/main/java/com/reporting/controller/ReportingController.java index 124e9ee..de5f2da 100644 --- a/src/main/java/com/reporting/controller/ReportingController.java +++ b/src/main/java/com/reporting/controller/ReportingController.java @@ -807,6 +807,7 @@ public class ReportingController { @RequestParam("tglAwal") String tglAwal, @RequestParam("tglAkhir") String tglAkhir, @RequestParam(value = "idInstalasi", required = false, defaultValue = "") Integer idInstalasi, + @RequestParam(value = "idUnit", required = false, defaultValue = "") Integer idUnit, @RequestParam(value = "idRuangan", required = false, defaultValue = "") Integer idRuangan, @RequestParam(value = "idProduk", required = false, defaultValue = "") Integer idProduk, @RequestParam(value = "idPegawai", required = false, defaultValue = "") Integer idPegawai, @@ -817,7 +818,7 @@ public class ReportingController { HttpServletResponse response) throws Exception { // Generate report (common for both PDF/Excel) - JasperPrint jasperPrint = this.reportingService.exportLpVolumeTindakan(tglAwal, tglAkhir, idInstalasi, idRuangan, idProduk, idPegawai, idKp, printBy); + JasperPrint jasperPrint = this.reportingService.exportLpVolumeTindakan(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idProduk, idPegawai, idKp, printBy); if ("excel".equalsIgnoreCase(format)) { // Handle Excel export diff --git a/src/main/java/com/reporting/dao/ReportingDao.java b/src/main/java/com/reporting/dao/ReportingDao.java index b1aefdc..b2e8a88 100644 --- a/src/main/java/com/reporting/dao/ReportingDao.java +++ b/src/main/java/com/reporting/dao/ReportingDao.java @@ -1111,7 +1111,7 @@ public class ReportingDao { } public JasperPrint exportKunjunganPasien(Date tglAwal, Date tglAkhir, Integer idRuangan, String printBy) { - try (Connection conn = this.jdbcTemplate3.getDataSource().getConnection()) { + try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { String path = jaspersim2DirPath + "kunjungan_pasien.jrxml"; JasperReport jasperReport = JasperCompileManager.compileReport(path); Map parameters = new HashMap<>(); @@ -1145,7 +1145,7 @@ public class ReportingDao { return null; } - public JasperPrint exportLpVolumeTindakan(Date tglAwal, Date tglAkhir, Integer idInstalasi, Integer idRuangan, Integer idProduk, Integer idPegawai, Integer idKp, String printBy) { + public JasperPrint exportLpVolumeTindakan(Date tglAwal, Date tglAkhir, Integer idInstalasi, Integer idUnit, Integer idRuangan, Integer idProduk, Integer idPegawai, Integer idKp, String printBy) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { String path = jaspersim2DirPath + "laporan_volume_tindakan_pasien.jrxml"; JasperReport jasperReport = JasperCompileManager.compileReport(path); @@ -1153,6 +1153,7 @@ public class ReportingDao { parameters.put("tglAwal", tglAwal); parameters.put("tglAkhir", tglAkhir); parameters.put("idInstalasi", idInstalasi); + parameters.put("idUnit", idInstalasi); parameters.put("idRuangan", idRuangan); parameters.put("idProduk", idProduk); parameters.put("idPegawai", idPegawai); diff --git a/src/main/java/com/reporting/service/ReportingService.java b/src/main/java/com/reporting/service/ReportingService.java index 19db5d3..07230e0 100644 --- a/src/main/java/com/reporting/service/ReportingService.java +++ b/src/main/java/com/reporting/service/ReportingService.java @@ -364,12 +364,12 @@ public class ReportingService { } } - public JasperPrint exportLpVolumeTindakan(String tglAwal, String tglAkhir, Integer idInstalasi, Integer idRuangan, Integer idProduk, Integer idPegawai, Integer idKp, String printBy) { + public JasperPrint exportLpVolumeTindakan(String tglAwal, String tglAkhir, Integer idInstalasi, Integer idUnit, Integer idRuangan, Integer idProduk, Integer idPegawai, Integer idKp, String printBy) { try { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); Date parse = formatter.parse(tglAwal); Date parse2 = formatter.parse(tglAkhir); - return this.reportingDao.exportLpVolumeTindakan(parse, parse2, idInstalasi, idRuangan, idProduk, idPegawai, idKp, printBy); + return this.reportingDao.exportLpVolumeTindakan(parse, parse2, idInstalasi, idUnit, idRuangan, idProduk, idPegawai, idKp, printBy); } catch (ParseException e) { log.error(e.getMessage());