Update Lap Tindakan

This commit is contained in:
Kals1um 2025-01-08 15:20:06 +07:00
parent ecd695d3f3
commit 35875d5e08
3 changed files with 36 additions and 0 deletions

View File

@ -349,4 +349,17 @@ public class ReportingController {
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/lap-tindakan"}, method = {RequestMethod.GET})
public void exportPdfLaporanTindakan(
@RequestParam("ruanganid") Integer ruanganid, @RequestParam("instalasiid") Integer instalasiid,
@RequestParam("unitid") Integer unitid, @RequestParam("produkid") Integer produkid,
@RequestParam("statusprodukid") Integer statusprodukid, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService
.printPdfLaporanTindakan(ruanganid, instalasiid, unitid, produkid, statusprodukid);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
}

View File

@ -564,4 +564,23 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfLaporanTindakan(
Integer ruanganid, Integer instalasiid, Integer unitid, Integer produkid, Integer statusprodukid) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "laporan_tindakan.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
parameters.put("ruanganid", ruanganid );
parameters.put("instalasiid", instalasiid);
parameters.put("unitid", unitid);
parameters.put("produkid", produkid);
parameters.put("statusprodukid", statusprodukid);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var19) {
LOG.error("Exception at exportPdfLaporanTindakan");
LOG.error(ReportingDao.class, var19);
}
return null;
}
}

View File

@ -159,4 +159,8 @@ public class ReportingService {
return this.reportingDao.exportPdfLabelFarmasi(norec);
}
public JasperPrint printPdfLaporanTindakan(Integer ruanganid, Integer instalasiid, Integer unitid, Integer produkid, Integer statusprodukid) {
return this.reportingDao.exportPdfLaporanTindakan(ruanganid, instalasiid, produkid, unitid, statusprodukid);
}
}