update bukti layanan

This commit is contained in:
ridwan 2025-01-15 10:43:24 +07:00
parent be5f5cd3f2
commit 9e7f476792
3 changed files with 7 additions and 5 deletions

View File

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

View File

@ -522,12 +522,13 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfBuktiLayanan(String norec) {
public JasperPrint exportPdfBuktiLayanan(String norec, String user) {
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);
parameters.put("user", user);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var17) {
LOG.error("Exception at exportPdfBuktiLayanan");

View File

@ -147,8 +147,8 @@ public class ReportingService {
return this.reportingDao.exportPdfSppb(norec);
}
public JasperPrint exportPdfBuktiLayanan(String norec) {
return this.reportingDao.exportPdfBuktiLayanan(norec);
public JasperPrint exportPdfBuktiLayanan(String norec, String user) {
return this.reportingDao.exportPdfBuktiLayanan(norec, user);
}
public JasperPrint exportPdfBuktiNoLayanFarmasi(String norec) {