update label bintaro

This commit is contained in:
ridwan 2025-02-03 09:46:30 +07:00
parent 8d86038c89
commit 53a4d429a2
3 changed files with 52 additions and 0 deletions

View File

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

View File

@ -689,4 +689,32 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfLabelNoLayanFarmasiBintaro(String norec) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperBintaroDirPath + "label_resep_manual_bintaro.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
parameters.put("norec", norec);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var17) {
LOG.error("Exception at exportPdfLabelNoLayanFarmasiBintaro");
LOG.error(ReportingDao.class, var17);
}
return null;
}
public JasperPrint exportPdfLabelFarmasiBintaro(String norec) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperBintaroDirPath + "label_farmasi_racikan_bintaro.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 exportPdfLabelFarmasiBintaro");
LOG.error(ReportingDao.class, var15);
}
return null;
}
}

View File

@ -194,4 +194,12 @@ public class ReportingService {
return this.reportingDao.exportPdfBuktiNoLayanFarmasiBintaro(norec);
}
public JasperPrint exportPdfLabelNoLayanFarmasiBintaro(String norec) {
return this.reportingDao.exportPdfLabelNoLayanFarmasiBintaro(norec);
}
public JasperPrint exportPdfLabelFarmasiBintaro(String norec) {
return this.reportingDao.exportPdfLabelFarmasiBintaro(norec);
}
}