Release Bukti Layanan Farmasi
This commit is contained in:
parent
1e2edb31ee
commit
19844ed0c7
@ -325,5 +325,13 @@ public class ReportingController {
|
|||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/bukti-layanan-farmasi/{norec}"}, method = {RequestMethod.GET})
|
||||||
|
public void exportPdfBuktiLayanan(@PathVariable("norec") String norec,
|
||||||
|
@RequestParam(value = "jenisbukti", required = false) String jenisbukti,
|
||||||
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiLayanan(norec, jenisbukti);
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -522,4 +522,32 @@ public class ReportingDao {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfBuktiLayanan(String norec) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jasperDirPath + "bukti_layanan.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 exportPdfBuktiLayanan");
|
||||||
|
LOG.error(ReportingDao.class, var17);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfBuktiNoLayanFarmasi(String norec) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jasperDirPath + "bukti_nonlayanan_farmasi.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 exportPdfBuktiNoLayanFarmasi");
|
||||||
|
LOG.error(ReportingDao.class, var17);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,4 +147,12 @@ public class ReportingService {
|
|||||||
return this.reportingDao.exportPdfSppb(norec);
|
return this.reportingDao.exportPdfSppb(norec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfBuktiLayanan(String norec, String jenisbukti) {
|
||||||
|
if (Objects.equals(jenisbukti, "NONLAYANAN")){
|
||||||
|
return this.reportingDao.exportPdfBuktiNoLayanFarmasi(norec);
|
||||||
|
} else {
|
||||||
|
return this.reportingDao.exportPdfBuktiLayanan(norec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user