update param data tarif

This commit is contained in:
ridwan 2026-07-15 15:03:58 +07:00
parent 7536117c7a
commit a938fc1129
3 changed files with 74 additions and 5 deletions

View File

@ -1706,6 +1706,8 @@ public class ReportingController {
@RequestMapping(value = {"/daftar-tarif-ruangan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/daftar-tarif-ruangan"}, method = {RequestMethod.GET})
public void handleLpTarif( public void handleLpTarif(
@RequestParam(value = "idInstalasi", required = false, defaultValue = "") Integer idInstalasi, @RequestParam(value = "idInstalasi", required = false, defaultValue = "") Integer idInstalasi,
@RequestParam(value = "idUkp", required = false, defaultValue = "") Integer idUkp,
@RequestParam(value = "idRuangan", required = false, defaultValue = "") Integer idRuangan,
@RequestParam(value = "idProduk", required = false, defaultValue = "") Integer idProduk, @RequestParam(value = "idProduk", required = false, defaultValue = "") Integer idProduk,
@RequestParam(value = "idTarif", required = false, defaultValue = "") Integer idTarif, @RequestParam(value = "idTarif", required = false, defaultValue = "") Integer idTarif,
@RequestParam(value = "format", required = false, defaultValue = "pdf") String format, @RequestParam(value = "format", required = false, defaultValue = "pdf") String format,
@ -1716,7 +1718,7 @@ public class ReportingController {
JasperPrint jasperPrint = null; JasperPrint jasperPrint = null;
try { try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
jasperPrint = this.reportingService.exportLpTarif(idInstalasi, idProduk, idTarif, printBy); jasperPrint = this.reportingService.exportLpTarif(idInstalasi, idUkp, idRuangan, idProduk, idTarif, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -2774,4 +2776,49 @@ public class ReportingController {
} }
} }
@RequestMapping(value = {"/surat-pengiriman-jenazah"}, method = {RequestMethod.GET})
public void handleSuratPengirimanJenazah(
@RequestParam("smpk") Integer smpk,
@RequestParam(value = "format", required = false, defaultValue = "pdf") String format,
@RequestParam(value = "mode", required = false, defaultValue = "download") String mode,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel)
jasperPrint = this.reportingService.exporSuratPengirimanJenazah(smpk, printBy);
if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("Content-Disposition", "attachment; filename=Laporan_Log_Radiologi.xlsx");
JRXlsxExporter exporter = new JRXlsxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
SimpleXlsxReportConfiguration config = new SimpleXlsxReportConfiguration();
config.setOnePagePerSheet(false);
config.setDetectCellType(true);
config.setCollapseRowSpan(false);
config.setRemoveEmptySpaceBetweenRows(true);
config.setWhitePageBackground(false);
exporter.setConfiguration(config);
exporter.exportReport();
} else {
// Handle PDF preview
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "inline; filename=Laporan_Log_Radiologi.pdf");
JRPdfExporter exporter = new JRPdfExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport();
}
} finally {
jasperPrint = null;
}
}
} }

View File

@ -1398,12 +1398,14 @@ public class ReportingDao {
} }
return null; return null;
} }
public JasperPrint exportLpTarif(Integer idInstalasi, Integer idProduk, Integer idTarif, String printBy) { public JasperPrint exportLpTarif(Integer idInstalasi, Integer idUkp, Integer idRuangan, Integer idProduk, Integer idTarif, String printBy) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jaspersim2DirPath + "tindakan_mba_ayu_putri.jrxml"; String path = jaspersim2DirPath + "tindakan_mba_ayu_putri.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path); JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>(); Map<String, Object> parameters = new HashMap<>();
parameters.put("idInstalasi", idInstalasi); parameters.put("idInstalasi", idInstalasi);
parameters.put("idUkp", idUkp);
parameters.put("idRuangan", idRuangan);
parameters.put("idProduk", idProduk); parameters.put("idProduk", idProduk);
parameters.put("idTarif", idTarif); parameters.put("idTarif", idTarif);
parameters.put("printBy", printBy); parameters.put("printBy", printBy);
@ -1810,4 +1812,19 @@ public class ReportingDao {
return null; return null;
} }
public JasperPrint exporSuratPengirimanJenazah(Integer smpk, String printBy) {
try (Connection conn = this.jdbcTemplate4.getDataSource().getConnection()) {
String path = jasperDirPath + "Surat_pengantar_jenazah.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
parameters.put("smpk", smpk);
parameters.put("printBy", printBy);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var15) {
LOG.error("Exception at exporSuratPengirimanJenazah");
LOG.error(ReportingDao.class, var15);
}
return null;
}
} }

View File

@ -455,9 +455,9 @@ public class ReportingService {
return this.reportingDao.exportLpSatuSehat(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idPegawai, printBy); return this.reportingDao.exportLpSatuSehat(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idPegawai, printBy);
} }
public JasperPrint exportLpTarif(Integer idInstalasi, Integer idProduk, Integer idTarif, String printBy) { public JasperPrint exportLpTarif(Integer idInstalasi, Integer idUkp, Integer idRuangan, Integer idProduk, Integer idTarif, String printBy) {
log.info("Starting exportLpTarif with idInstalasi: {}, idProduk: {}, idTarif: {}, printBy: {}", idInstalasi, idProduk, idTarif, printBy); log.info("Starting exportLpTarif with idInstalasi: {}, idProduk: {}, idTarif: {}, printBy: {}", idInstalasi, idUkp, idRuangan, idProduk, idTarif, printBy);
return this.reportingDao.exportLpTarif(idInstalasi, idProduk, idTarif, printBy); return this.reportingDao.exportLpTarif(idInstalasi, idUkp, idRuangan, idProduk, idTarif, printBy);
} }
public JasperPrint exportLpRekapTidakan(String tglAwal, String tglAkhir, Integer idUnit, Integer idDokter, Integer idKp, Integer idProduk, String printBy) { public JasperPrint exportLpRekapTidakan(String tglAwal, String tglAkhir, Integer idUnit, Integer idDokter, Integer idKp, Integer idProduk, String printBy) {
@ -688,4 +688,9 @@ public class ReportingService {
return this.reportingDao.exportLpLogRadiologi(tglAwal, tglAkhir, printBy); return this.reportingDao.exportLpLogRadiologi(tglAwal, tglAkhir, printBy);
} }
public JasperPrint exporSuratPengirimanJenazah(Integer smpk, String printBy) {
log.info("Starting exporSuratPengirimanJenazah with smpk: {}, printBy: {}", smpk, printBy);
return this.reportingDao.exporSuratPengirimanJenazah(smpk, printBy);
}
} }