update label farmasi

This commit is contained in:
Kals1um 2025-01-07 15:08:41 +07:00
parent b1e5e933bd
commit d04cef3e17
4 changed files with 27 additions and 1 deletions

View File

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

View File

@ -550,4 +550,18 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfLabelFarmasi(String norec) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "label_farmasi_racikan.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 exportPdfLabelFarmasi");
LOG.error(ReportingDao.class, var15);
}
return null;
}
}

View File

@ -155,4 +155,8 @@ public class ReportingService {
return this.reportingDao.exportPdfBuktiNoLayanFarmasi(norec);
}
public JasperPrint exportPdfLabelFarmasi(String norec) {
return this.reportingDao.exportPdfLabelFarmasi(norec);
}
}

View File

@ -6,6 +6,6 @@ spring.datasource.username=postgres
spring.datasource.password=root
spring.mvc.dispatch-trace-request=true
spring.main.banner-mode=off
application.jasper-xml.dir-path=/mnt/files/jasper-xml/
application.jasper-xml.dir-path=D:\\UP\\
application.pdf.dir-sep=/mnt/files/sep/
application.pdf.dir-lis=/mnt/lis/