Update service reporting

Akomodasi cetakan label paket
This commit is contained in:
Salman Manoe 2023-08-29 14:13:06 +07:00
parent 300c465eec
commit ccc1d5e4a7
3 changed files with 26 additions and 0 deletions

View File

@ -260,6 +260,14 @@ public class ReportingController {
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/label-paket/{norecvoucher}"}, method = {RequestMethod.GET})
public void exportLabelPaket(@PathVariable("norecvoucher") String norecVoucher,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfLabelPaket(norecVoucher);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/lap-resume-medis/{norec}"}, method = {RequestMethod.GET})
public void printLapResumeMedis(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {

View File

@ -334,6 +334,20 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfLabelPaket(String norecVoucher) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "label_paket.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
parameters.put("norecvoucher", norecVoucher);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var15) {
LOG.error("Exception at exportPdfLabelPaket");
LOG.error(ReportingDao.class, var15);
}
return null;
}
public JasperPrint exportPdfResumeMedis(String norec) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "ResumeMedis.jrxml";

View File

@ -88,6 +88,10 @@ public class ReportingService {
return this.reportingDao.exportPdfGelangPasien(noregistrasi);
}
public JasperPrint exportPdfLabelPaket(String norecVoucher) {
return this.reportingDao.exportPdfLabelPaket(norecVoucher);
}
public JasperPrint exportPdfResumeMedis(String norec) {
return this.reportingDao.exportPdfResumeMedis(norec);
}