update label farmasi nonlayanan

This commit is contained in:
ridwan 2025-01-15 08:35:11 +07:00
parent f322b3880f
commit be5f5cd3f2
3 changed files with 26 additions and 0 deletions

View File

@ -369,4 +369,12 @@ public class ReportingController {
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/label-farmasi-nonlayanan/{norec}"}, method = {RequestMethod.GET})
public void exportPdfLabelFarmasiNo(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfLabelFarmasiNo(norec);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
}

View File

@ -597,4 +597,18 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfLabelFarmasiNo(String norec) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "label_resep_manual.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
parameters.put("norec", norec);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var15) {
LOG.error("Exception at exportPdfLabelFarmasiNo");
LOG.error(ReportingDao.class, var15);
}
return null;
}
}

View File

@ -167,4 +167,8 @@ public class ReportingService {
return this.reportingDao.exportPdfDKamar();
}
public JasperPrint exportPdfLabelFarmasiNo(String norec) {
return this.reportingDao.exportPdfLabelFarmasiNo(norec);
}
}