update buat bintaro
This commit is contained in:
parent
9e7f476792
commit
a17180f208
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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/
|
||||
Loading…
x
Reference in New Issue
Block a user