update buat bintaro

This commit is contained in:
ridwan 2025-01-16 09:42:27 +07:00
parent 9e7f476792
commit a17180f208
4 changed files with 58 additions and 0 deletions

View File

@ -378,4 +378,21 @@ public class ReportingController {
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/bukti-layanan-farmasi-bintaro/{norec}/{user}"}, method = {RequestMethod.GET})
public void exportPdfBuktiLayananBintaro(@PathVariable("norec") String norec,
@PathVariable("user") String user,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiLayananBintaro(norec, user);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/bukti-nonlayanan-farmasi-bintaro/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiNoLayanFarmasiBintaro(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiNoLayanFarmasiBintaro(norec);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
}

View File

@ -37,6 +37,9 @@ public class ReportingDao {
@Value("${application.jasper-xml.dir-path}")
String jasperDirPath;
@Value("${application.jasper-xml.dir-bintaro-path}")
String jasperBintaroDirPath;
public ReportingDao() {
}
@ -612,4 +615,33 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfBuktiLayananBintaro(String norec, String user) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperBintaroDirPath + "bukti_layanan_bintaro.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
parameters.put("norec", norec);
parameters.put("user", user);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var17) {
LOG.error("Exception at exportPdfBuktiLayananBintaro");
LOG.error(ReportingDao.class, var17);
}
return null;
}
public JasperPrint exportPdfBuktiNoLayanFarmasiBintaro(String norec) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperBintaroDirPath + "bukti_nonlayanan_farmasi_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 exportPdfBuktiNoLayanFarmasiBintaro");
LOG.error(ReportingDao.class, var17);
}
return null;
}
}

View File

@ -171,4 +171,12 @@ public class ReportingService {
return this.reportingDao.exportPdfLabelFarmasiNo(norec);
}
public JasperPrint exportPdfBuktiLayananBintaro(String norec, String user) {
return this.reportingDao.exportPdfBuktiLayananBintaro(norec, user);
}
public JasperPrint exportPdfBuktiNoLayanFarmasiBintaro(String norec) {
return this.reportingDao.exportPdfBuktiNoLayanFarmasiBintaro(norec);
}
}

View File

@ -7,5 +7,6 @@ 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-bintaro-path=/mnt/files/jasper-xml-bintaro/
application.pdf.dir-sep=/mnt/files/sep/
application.pdf.dir-lis=/mnt/lis/