update param

This commit is contained in:
ridwan 2025-08-26 10:21:51 +07:00
parent 8c89bcb757
commit 57f8cd4e5e
3 changed files with 7 additions and 5 deletions

View File

@ -807,6 +807,7 @@ public class ReportingController {
@RequestParam("tglAwal") String tglAwal, @RequestParam("tglAwal") String tglAwal,
@RequestParam("tglAkhir") String tglAkhir, @RequestParam("tglAkhir") String tglAkhir,
@RequestParam(value = "idInstalasi", required = false, defaultValue = "") Integer idInstalasi, @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 = "idRuangan", required = false, defaultValue = "") Integer idRuangan,
@RequestParam(value = "idProduk", required = false, defaultValue = "") Integer idProduk, @RequestParam(value = "idProduk", required = false, defaultValue = "") Integer idProduk,
@RequestParam(value = "idPegawai", required = false, defaultValue = "") Integer idPegawai, @RequestParam(value = "idPegawai", required = false, defaultValue = "") Integer idPegawai,
@ -817,7 +818,7 @@ public class ReportingController {
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
// Generate report (common for both PDF/Excel) // 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)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export

View File

@ -1111,7 +1111,7 @@ public class ReportingDao {
} }
public JasperPrint exportKunjunganPasien(Date tglAwal, Date tglAkhir, Integer idRuangan, String printBy) { 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"; String path = jaspersim2DirPath + "kunjungan_pasien.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path); JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>(); Map<String, Object> parameters = new HashMap<>();
@ -1145,7 +1145,7 @@ public class ReportingDao {
return null; 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()) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jaspersim2DirPath + "laporan_volume_tindakan_pasien.jrxml"; String path = jaspersim2DirPath + "laporan_volume_tindakan_pasien.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path); JasperReport jasperReport = JasperCompileManager.compileReport(path);
@ -1153,6 +1153,7 @@ public class ReportingDao {
parameters.put("tglAwal", tglAwal); parameters.put("tglAwal", tglAwal);
parameters.put("tglAkhir", tglAkhir); parameters.put("tglAkhir", tglAkhir);
parameters.put("idInstalasi", idInstalasi); parameters.put("idInstalasi", idInstalasi);
parameters.put("idUnit", idInstalasi);
parameters.put("idRuangan", idRuangan); parameters.put("idRuangan", idRuangan);
parameters.put("idProduk", idProduk); parameters.put("idProduk", idProduk);
parameters.put("idPegawai", idPegawai); parameters.put("idPegawai", idPegawai);

View File

@ -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 { try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Date parse = formatter.parse(tglAwal); Date parse = formatter.parse(tglAwal);
Date parse2 = formatter.parse(tglAkhir); 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) { } catch (ParseException e) {
log.error(e.getMessage()); log.error(e.getMessage());