diff --git a/src/main/java/com/reporting/dao/ReportingDao.java b/src/main/java/com/reporting/dao/ReportingDao.java index e21f1cc..074f047 100644 --- a/src/main/java/com/reporting/dao/ReportingDao.java +++ b/src/main/java/com/reporting/dao/ReportingDao.java @@ -1130,7 +1130,7 @@ public class ReportingDao { //Export Excel - public JasperPrint exportVisit(Timestamp tglAwal, Timestamp tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { + public JasperPrint exportVisit(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { String path = jaspersim2DirPath + "visit.jrxml"; JasperReport jasperReport = JasperCompileManager.compileReport(path); @@ -1149,7 +1149,7 @@ public class ReportingDao { return null; } - public JasperPrint exportWaktuRawatJalan(Timestamp tglAwal, Timestamp tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { + public JasperPrint exportWaktuRawatJalan(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { String path = jaspersim2DirPath + "waktu_rawat_jalan.jrxml"; JasperReport jasperReport = JasperCompileManager.compileReport(path); @@ -1168,7 +1168,7 @@ public class ReportingDao { return null; } - public JasperPrint exportWaktuRawatJalanTRB(Timestamp tglAwal, Timestamp tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { + public JasperPrint exportWaktuRawatJalanTRB(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { String path = jaspersim2DirPath + "waktu_rawat_jalan_trb.jrxml"; JasperReport jasperReport = JasperCompileManager.compileReport(path); @@ -1358,7 +1358,7 @@ public class ReportingDao { return null; } - public JasperPrint exportLpResumeMedis(Timestamp tglAwal, Timestamp tglAkhir, Integer idInstalasi, Integer idUnit, Integer idRuangan, Integer idPegawai, Integer idUnitSDM, String printBy) { + public JasperPrint exportLpResumeMedis(String tglAwal, String tglAkhir, Integer idInstalasi, Integer idUnit, Integer idRuangan, Integer idPegawai, Integer idUnitSDM, String printBy) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { String path = jaspersim2DirPath + "LaporanResumeMedis.jrxml"; JasperReport jasperReport = JasperCompileManager.compileReport(path); diff --git a/src/main/java/com/reporting/service/ReportingService.java b/src/main/java/com/reporting/service/ReportingService.java index a6e6016..7ce7e41 100644 --- a/src/main/java/com/reporting/service/ReportingService.java +++ b/src/main/java/com/reporting/service/ReportingService.java @@ -371,42 +371,18 @@ public class ReportingService { // Export Excel public JasperPrint exportVisit(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { - log.info("Starting exportVisit with tglAwal: {}, tglAkhir: {}, idDokter: {}, idRuangan: {}, iduNIT: {}, printBy: {}", tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); - try { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - Timestamp parse = new Timestamp(formatter.parse(tglAwal).getTime()); - Timestamp parse2 = new Timestamp(formatter.parse(tglAkhir).getTime()); - return this.reportingDao.exportVisit(parse, parse2, idDokter, idRuangan, idUnit, printBy); - } catch (ParseException e) { - log.error(e.getMessage()); - return null; - } + log.info("Starting exportVisit with tglAwal: {}, tglAkhir: {}, idDokter: {}, idRuangan: {}, idUnit: {}, printBy: {}", tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); + return this.reportingDao.exportVisit(tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); } public JasperPrint exportWaktuRawatJalan(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { - log.info("Starting exportWaktuRawatJalan with tglAwal: {}, tglAkhir: {}, idDokter: {}, idRuangan: {}, idUnit: {}, printBy: {}", tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); - try { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - Timestamp parse = new Timestamp(formatter.parse(tglAwal).getTime()); - Timestamp parse2 = new Timestamp(formatter.parse(tglAkhir).getTime()); - return this.reportingDao.exportWaktuRawatJalan(parse, parse2, idDokter, idRuangan, idUnit, printBy); - } catch (ParseException e) { - log.error(e.getMessage()); - return null; - } + log.info("Starting exportWaktuRawatJalan with tglAwal: {}, tglAkhir: {}, idDokter: {}, idRuangan: {}, idUnit: {}, printBy: {}", tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); + return this.reportingDao.exportWaktuRawatJalan(tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); } public JasperPrint exportWaktuRawatJalanTRB(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan, Integer idUnit, String printBy) { - log.info("Starting exportWaktuRawatJalanTRB with tglAwal: {}, tglAkhir: {}, idDokter: {}, idRuangan: {}, idUnit: {}, printBy: {}", tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); - try { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - Timestamp parse = new Timestamp(formatter.parse(tglAwal).getTime()); - Timestamp parse2 = new Timestamp(formatter.parse(tglAkhir).getTime()); - return this.reportingDao.exportWaktuRawatJalanTRB(parse, parse2, idDokter, idRuangan, idUnit, printBy); - } catch (ParseException e) { - log.error(e.getMessage()); - return null; - } + log.info("Starting exportWaktuRawatJalanTRB with tglAwal: {}, tglAkhir: {}, idDokter: {}, idRuangan: {}, idUnit: {}, printBy: {}", tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); + return this.reportingDao.exportWaktuRawatJalanTRB(tglAwal, tglAkhir, idDokter, idRuangan, idUnit, printBy); } public JasperPrint exportKunjunganPasien(String tglAwal, String tglAkhir, Integer idInstalasi, Integer idUnit, Integer idRuangan, String printBy) { @@ -464,16 +440,8 @@ public class ReportingService { } public JasperPrint exportLpResumeMedis(String tglAwal, String tglAkhir, Integer idInstalasi, Integer idUnit, Integer idRuangan, Integer idPegawai, Integer idUnitSDM, String printBy) { - log.info("Starting exportLpResumeMedis with tglAwal: {}, tglAkhir: {}, idInstalasi: {}, idUnit: {}, idRuangan: {}, idPegawai: {}, idUnitSDM: {}, printBy: {}", tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idPegawai, idUnitSDM, printBy); - try { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - Timestamp parse = new Timestamp(formatter.parse(tglAwal).getTime()); - Timestamp parse2 = new Timestamp(formatter.parse(tglAkhir).getTime()); - return this.reportingDao.exportLpResumeMedis(parse, parse2, idInstalasi, idUnit, idRuangan, idPegawai, idUnitSDM, printBy); - } catch (ParseException e) { - log.error(e.getMessage()); - return null; - } + log.info("Starting exportLpResumeMedis with tglAwal: {}, tglAkhir: {}, idInstalasi: {}, idUnit: {}, idRuangan: {}, idPegawai: {}, idUnitSDM: {}, printBy: {}", tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idPegawai, idUnitSDM, printBy); + return this.reportingDao.exportLpResumeMedis(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idPegawai, idUnitSDM, printBy); } public JasperPrint exportLpSatuSehat(String tglAwal, String tglAkhir, Integer idInstalasi, Integer idUnit, Integer idRuangan, Integer idPegawai, String printBy) {